Skip to content

Commit

Permalink
Merge pull request #2099 from arunimaChintu/clash
Browse files Browse the repository at this point in the history
Adds "Clash Of Clans" game
  • Loading branch information
Sulagna-Dutta-Roy authored Jul 4, 2024
2 parents 44d259b + 2d72adc commit 7c4b14f
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Clash Of Clans/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clash of Clans GG Script</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Clash of Clans GG Script</h1>
<button id="modify-gems">Modify Gems</button>
<button id="modify-gold">Modify Gold</button>
<button id="modify-elixir">Modify Elixir</button>
<button id="exit">Exit</button>
<script src="script.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions Clash Of Clans/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"manifest_version": 2,
"name": "Clash of Clans GG Script",
"version": "1.0",
"description": "A script to modify gems, gold, and elixir in Clash of Clans for educational purposes.",
"icons": {
"48": "icon.png"
},
"browser_action": {
"default_popup": "index.html",
"default_icon": "icon.png"
},
"permissions": [
"activeTab"
]
}

63 changes: 63 additions & 0 deletions Clash Of Clans/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Function to modify gems
function modifyGems() {
let gems = prompt("Enter your current amount of gems:");
gems = parseInt(gems);
if (isNaN(gems)) {
alert("Invalid number. Please try again.");
return;
}
let newGems = 999999;
alert(`Gems modified successfully to ${newGems}!`);
}

// Function to modify gold
function modifyGold() {
let gold = prompt("Enter your current amount of gold:");
gold = parseInt(gold);
if (isNaN(gold)) {
alert("Invalid number. Please try again.");
return;
}
let newGold = 999999999;
alert(`Gold modified successfully to ${newGold}!`);
}

// Function to modify elixir
function modifyElixir() {
let elixir = prompt("Enter your current amount of elixir:");
elixir = parseInt(elixir);
if (isNaN(elixir)) {
alert("Invalid number. Please try again.");
return;
}
let newElixir = 999999999;
alert(`Elixir modified successfully to ${newElixir}!`);
}

// Function to handle button clicks
function handleButtonClick(event) {
const buttonId = event.target.id;
switch (buttonId) {
case "modify-gems":
modifyGems();
break;
case "modify-gold":
modifyGold();
break;
case "modify-elixir":
modifyElixir();
break;
case "exit":
alert("Exiting script...");
break;
default:
break;
}
}

// Add event listeners to buttons
document.getElementById("modify-gems").addEventListener("click", handleButtonClick);
document.getElementById("modify-gold").addEventListener("click", handleButtonClick);
document.getElementById("modify-elixir").addEventListener("click", handleButtonClick);
document.getElementById("exit").addEventListener("click", handleButtonClick);

21 changes: 21 additions & 0 deletions Clash Of Clans/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f0f0;
}

button {
margin: 10px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}

h1 {
margin-bottom: 20px;
}

0 comments on commit 7c4b14f

Please sign in to comment.