Advertisement
zyzzyzus

IGM scripts

Jun 2nd, 2014
2,649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Output the number of each building owned to the console:
  2. keys(Game.buildings).reduce(function(p,c){
  3. if(Game.buildings[c].visible)
  4. {
  5. buildamount = (Game.buildings[c].name + ': ' + Game.buildings[c].amount + ', ')
  6. }
  7. else buildamount = ''
  8. return p + buildamount},'')
  9.  
  10. //output the income of each resource to the console:
  11. keys(Game.res).reduce(function(p,c){
  12. if(Game.res[c].visible && Game.res[c].computedPS > 0)
  13. {
  14. resincome = ('\n' + Game.res[c].name + ': ' + Beautify(Game.res[c].computedPS) + '/s');
  15. }
  16. else resincome = ''
  17. return p + resincome},'')
  18.  
  19. /*output to the console the remaining achievements not won and if applicable how many resources/buildings needed (doesn't show when it is unlocked on the purchase of something:*/
  20. achievementsleft = '\n'
  21. for(i in Game.achievements)
  22. {
  23. if(Game.achievements[i].won == 0)
  24. {
  25. achievementsleft += Game.achievements[i].name + ': \n'
  26. for(j in Game.achievements[i].unlocksAt)
  27. {
  28. achievementsleft += "\n " + Beautify(Game.achievements[i].unlocksAt[j].amount) + ' ' + Game.achievements[i].unlocksAt[j].X.name
  29. }
  30. achievementsleft += "\n \n"
  31. }
  32. }
  33. console.log(achievementsleft)
  34.  
  35. //Same but for upgrades:
  36. upgradesleft = '\n'
  37. for(i in Game.upgrades)
  38. {
  39. if(Game.upgrades[i].visible == 0)
  40. {
  41. upgradesleft += Game.upgrades[i].name + ': \n'
  42. for(j in Game.upgrades[i].unlocksAt)
  43. {
  44. upgradesleft += "\n " + Beautify(Game.upgrades[i].unlocksAt[j].amount) + ' ' + Game.upgrades[i].unlocksAt[j].X.name
  45. }
  46. upgradesleft += "\n \n"
  47. }
  48. }
  49. console.log(upgradesleft)
  50.  
  51.  
  52.  
  53.  
  54.  
  55. //fast autoclicker:
  56. Game.PopNumber = function(el, text) {} //else it goes crazy.
  57. var autoclicker = function(clicksatonce,clickinterval)
  58. {
  59.  autoclick = function()
  60.  {
  61.   for(j in  Object.keys(Game.clickables))
  62.   {
  63.    with(Game.clickables[Object.keys(Game.clickables)[j]])
  64.    if(visible)
  65.     {
  66.      for(i=0;i<clicksatonce;i++)
  67.      {
  68.       Click()
  69.   }}}}
  70. return setInterval(autoclick,clickinterval)
  71. }
  72. autoclicker(100,1) /*the first number is how many clicks at once, the second is how often to do them in milliseconds. If there are a lot of clickables set it lower.*/
  73.  
  74. //Adds k,B,T etc. to numbers:
  75. nums = ['k','M','B','T','Q','Qi', 'Sx', 'Sp', 'Oc', 'No', 'De'];
  76. function Beautify(num,floats)
  77. {
  78. if (!isFinite(num)) return 'Infinity';
  79. if(num < 1e3 || num >= parseFloat('1e' + 3*(nums.length + 1))) return Math.round(num);
  80. var i = 0;
  81. while(num >= 1000)
  82. {
  83. num/=1000;
  84. i++;
  85. }
  86. num = Math.round(num*1000)/1000;
  87. if(num>=1000)
  88. {
  89. num/=1000;
  90. i++;
  91. num = Math.round(num*1000)/1000;
  92. } //deals with rounding errors
  93. num = num.toString();
  94. if(num.indexOf('.') == -1) num += '.000';
  95. else
  96. {
  97. dec = num.indexOf('.');
  98. while(num.slice(dec,num.length).length < 4) num += '0'; //adds trailing 0s (if needed) to stop the numbers jumping around.
  99. }
  100. return num + nums[i - 1];
  101. }
  102.  
  103.  
  104. /*
  105. Bookmarklets:
  106.  
  107. Multibuy buttons:
  108. */
  109. javascript:(function(){with(document)(head.appendChild(createElement('script')).src='http://pastebin.com/raw.php?i=hCTuvzBf')._})();
  110.  
  111. /*
  112. Import/export saves:
  113. */
  114. javascript:(function(){with(document)(head.appendChild(createElement('script')).src='http://pastebin.com/raw.php?i=C1kJemmr')._})();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement