-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
71 lines (55 loc) · 6.25 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const savel = {varTreasureMapAmount:0,varTotalMapsSolved:0,varTreasureChestAmount:0,varWoodAmount:0,varStoneAmount:0,varCopperAmount:0,varIronAmount:0,varSilverAmount:0,varGoldAmount:0,varPirateGoldAmount:0,varSapphireAmount:0,varEmeraldAmount:0,varRubyAmount:0,varJadeAmount:0,varOpalAmount:0,varTopazAmount:0,varTanzaniteAmount:0,varSeaCrystalAmount:0,varDiamondAmount:0,varTitaniumAmount:0,varBloodCrystalAmount:0,varPromethiumAmount:0,varHasOilPipe:0,varOilAmount:0,varPumpJack:0,varOilDraining:0,varHasOilRefinery:0,varCoinsAmount:0,varPickaxeType:0,varWiggerAmount:0,varWoodchopperAmount:0,varWiggerPickaxeType:0,varMiningDrill:0,varCrusherAmount:0,varCrusherIsOn:0,varExcavatorAmount:0,varExcavatorIsOn:0,varHasTitaniumDrills:0,varHasPirate:0,varClickerBonus:0,varResearcher:0,varMadScientist:0,varHasRobot:0,varHasTunnels:0,varHasGardenerExpert:0,varHasVIPPass:0,varAchievementPoints:0,varHasAchRookieMiner:0,varHasAchIntermediateMiner:0,varHasAchExpertMiner:0,varHasAchMasterMiner:0,varHasAchLeaderMiner:0,varHasAchDiamondHunt:0,varHasAchDiamondPickaxeAtWork:0,varHasAchDonation:0,varHasAchSell3000Gold:0,varHasAcheBurnBabyBurn:0,varHasAchExcavator:0,varHasAchOneMilStone:0,varHasAchSell500SeaCrystal:0,varHasAchReset:0,varHasAchPopulation100:0,varHasAchPopulation10000:0,varHasAchPopulation100000:0,varHasAchPopulation1000000:0,varHasAchPopulation5000000:0,varHasAchDiamondRing:0,varTotalMineClicks2:0,varTotalOilAmount:0,varTotalStoneAmount:0,varTotalCopperAmount:0,varTotalIronAmount:0,varTotalSilverAmount:0,varTotalGoldAmount:0,varTotalSapphireAmount:0,varTotalEmeraldAmount:0,varTotalRubyAmount:0,varTotalJadeAmount:0,varTotalOpalAmount:0,varTotalTopazAmount:0,varTotalTanzaniteAmount:0,varTotalSeaCrystalAmount:0,varTotalDiamondAmount:0,varCoinsAmountTotal:0,varUraniumAmount:0,varTotalBronzeBarAmount:0,varTotalIronBarAmount:0,varTotalSilverBarAmount:0,varTotalGoldBarAmount:0,varTotalTitaniumBarAmount:0,varTotalCrushedSeaCrystalAmount:0,varTotalCrushedTanzaniteAmount:0,varTotalCrushedDiamondAmount:0,varTotalResets:0,varDiamondsEarnedOnReset:0,varDivisionLevel:0,varHasWorkBench:0,varHasFurnace:0,varFurnaceOreAmount:0,varFurnaceOreType:0,varFurnaceCapacity:100,varHasGemCrusher:0,varGemCrusherCapacity:100,varCrusherGemAmount:0,varCrusherGemType:0,varBronzeBarAmount:0,varIronBarAmount:0,varSilverBarAmount:0,varGoldBarAmount:0,varTitaniumBarAmount:0,varCrushedTanzaniteAmount:0,varCrushedSeaCrystalAmount:0,varCrushedDiamondAmount:0,varGunPowderAmount:0,varHasGoldenClicker:0,varHasGoldPumpjack:0,varGoldRingAmount:0,varBronzeRingAmount:0,varSapphireRingAmount:0,varEmeraldRingAmount:0,varRubyRingAmount:0,varDiamondRingAmount:0,varHasMiningCamp:0,varHasWoodcuttingCamp:0,varCopperWireAmount:0,varTntAmount:0,varHasFurnaceUpgrade2:0,varFlagGatheringTabHint:0,varFlagKeyTabHint:0,varFlagStoreTabHint:0,varFlagAchievementTabHint:0,varHasCauldron:0,varHasBackPack:0,varDottedGreenLeafAmount:0,varGreenLeafAmount:0,varLimeLeafAmount:0,varRedLeafAmount:0,varGoldLeafAmount:0,varCrystalLeafAmount:0,varRedMushroomAmount:0,varBlewitMushroomAmount:0,varVialOfWaterAmount:0,varSnapeGrassAmount:0,varTotalDottedGreenLeafAmount:0,varTotalGreenLeafAmount:0,varTotalLimeLeafAmount:0,varTotalRedLeafAmount:0,varTotalGoldLeafAmount:0,varTotalCrystalLeafAmount:0,varSmeltingPotionAmount:0,varSmeltingPotionAmountDiscovered:0,varClickerPotionAmount:0,varClickerPotionAmountDiscovered:0,varWoodcuttingPotionAmount:0,varWoodcuttingPotionAmountDiscovered:0,varOilPotionAmount:0,varOilPotionAmountDiscovered:0,varCharmingPotionAmount:0,varCharmingPotionAmountDiscovered:0,varBarPotionAmount:0,varBarPotionAmountDiscovered:0,varTntPotionAmount:0,varTntPotionAmountDiscovered:0,varSuperOilPotionAmount:0,varSuperOilPotionAmountDiscovered:0,varPlayerXPToCollect:0,varPlayerXP:0,varPlayerXPToCollectBrewing:0,varPlayerXPBrewing:0,varSoundIsOff:0,varPopulationAmount:0,varElectricityAmount:0,varWaterAmount:0,varPoluationLevel:0,varEducationLevel:0,varHapinessLevel:0,varAllowedPopulationAmount:200,varWindTurbineAmount:0,varSmallWaterReserveAmount:0,varPowerPlantAmount:0,varOilPowerPlantAmount:0,varNuclearPowerPlantAmount:0,varLargeWaterReserveAmount:0,varElementarySchoolAmount:0,varMiddleSchoolAmount:0,varHasCrystalPumpjack:0,varHasCauldronUpgrade:0,varHasOilTrain:0,varHasTrainTracks:0,varGiantDrillAmount:0,varRoadHeaderAmount:0,varGiantDrillIsOn:0,varRoadHeaderIsOn:0,varHasWoodChipper:0,varSellAllStoneOn:0,varSellAllCopperOn:0,varSellAllIronOn:0,varSellAllSilverOn:0,varSellAllGoldOn:0,varSellAllSapphireOn:0,varSellAllEmeraldOn:0,varSellAllRubyOn:0,varSellAllDiamondOn:0,varSellAllJadeOn:0,varSellAllOpalOn:0,varSellAllTopazOn:0,varSellAllTanzaniteOn:0,varSellAllSeaCrystalOn:0};
function importButton() {
save = atob(document.getElementById("import-text").value);
var array = save.split("/");
var keys = Object.keys(savel);
for(var i = 0; i < array.length; i++)
{
cookieSplit = array[i].split("=");
var key = keys[i];
if (key) {
savel[key] = cookieSplit[1];
}
}
document.getElementById("inputs-container").innerHTML="";
generateInputs();
}
function generateInputs() {
var inputsContainer = document.getElementById("inputs-container");
for (var key in savel) {
var inputDiv = document.createElement("div");
var label = document.createElement("p");
var keyWithoutVar = key.replace("var", "");
var words = keyWithoutVar.match(/[A-Z][a-z]+/g);
label.textContent = words.join(" ");
var input = document.createElement("input");
input.id = key;
input.type = "text";
input.value = savel[key];
inputDiv.appendChild(label);
inputDiv.appendChild(input);
inputsContainer.appendChild(inputDiv);
}
}
function updateSavel() {
var inputsContainer = document.getElementById("inputs-container");
var inputDivs = inputsContainer.getElementsByTagName("div");
for (var i = 0; i < inputDivs.length; i++) {
var inputDiv = inputDivs[i];
var input = inputDiv.getElementsByTagName("input")[0];
var key = input.id;
var value = input.value;
savel[key] = value;
}
generateSaveString();
}
function generateSaveString() {
var saveString = "";
for (var key in savel) {
var value = savel[key];
saveString += key + "=" + value + "/";
}
saveString = saveString + "varSellAllDiamondOn=0/"
saveString = btoa(saveString);
document.getElementById("export-text").value = saveString;
}