genBTC

hider's trimpgame-mod

Sep 1st, 2016 (edited)
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //original globals
  2. var buildcounter = 0;
  3. var autoTSettings = {};
  4. var version = "0.37b.17T2";
  5.  
  6. //setup talk button
  7. document.getElementById("buildingsQueue").style = "width: 70%; float: left;";
  8. document.getElementById("queueContainer").insertAdjacentHTML('beforeend', '<div style="color: rgb(255, 255, 255); font-size: 1.2em; text-align: center; width: 10%; float: right; margin-left: 1%; margin-right: 1%; vertical-align;"><div id="talkingBtn" class="workBtn pointer noselect" onclick="talk()" style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; margin-top: 0.5vh;">Talk</div></div>');
  9. letMeTalk = document.getElementById("talkingBtn");
  10. letMeTalk.setAttribute("onmouseover", 'tooltip(\"Talk\", \"customText\", event, \"It knows a lot about how Trimps works.\")');
  11. letMeTalk.setAttribute("onmouseout", 'tooltip("hide")');
  12. //setup talk window
  13. document.getElementById("boneWrapper").insertAdjacentHTML('beforebegin', '<div id="autotrimp" style="position: absolute; background: rgb(0, 0, 0) none repeat scroll 0% 0%; border: 2px solid rgb(0, 0, 0); width: 64vw; margin: 6vh 18vw; z-index: 10000000; text-align: center; font-size: 1.3vw; display: none; padding: 0.2vw; color: rgb(255, 255, 255);"><div style="width: 100%; display: table; border-spacing: 0.3vw;" id="autotrimp0"><div style="display: table-row;" id="autorow"><div style="border: 1px solid white; background: rgb(153, 153, 77) none repeat scroll 0% 0%; display: table-cell; width: 20%;" id="pic"><img style="max-height: 13vw;" src="https://cloud.githubusercontent.com/assets/14081390/9893516/d9db4782-5bde-11e5-8791-91638bb6aaae.jpg"></div><div id="qs" style="border: 1px solid white; background: rgb(153, 153, 77) none repeat scroll 0% 0%; display: table-cell; width: 60%; vertical-align: top; padding: 0.5%;"><p style="text-align: left; font-size: 0.9em;" id="q">This is the question.</p><p></p><p style="font-size: 0.8em;"><a style="color: rgb(128, 0, 0); text-decoration: underline;" href="#" id="1" onclick="alert(\'clicked\')">Answer 1</a></p><p style="font-size: 0.8em;"><a style="color: rgb(128, 0, 0); text-decoration: underline;" href="#" id="2" onclick="alert(\'clicked\')">Answer 2</a></p><p style="font-size: 0.8em;"><a style="color: rgb(128, 0, 0); text-decoration: underline;" href="#" id="3" onclick="alert(\'clicked\')"></a></p></div><div id="button" style="display: table-cell; width: 20%; background: rgb(0, 0, 0) none repeat scroll 0% 0%; vertical-align: top;"><div class="boneBtn dangerColor pointer noselect" onclick="document.getElementById(\'autotrimp\').style.display = \'none\'">Close</div></div></div></div></div>');
  14. document.getElementById("autotrimp").insertAdjacentHTML('beforeend', '<div style="width: 100%; display: table; border-spacing:0.3vw;" id="genBTCTrimp"><div style="border: 1px solid white; background: rgb(0, 0, 0) none repeat scroll 0% 0%; width: 100%; padding: .3vw;" id="autosettings0"> <a href="https://discord.gg/0VbWe0dxB9kIfV2C" target="_blank">Join the chat</div></div>');
  15.  
  16. //setup paint button
  17. document.getElementById("queueContainer").insertAdjacentHTML('beforeend', '<div style="color: rgb(255, 255, 255); font-size: 1.2em; text-align: center; width: 10%; float: right; vertical-align;"><div id="paintingBtn" class="workBtn pointer noselect" onclick="paint()" style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; margin-top: 0.5vh;">Paint</div></div>');
  18. letMePaint = document.getElementById("paintingBtn");
  19. letMePaint.setAttribute("onmouseover", 'tooltip(\"Paint\", \"customText\", event, \"It can paint things.\")');
  20. letMePaint.setAttribute("onmouseout", 'tooltip("hide")');
  21. //setup paint window
  22. document.getElementById("queueContainer").insertAdjacentHTML('beforebegin', '<div id="paintTrimp" style="position: absolute; background: black none repeat scroll 0% 0%; border: 2px solid black; width: 64vw; margin: 7vh 18vw; z-index: 10000000; text-align: center; font-size: 1.3vw; display: none; padding: 0.2vw; color: white;"><div style="width: 100%; display: table; border-spacing: 0.3vw;" id="paintTrimp0"><div style="display: table-row;" id="autorow"><div style="border: 1px solid white; background: rgb(153, 77, 153) none repeat scroll 0% 0%; display: table-cell; width: 25%;" id="pic"><img style="max-height: 16vw;" src="https://orig09.deviantart.net/a8d5/f/2010/266/7/a/fortune_teller_by_sephiroth_art-d2zbmhv.jpg"></div><div id="qs" style="border: 1px solid white; background: rgb(153, 77, 153) none repeat scroll 0% 0%; display: table-cell; width: 55%; vertical-align: top; padding: 0.5%;"><p style="text-align: left; font-size: 0.9em;" id="q">Lets paint.</p><div style="display: table-row;text-align: left; font-size: 0.7em; color: SPRINGGREEN;"><div style="width:65%; position:relative; display:table-cell;"><p  ><input id="zonePic"><b>Zone Picture</b></p><p><input id="mapPic"><b>Map Picture</b></p><p><input id="prePic"><b>Pre Map Picture</b></p><p style=""><input id="voidPic"><b>Void Maps Picture</b></p><p><input id="spirePic"><b>Spire Picture</b></p></div><div style="width:35%; position:relative; display:table-cell;"><p><input id="BR" style="width:20%;"><b>BR</b><input id="BG" style="width:20%;"><b>BG</b><input id="BB" style="width:20%;"><b>BB</b></p><p><input id="CR" style="width:20%;"><b>CR</b><input id="CG" style="width:20%;"><b>CG</b><input id="CB" style="width:20%;"><b>CB</b><p></div></div></div><div id="button" style="display: table-cell; width: 20%; background: black none repeat scroll 0% 0%; vertical-align: top;"><div class="boneBtn dangerColor pointer noselect" onclick="document.getElementById(\'paintTrimp\').style.display = \'none\'">Close</div></div></div></div></div>');
  23. //HiderTryThatFailed//document.getElementById("boneWrapper").insertAdjacentHTML('beforebegin', '<div id="paintTrimp" style="position: absolute; background: rgb(0, 0, 0) none repeat scroll 0% 0%; border: 2px solid rgb(0, 0, 0); width: 64vw; margin: 6vh 18vw; z-index: 10000000; text-align: center; font-size: 1.3vw; display: none; padding: 0.2vw; color: rgb(255, 255, 255);"><div style="width: 100%; display: table; border-spacing: 0.3vw;" id="paintTrimp0"><div style="display: table-row;" id="autorow"><div style="border: 1px solid white; background: rgb(153, 77, 153) none repeat scroll 0% 0%; display: table-cell; width: 20%;" id="pic"><img style="max-height: 13vw;" src="https://orig09.deviantart.net/a8d5/f/2010/266/7/a/fortune_teller_by_sephiroth_art-d2zbmhv.jpg"></div><div id="qs" style="border: 1px solid white; background: rgb(153, 77, 153) none repeat scroll 0% 0%; display: table-cell; width: 60%; vertical-align: top; padding: 0.5%;"><p style="text-align: left; font-size: 0.9em;" id="q">Lets paint.</p><div style="display: table-row;"><div style="width:65%; position:relative; display:table-cell;"><p style="text-align: left; font-size: 0.6em;" ><input id="zonePic">Zone Picture</p><p style="text-align: left; font-size: 0.6em;"><input id="mapPic">Map Picture</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="prePic">Pre Map Picture</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="voidPic">Void Maps Picture</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="spirePic">Spire Picture</p></div><div style="width:35%; position:relative; display:table-cell;" ><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="BR" style="width:10%;">BR</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="BG" style="width:10%;">BG</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="BB" style="width:10%;">BB</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="CR" style="width:10%;">CR<p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="CG" style="width:10%;">CG</p><p style="text-align: left; font-size: 0.6em; color: rgb(153, 77 153);"><input id="CB" style="width:10%;">CB</p></div></div></div><div id="button" style="display: table-cell; width: 20%; background: rgb(0, 0, 0) none repeat scroll 0% 0%; vertical-align: top;"><div class="boneBtn dangerColor pointer noselect" onclick="document.getElementById(\'paintTrimp\').style.display = \'none\'">Close</div></div></div></div></div>');
  24. //beforebegin //afterbegin //beforeend //afterend
  25.  
  26. function getNiceThingsDone() {
  27.     var zp = document.getElementById("zonePic").value;
  28.     var pp = document.getElementById("prePic").value;
  29.     var vp = document.getElementById("voidPic").value;
  30.     var mp = document.getElementById("mapPic").value;
  31.     var sp = document.getElementById("spirePic").value;
  32.     if (zp.length > 5 || pp.length > 5 || vp.length > 5 || mp.length > 5 || sp.length > 5) {
  33.         //bring the art. (mp.length > 5)
  34.         if (zp.length > 5 && !game.global.preMapsActive && !game.global.mapsActive && !game.global.spireActive) {
  35.         document.getElementById("trimps").insertAdjacentHTML('afterend', '<div id="pic"><img src="' + zp + '"></div>');
  36.         } else if (pp.length > 5 && game.global.preMapsActive) {
  37.         document.getElementById("trimps").insertAdjacentHTML('afterend', '<div id="pic"><img src="' + pp  + '"></div>');
  38.         } else if (vp.length > 5 && game.global.mapsActive && getCurrentMapObject().location == "Void") {
  39.         document.getElementById("trimps").insertAdjacentHTML('afterend', '<div id="pic"><img src="' + vp + '"></div>');
  40.         } else if (mp.length > 5 && game.global.mapsActive && getCurrentMapObject().location != "Void") {
  41.         document.getElementById("trimps").insertAdjacentHTML('afterend', '<div id="pic"><img src="' + mp + '"></div>');
  42.         } else if (sp.length > 5 && game.global.world == 200 && game.global.spireActive) {
  43.         document.getElementById("trimps").insertAdjacentHTML('afterend', '<div id="pic"><img src="' + sp + '"></div>');
  44.         }
  45.         if ((sp.length > 5 || zp.length > 5) && game.resources.trimps.soldiers != 0 && !game.global.preMapsActive && !game.global.mapsActive && (new Date().getTime() - game.global.zoneStarted) > 1600 && game.global.gridArray.length != 0) {
  46.             var cells = document.getElementById("grid").getElementsByClassName("battleCell cellColorBeaten"); var oldstyle = cells[0].getAttribute('style'); for (var i=0; i < cells.length; i++) cells[i].setAttribute('style', oldstyle + '; background-color: rgba(0,0,0,0.3);');
  47.         }
  48.         if ((mp.length > 5 || vp.length > 5) && game.resources.trimps.soldiers != 0 && game.global.mapsActive && (new Date().getTime() - game.global.mapStarted) > 1600 && game.global.mapGridArray.length != 0) {
  49.             var cells = document.getElementById("mapGrid").getElementsByClassName("battleCell cellColorBeaten"); var oldstyle = cells[0].getAttribute('style'); for (var i=0; i < cells.length; i++) cells[i].setAttribute('style', oldstyle + '; background-color: rgba(0,0,0,0.3);');
  50.         }
  51.     }
  52.     //bring the light.
  53.     var BR0 = document.getElementById("BR").value*1;
  54.     var BG0 = document.getElementById("BG").value*1;
  55.     var BB0 = document.getElementById("BB").value*1;
  56.     var CR0 = document.getElementById("CR").value*1;
  57.     var CG0  = document.getElementById("CG").value*1;
  58.     var CB0 = document.getElementById("CB").value*1;    
  59.     if ((BR0 > 0 && BG0 > 0 && BB0 > 0) || (CR0 > 0 && CG0 > 0 && CB0 > 0)) {
  60.         var colB = "background: rgb("+BR0+"," +BG0+","+ BB0+");";
  61.         var colC = "background: rgb("+CR0+"," +CG0+","+ CB0+");";
  62.         //document.getElementById("innerWrapper").style = "background: rgb(BR, BG, BB);";
  63.         document.getElementById("innerWrapper").style =     colB;
  64.         document.getElementById("battleContainer").style =  colC;
  65.         document.getElementById("gridContainer").style =    colC;
  66.         document.getElementById("science").style =      colC;
  67.         document.getElementById("selectedMapContainer").style = colC;
  68.         document.getElementById("helium").style =       colC;
  69.         document.getElementById("achievementWrapper").style =   colC;
  70.         document.getElementById("buyContainer").style =     colC;
  71.         document.getElementById("logContainer").style =     colC;
  72.         document.getElementById("queueContainer").style =   colC;
  73.         document.getElementById("wood").style =         colC;
  74.         document.getElementById("fragments").style =        colC;
  75.         document.getElementById("heirloomWrapper").style =  colC;
  76.         document.getElementById("food").style =         colC;
  77.         document.getElementById("metal").style =        colC;
  78.         document.getElementById("gems").style =         colC;
  79.         document.getElementById("trimps").style =       colC;
  80.     }
  81. }
  82.  
  83. //setup options
  84. function createInputSetting(pic,div) {
  85.     var picInput = document.createElement("Input");
  86.     picInput.id = pic + "URL";
  87.     picInput.setAttribute('style', 'text-align: center; width: 60px; color: black;');
  88.     picInput.setAttribute('class', 'picInput');
  89.     var perk1label = document.createElement("Label");
  90.     picLable.id = pic + 'Label';
  91.     picLable.innerHTML = pic;
  92.     picLable.setAttribute('style', 'margin-right: 1vw; width: 120px; color: white;');
  93.     //add to the div.
  94.     div.appendChild(picInput);
  95.     div.appendChild(picLable);
  96. }
  97.  
  98. //Add new css rule
  99. //document.styleSheets[2].insertRule(".settingBtn3 {background-color: #337AB7;}", 84);
  100.  
  101. var getPercent = 0;
  102. var reactPercent = 0;
  103. function getStats() {
  104.     reactPercent = 0;
  105.     getPercent = (game.stats.heliumHour.value() / (game.global.totalHeliumEarned - (game.global.heliumLeftover + game.resources.helium.owned)))*100;
  106.     if (getPercent.toFixed(3) > 0.54) {
  107.         reactPercent = " An amazing result, share it with others, they will appriciate it.";
  108.     } else if (getPercent.toFixed(3) > 0.53) {
  109.         reactPercent = " GRATZ, A NEW WORLD RECORD!";
  110.     } else if (getPercent.toFixed(3) > 0.52) {
  111.         reactPercent = " Only a few ever got this far.";
  112.     } else if (getPercent.toFixed(3) > 0.50) {
  113.         reactPercent = " it's not shameful to give up.";
  114.     } else if (getPercent.toFixed(3) > 0.40) {
  115.         reactPercent = " It's the final push.";
  116.     } else if (getPercent.toFixed(3) > 0.30) {
  117.         reactPercent = " Keep it comming...";
  118.     } else if (getPercent.toFixed(3) <= 0.30) {
  119.         reactPercent = " Did you just portal?";
  120.     }
  121.     return getPercent.toFixed(3) + '%'; //return
  122. }
  123.  
  124. var getGigaDelta = false;
  125. var reactGigaDelta = false;
  126. function getStats2() {
  127.     reactGigaDelta = true;
  128.     getGigaDelta = (getPageSetting('FirstGigastation') > 40 || getPageSetting('DeltaGigastation') > 2);
  129.     if (getGigaDelta == true) {
  130.         reactGigaDelta = "First Gigastation must be under 41 and Min Warpstation must be under two, if you don't know how it works, why don't you click on the chat and ask?";
  131.     } else if (getGigaDelta == false) {
  132.         reactGigaDelta = "You know the Truth.";
  133.     }
  134.     return getGigaDelta;
  135. }
  136.  
  137. var getAutoPortal = false;
  138. var reactAutoPortal = false;
  139. function getStats3() {
  140.     reactAutoPortal = true;
  141.     getAutoPortal = (getPageSetting('HeliumHrBuffer') > 0 || autoTrimpSettings.AutoPortal.selected != "Helium Per Hour");
  142.     if (getAutoPortal == true) {
  143.         reactAutoPortal = "The Helium/Hr Buffer must be set to 0 and Auto Portal is there in order to help you get better Helium per hour, if you don't know how it works, why don't you click on the chat and ask?";
  144.     } else if (getAutoPortal == false) {
  145.         reactAutoPortal = "You know the Truth.";
  146.     }
  147.     return getAutoPortal;
  148. }
  149.  
  150. //setup convo array
  151. var conversation = [];
  152. conversation[0] = {Q:"Hello.",R1:"Tell me the Truth.",L1:1,R2:"How am i doing so far?",L2:5,R3:"Tell me what to do.",L3:3};
  153. conversation[1] = {Q:"" +reactGigaDelta,R1:"Be more honest please.",L1:6,R2:"What can go wrong in the Don't Touch Zone?",L2:4,R3:"I know the Truth.",L3:0};
  154. conversation[2] = {Q:"OK.",R1:"Again.",L1:0,R2:"How am i doing so far?",L2:5,R3:"What can go wrong in the Don't Touch Zone?",L3:4};
  155. conversation[3] = {Q:"Please set Auto Portal to Helium Per Hour and set First Gigastation to 40 (or less). Make sure that Min Warpstation is set to two (or less). And notice that some of the Void Maps will be done before your Void Maps settings, so please use it and set the Void Maps to no more then 10 Zones before you predict that you will Auto Portal. Have a nice AutoAutoTrimps experience.",R1:"Wow, HelpfulTrimp!",L1:0};
  156. conversation[4] = {Q:"You.",R1:"Meh.",L1:0};
  157. conversation[5] = {Q:"Your current Helium per hour gain is " + getStats() + "" +reactPercent,R1:"Cool.",L1:0,R2:"What can go wrong in the Don't Touch Zone?",L2:4,R3:"I know the Truth.",L3:0};
  158. conversation[6] = {Q:"" +reactAutoPortal,R1:"Please be much more honest.",L1:7,R2:"What can go wrong in the Don't Touch Zone?",L2:4,R3:"I know the Truth.",L3:0};
  159. conversation[7] = {Q:"I am not a real Trimp.",R1:"I knew the Truth.",L1:0};
  160. updateConvo(0);
  161.  
  162. /*
  163. conversation[0] = {Q:"Hello.",R1:"What?!?!",L1:3,R2:"Oh.",L2:1};
  164. conversation[1] = {Q:"What do you want to change? Click the buttons below.",R1:"Nothing.",L1:2,R2:"That's it.",L2:2};
  165. conversation[2] = {Q:"Ok.",R1:"Hello?",L1:0};
  166. conversation[3] = {Q:"I figured you'd find me eventually. Before you ask...yes, I can talk. No, none of the other trimps seem to be able to.",R1:"What else do you know?",L1:4};
  167. conversation[4] = {Q:"Not much more than you, unfortunately. Whatever brought you here is also what made me...smarter than the average trimp. Before you got here, I wasn't anymore self-aware than any other trimp.",R1:"What are we doing here?",L1:5};
  168. conversation[5] = {Q:"I don't know--I don't even know where <b>here</b> is. This is all new to me too.",R1:"Well, what do you suggest we do?",L1:6};
  169. conversation[6] = {Q:"Keep going. Maybe we'll find some answers. Since we're friends now, I've picked up a few tricks that will help us.",R1:"Like what?",L1:7};
  170. conversation[7] = {Q:"I can tell the trimps to build storage buildings before they get full. I can also buy Gyms and Tributes as soon as we can afford them, and read some upgrade books to you and the trimps when you're not available.",R1:"Which upgrade books?",L1:8, R2:"What else?", L2:9};
  171. conversation[8] = {Q:"The upgrades I can read are: Speedfarming, Speedlumber, Speedminer, Speedscience, (all the Mega versions too), Efficiency, TrainTacular, Gymystic, Potency, Egg, UberHut, UberHouse, UberMansion, UberHotel, UberResort, and Bounty",R1:"Ok, cool",L1:9};
  172. conversation[9] = {Q:"I can also highlight the housing that makes the most use of our gems, and the equipment that makes the best use of our metal.",R1:"Cool, what else?",L1:10};
  173. conversation[10] = {Q:"I'll bring us back to the world if we idle on the premap screen too long and I'll send you back to science-ing if you stay building on an empty queue. I can also <b>unteach</b> Shieldblock.",R1:"Why unteach Shieldblock?",L1:11, R2:"Anything else?",L2:12};
  174. conversation[11] = {Q:"As we learn more and more Gymystic, our shields becomes less and less useful for blocking. The extra health comes in real handy post z60.",R1:"I get it.",L1:12};
  175. conversation[12] = {Q:"I can help you respec the portal perks if you've already done it this round, and I can automatically flip between Dominance and Heap formations depending on the enemy we're facing.",R1:"Ok.",L1:13};
  176. conversation[13] = {Q:"That's it for now, but I'll let you know if I pick up any more tricks. Use the buttons below to let me know what you'd like done.",R1:"Ok.",L1:2};
  177. updateConvo(0);
  178. */
  179.  
  180.  
  181. //only functions below here
  182. function updateConvo (place) {
  183.   conversation[1] = {Q:"" +reactGigaDelta,R1:"Be more honest please.",L1:6,R2:"What can go wrong in the Don't Touch Zone?",L2:4,R3:"I know the Truth.",L3:0};
  184.   conversation[5] = {Q:"Your current Helium per hour gain is " + getStats() + "" +reactPercent,R1:"Cool.",L1:0,R2:"What can go wrong in the Don't Touch Zone?",L2:4,R3:"I know the Truth.",L3:0};
  185.   conversation[6] = {Q:"" +reactAutoPortal,R1:"Please be much more honest.",L1:7,R2:"What can go wrong in the Don't Touch Zone?",L2:4,R3:"I know the Truth.",L3:0};
  186.   document.getElementById("q").innerHTML = conversation[place].Q;
  187.   document.getElementById("1").innerHTML = conversation[place].R1;
  188.   document.getElementById("1").onclick = (function() { var test = conversation[place].L1; return function() {updateConvo(test + '');}})();
  189.   if ("R2" in conversation[place]) {document.getElementById("2").innerHTML = conversation[place].R2;}
  190.   else {document.getElementById("2").innerHTML = "";}
  191.   if ("L2" in conversation[place]) {document.getElementById("2").onclick = (function() { var test = conversation[place].L2; return function() {updateConvo(test + '');}})();}
  192.   if ("R3" in conversation[place]) {document.getElementById("3").innerHTML = conversation[place].R3;}
  193.   else {document.getElementById("3").innerHTML = "";}
  194.   if ("L3" in conversation[place]) {document.getElementById("3").onclick = (function() { var test = conversation[place].L3; return function() {updateConvo(test + '');}})();}
  195. }
  196.  
  197. function talk() {
  198.   getStats();
  199.   getStats2();
  200.   getStats3();
  201.   document.getElementById("autotrimp").style.display = "block";
  202. }
  203.  
  204. function paint() {
  205.   getNiceThingsDone();
  206.   document.getElementById("paintTrimp").style.display = "block";
  207. }
Add Comment
Please, Sign In to add comment