Advertisement
Kirdneh

WD script compiled by Kirdneh

Aug 13th, 2014
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Extraroots
  3. */
  4.  
  5. nums = [' thousand',' million',' billion',' trillion',' quadrillion',' quintillion',' sextillion',' septillion',' octillion',' nonillion',' decillion',' kilo (11)',' mega (12)',' giga (13)',' tera (14)',' peta (15)',' exa (16)',' zetta (17)',' yotta (18)',' xona (19)',' weka (20)',' vunda (21)',' uda (22)',' treda (23)',' sorta (24)',' rinta (25)',' quexa (26)',' nena (27)',' minga (28)',' luma (29)',' vitta (30)',' uktta (31)',' sekka (32)',' rikka (33)',' qukka (34)',' opkka (35)',' nakka (36)',' hilla (37)',' alpha (38)',' beta (39)',' gamma (40)',' delta (41)',' epsilon (42)',' zeta (43)',' eta (44)',' theta (45)',' iota (46)',' kappa (47)',' iambda (48)',' mu (49)',' nu (50)',' xi (51)',' omicron (52)',' pi (53)',' rho (54)',' sigma (55)',' tau (56)',' upsilon (57)',' phi (58)',' chi (59)',' psi (60)',' omega (61)',' hyper (62)',' mega (63)',' super (64)',' ultra (65)',' extra (66)',' hydros (67)',' helios (68)',' lithos (69)',' beryl (70)',' burah (71)',' carbo (72)',' nitron (73)',' oxy (74)',' fluor (75)',' neos (76)',' soda (77)',' magnesia (78)',' alum (79)',' silex (80)',' phos (81)',' sufra (82)',' chloros (83)',' argon (84)',' potash (85)',' calx (86)',' scandia (87)',' titan (88)',' vanadis (89)',' chroma (90)',' magneo (91)',' yron (92)',' koppa (93)',' kyprio (94)',' zink (95)',' gallia (96)',' germania (97)',' arsenikon (98)',' selene (99)',' bromos (100)',' kryptos (101)',' rubidus (102)',' strontian (103)',' ytterby (104)',' zargono (105)',' molybdos (106)',' technetos (107)',' ruthenia (108)',' rhodon (109)',' pallas (110)',' siolfor (111)',' kadmeia (112)',' indigo (113)',' tin (114)',' anti monos (115)',' tellus (116)',' iodes (117)',' xenos (118)',' caesius (119)',' barys (120)',' ianthanein (120)',' ceres (121)',' prasios (122)',' neos (123)',' prometheus (124)',' samarsky (125)',' europe (126)',' gadolin (127)',' terb (128)',' thule (129)',' ytterbia (130)',' lutetia (131)',' hafnia (132)',' tantalus (133)',' tung (134)',' rhenus (135)',' osme (136)',' iris (137)',' platina (138)',' aurum (139)',' mercurius (140)',' thallos (141)',' plumbum (142)',' bisemutum (143)',' polonia (144)',' astatos (145)',' nitrens (146)',' france (147)',' radius (148)',' aktis (149)',' thor (150)',' proto (160)',' ouranos (161)',' neptunus (162)',' plouton (163)',' amerigo (164)',' curie (165)',' berkeley (166)',' californ (167)',' einst (168)',' fermi (169)',' dmitri (170)',' nobel (171)',' lawrence (172)',' rutherford (173)',' dubnia (174)',' teodor (175)',' bohr (176)',' hassia (177)',' meitner (178)',' darmstadt (180)',' rontgen (181)',' copernia (182)',' ununtri (183)',' flerov (184)',' ununpenti (185)',' livermore (186)',' ununsepti (187)',' ununocti (188)',' aer (189)',' aqua (190)',' ignis (191)',' terra (192)',' aether (193)',' ordo (194)',' perditio (195)',' bio (196)',' necro (196)',' infini (197)',' aeternus (198)',' omnus (199)',' nihil (200)',' phantos (201)',' realis (202)',' ordinarius (201)',' aes (202)',' argentum (203)',' aurum (205)',' rubinus (206)',' sapphirus (207)',' magicae (208)',' infernum (209)',' querquedulae (210)',' mysterium (211)',' ater magicae (212)',' infernum II(213)',' anti materiae (214)',' ater magicae II (215)',' infernum III (216)',' iridis (217)',' deus (218)',' nigrum (219)',' diabolus (220)',' finalitatis (221)',' tellurium (222)',' manibus (223)',' ferrum (224)',' ipsum (225)',' gladiatores (226)',' surculus (227)',' diruto dolor (228)',' frangit apparatus (229)',' ferit aethera (230)','  (231)',' quibus pythonicus (232)',' pandens huc illuc (233)',' daemon (234)',' nullam auctor vulpate nunc veritatem (235)',' nigrum oblitero (236)',' tegularius (237)',' ferrum scientiam (238)',' concursus scientiam (239)',' procul cognitione (240)',' gravi scientia (241)',' scientia magicae (242)',' lateres scientiam (243)',' murum (244)',' secuda murus (245)',' tertius murus (246)',' quartus muro (247)',' ultima murum (248)',' murum accedit (249)',' insuper et dux murum (250)',' spatium murus (251)',' ducem spatium murus (252)',' tempore murum (253)',' tunc princeps murum (254)',' Finem murum (255)',' Ducem Finem murum (256)',' Finalitatis murum Delta (257)',' Finalitatis murum Gamma (258)',' Finalitatis murum Beta (259)',' Finalitatis murum Alpha (260)',' Ducem Finem murum (261)',' Finalitate (262)',' Tellurium (263)',' DarthCookie (264)', ' kirdneh (265];//ExtraRootsByKirdneh
  6. /*
  7. numerical roots (thousand to dectillion)
  8. SI prefexes (kilo to luma)
  9. extra SI prefexes (vitta to hilla)
  10. greek (alpha to omega)
  11. Bit.Trip upgrades (hyper to extra)
  12. Periodic elements (hydros to ununocti)
  13. Fundamental elements (aer to perditio (air, water, fire, earth, aether))
  14. Universe elements (ordo to realis (order, entropy, life, death, infinity, eternity, everything, nothing, fantasy, reality))
  15. Upgrade Essences (ordinarius to tellurim)
  16. Building Essences (manibus to tegularius)
  17. Bonus Point Essences (ferrum scientiam to lateres scientiam)
  18. Wall Essences (murum to Ducem Finem murum)
  19. Finality (Finalitate)
  20. */
  21.  
  22. function Beautify(num,floats)
  23. {
  24. if (!isFinite(num)) return 'Infinity';
  25. if(num < 1e3 || num >= parseFloat('1e' + 3*(nums.length + 1))) return Math.round(num);
  26. var i = 0;
  27. while(num >= 1000)
  28. {
  29. num/=1000;
  30. i++;
  31. }
  32. num = Math.round(num*1000)/1000;
  33. if(num>=1000)
  34. {
  35. num/=1000;
  36. i++;
  37. num = Math.round(num*1000)/1000;
  38. } //deals with rounding errors
  39. num = num.toString();
  40. if(num.indexOf('.') == -1) num += '.000';
  41. else //by MasterSparky
  42. {
  43. dec = num.indexOf('.');
  44. while(num.slice(dec,num.length).length < 4) num += '0'; //adds trailing 0s (if needed) to stop the numbers jumping around.
  45. }
  46. return num + nums[i - 1];
  47. }
  48.  
  49. //--------------------------------------------------------------------------------------------------------------------------
  50.  
  51. /*
  52. Adds import/export buttons and a text box to the save box in IGM games.
  53. Clicking the export button will display the save code in the text box.
  54. Save the code to a text file or upload and then if you need to use the backup load this mod first then use the import button.
  55. The functions created by the mod are modified versions of the save/load functions used by IGM.
  56. */
  57.  
  58. eval('Export=' + Game.Save.toString().replace('localStorage[Game.src]=str;','l(\'savecode\').value=str'));
  59. eval('Import=' + Game.Load.toString().replace('function ()','function (str)').replace('var str=localStorage[Game.src];',''));
  60. if(!modloaded){
  61. l('saveBox').innerHTML +="<div class='button' onclick='Export();'>Export save</div><div class='button' onclick='Imports();'>Import save</div><textarea id='savecode' style = 'resize: none'></textarea>";
  62. var modloaded = true;
  63. }
  64. Imports=function(){
  65. var savecode = prompt("Enter Save Code:","");
  66. if(savecode && savecode.length > 20){
  67. Import(savecode);
  68. }}
  69.  
  70. //--------------------------------------------------------------------------------------------------------------------------
  71.  
  72. /*
  73. Show/Hide Bought upgrades
  74. */
  75. l('saveBox').innerHTML+= "<div class='button' id='hideupg' onclick='hideupgrades();'>Hide bought upgrades</div>"
  76.  
  77. function hideupgrades()
  78. {
  79. switch(l('hideupg').innerHTML) {
  80.     case 'Hide bought upgrades':
  81. upgsty('none')
  82.         l('hideupg').innerHTML = 'Show bought upgrades'
  83.        break;
  84.     case 'Show bought upgrades':
  85. upgsty('')
  86.          l('hideupg').innerHTML = 'Hide bought upgrades'
  87.         break;
  88.     default:
  89. upgsty('none')
  90. l('hideupg').innerHTML = 'Show bought upgrades'
  91. }}
  92. function upgsty(arg)
  93. {
  94. for(i in document.getElementsByClassName('bought')){
  95. if(document.getElementsByClassName('bought')[i].style)
  96. {
  97.       document.getElementsByClassName('bought')[i].style.display = arg
  98. }
  99. }
  100. }
  101.  
  102. //--------------------------------------------------------------------------------------------------------------------------
  103.  
  104. /*
  105. Multibuy
  106. */
  107.  
  108. (function()
  109. {
  110. if(l('saveBox').innerHTML.indexOf('<select name="multibuy">') == -1)
  111. {
  112. var multbuyopt = '<select name="multibuy">';
  113.  
  114. for(i in Object.keys(Game.buildings))
  115. {
  116. if(Game.buildings[Object.keys(Game.buildings)[i]].visible)
  117. {
  118. multbuyopt+= "<option value=" + Object.keys(Game.buildings)[i] + '>' + Game.buildings[Object.keys(Game.buildings)[i]].name + '</option>';
  119. }
  120. }
  121. multbuyopt+= '</select>';
  122. return l('saveBox').innerHTML += multbuyopt + "<div class='button' onclick='buylots(10);'>Buy 10</div>" + "<div class='button' onclick='buylots(100);'>Buy 100</div>" + "<div class='button' onclick='buylots(1000);'>Buy 1000</div>" + "<div class='button' onclick='sellall();'>Sell all</div>";
  123. }
  124. }())
  125.  
  126. sellall = function()
  127. {
  128. var build = document.getElementsByName('multibuy')[0].selectedOptions[0].value;
  129. {
  130. if(confirm('Are you sure you want to sell all ' + Game.buildings[build].plural + '?'))
  131. {
  132. while(Game.buildings[build].amount > 0 && Game.buildings[build].visible)
  133. {
  134. Game.buildings[build].Sell();
  135. }
  136. }
  137. }
  138. }
  139.  
  140. buylots = function(amount)
  141. {
  142. var build = document.getElementsByName('multibuy')[0].selectedOptions[0].value;
  143. for(i=0;i<amount;i++)
  144. {
  145. if(Game.buildings[build].visible && Game.buildings[build].CanBuy())
  146. {
  147. Game.buildings[build].Buy();
  148. }
  149. }
  150. }
  151.  
  152. with(l('saveBox')){
  153. if(innerHTML.indexOf("confirm('Are you sure you want to reset?')") == -1) innerHTML = innerHTML.replace("Game.Reset()","if(confirm('Are you sure you want to reset?')){Game.Reset()}")}
  154.  
  155. document.getElementsByName('multibuy')[0].onfocus=function(){
  156. multbuyopt = '';
  157. for(i in Game.buildings)
  158. {
  159. if(Game.buildings[i].visible)
  160. {
  161. multbuyopt+= "<option value=" + Game.buildings[i].key + '>' + Game.buildings[i].name + '</option>';
  162. }}
  163. document.getElementsByName('multibuy')[0].innerHTML = multbuyopt;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement