Guest User

Untitled

a guest
Oct 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.73 KB | None | 0 0
  1. /* Space Engine Autoclicker by Itzamna
  2. `
  3. Right click and use inspect element on a resource gain button then paste
  4. script into the browser console.
  5.  
  6. This script will gain resources and upgrade the storage. Charcoal will
  7. only upgrade to a max storage of 25600 since there appears to be no
  8. need to go higher. There is commented out storage upgrade function
  9. that is meant to push for the Interstellar Communication Breakthrough.
  10. You can uncomment it in the main loop and comment out the normal
  11. storage upgrade function.
  12.  
  13. Once EMC is unlocked, energy will be converted to your desired resource
  14. and plasma will be converted to meteorite. At the beginning of the script
  15. there is a minimum plasma variable that you can set to your desired minimum
  16. level to maintain for wonders and such.
  17.  
  18. Once Dyson Segments are unlocked, rings and swarms will be built.
  19. Currently, the script is set to only build Dyson Segments when there
  20. are enough resources to build an entire ring or swarm. This may have to be
  21. tweaked to balance storage limits and energy production. Swarms are built
  22. after 3 rings as that has seemed to work the best for me so far. Spheres are
  23. not automated yet as I really am not sure when how to go about it or if it's
  24. even worth automating in the first place. There is a variable at the beginning
  25. of the script to change whether or not the script will build rings and swarms.
  26. If you set it to no it will only build segments and build them as soon as there
  27. are enough resources to do so. Use this to push for a sphere or if you just
  28. prefer to have more control over rings and swarms. It will build a sphere if
  29. if you reach 250 segments in this mode. There is another variable to turn off
  30. production of dyson segments as well.
  31.  
  32.  
  33.  
  34. */
  35.  
  36. var resourceToConvertEMC = 'titanium';
  37. var minimumPlasma = 500100;
  38. var buildRingsAndSwarms = 'no';
  39. var buildDysonSegments = 'yes';
  40.  
  41. // Create variables for storage upgrades. className will be used.
  42. var uraniumFull = document.getElementById('uranium');
  43. var lavaFull = document.getElementById('lava');
  44. var oilFull = document.getElementById('oil');
  45. var metalFull = document.getElementById('metal');
  46. var gemFull = document.getElementById('gem');
  47. var charcoalFull = document.getElementById('charcoal');
  48. var woodFull = document.getElementById('wood');
  49. var siliconFull = document.getElementById('silicon');
  50. var lunariteFull = document.getElementById('lunarite');
  51. var methaneFull = document.getElementById('methane');
  52. var titaniumFull = document.getElementById('titanium');
  53. var goldFull = document.getElementById('gold');
  54. var silverFull = document.getElementById('silver');
  55. var hydrogenFull = document.getElementById('hydrogen');
  56. var heliumFull = document.getElementById('helium');
  57. var iceFull = document.getElementById('ice');
  58. var meteoriteFull = document.getElementById('meteorite');
  59.  
  60. // Main loop
  61. var loop = setInterval(function() {
  62. upgradeStorage();
  63. //upgradeStorageMIM(); // Push for the Interstellar Communications Breakthrough
  64. increaseResources();
  65. convertEnergyAndPlasma();
  66. buildDysonStuff();
  67. }, 1)
  68.  
  69. // Increase resources
  70. function increaseResources() {
  71. if (document.getElementById('plasmaNav').className != 'sideTab hidden') {
  72. gainResource('plasma'); // Game defined function
  73. }
  74. if (document.getElementById('uraniumNav').className != 'sideTab hidden') {
  75. gainResource('uranium');
  76. }
  77. if (document.getElementById('lavaNav').className != 'sideTab hidden') {
  78. gainResource('lava');
  79. }
  80. if (document.getElementById('oilNav').className != 'sideTab hidden') {
  81. gainResource('oil');
  82. }
  83. gainResource('metal');
  84. gainResource('gem');
  85. gainResource('wood');
  86. if (document.getElementById('siliconNav').className != 'sideTab hidden') {
  87. gainResource('silicon');
  88. }
  89. if (document.getElementById('lunariteNav').className != 'sideTab hidden') {
  90. gainResource('lunarite');
  91. }
  92. if (document.getElementById('methaneNav').className != 'sideTab hidden') {
  93. gainResource('methane');
  94. }
  95. if (document.getElementById('titaniumNav').className != 'sideTab hidden') {
  96. gainResource('titanium');
  97. }
  98. if (document.getElementById('goldNav').className != 'sideTab hidden') {
  99. gainResource('gold');
  100. }
  101. if (document.getElementById('silverNav').className != 'sideTab hidden') {
  102. gainResource('silver');
  103. }
  104. if (document.getElementById('hydrogenNav').className != 'sideTab hidden') {
  105. gainResource('hydrogen');
  106. }
  107. if (document.getElementById('heliumNav').className != 'sideTab hidden') {
  108. gainResource('helium');
  109. }
  110. if (document.getElementById('iceNav').className != 'sideTab hidden') {
  111. gainResource('ice');
  112. }
  113. if (plasma > minimumPlasma && document.getElementById('meteoriteNav').className != 'sideTab hidden' ) {
  114. gainResource('meteorite'); // Game definied function for clicking gain button
  115. }
  116. }
  117.  
  118. /* Upgrade storage. Full storage is indicated by green text
  119. which is changed using class.
  120. */
  121. function upgradeStorage() {
  122. if (Game.tech.isPurchased('unlockStorage')) {
  123. if (uraniumFull.className == 'green') {
  124. upgradeUraniumStorage(); // Game defined function
  125. }
  126. if (lavaFull.className == 'green') {
  127. upgradeLavaStorage();
  128. }
  129. if (oilFull.className == 'green') {
  130. upgradeOilStorage();
  131. }
  132. if (metalFull.className == 'green') {
  133. upgradeMetalStorage();
  134. }
  135. if (gemFull.className == 'green') {
  136. upgradeGemStorage();
  137. }
  138. if (charcoalFull.className == 'green' && this.getStorage('charcoal') < 25600) {
  139. upgradeCharcoalStorage();
  140. }
  141. if (woodFull.className == 'green') {
  142. upgradeWoodStorage();
  143. }
  144. if (siliconFull.className == 'green') {
  145. upgradeSiliconStorage();
  146. }
  147. if (lunariteFull.className == 'green') {
  148. upgradeLunariteStorage();
  149. }
  150. if (methaneFull.className == 'green') {
  151. upgradeMethaneStorage();
  152. }
  153. if (titaniumFull.className == 'green') {
  154. upgradeTitaniumStorage();
  155. }
  156. if (goldFull.className == 'green') {
  157. upgradeGoldStorage();
  158. }
  159. if (silverFull.className == 'green') {
  160. upgradeSilverStorage();
  161. }
  162. if (hydrogenFull.className == 'green') {
  163. upgradeHydrogenStorage();
  164. }
  165. if (heliumFull.className == 'green') {
  166. upgradeHeliumStorage();
  167. }
  168. if (iceFull.className == 'green') {
  169. upgradeIceStorage();
  170. }
  171. if (meteoriteFull.className == 'green') {
  172. upgradeMeteoriteStorage();
  173. }
  174. }
  175. }
  176.  
  177. /* Upgrade storage for metal, ice and meteorite
  178. Used to reach the first commmunication upgrade
  179. Disable normal upgrade storage with comments
  180. */
  181. function upgradeStorageMIM() {
  182. //rebuildStargate();
  183. if (metalFull.className == 'green') {
  184. upgradeMetalStorage();
  185. }
  186. if (iceFull.className == 'green') {
  187. upgradeIceStorage();
  188. }
  189. if (meteoriteFull.className == 'green') {
  190. upgradeMeteoriteStorage();
  191. }
  192. }
  193.  
  194. function buildDysonStuff() {
  195. if (buildRingsAndSwarms == 'yes') {
  196. if (Game.tech.isPurchased('unlockDyson')) {
  197. if (ring < 3 && titanium > 25000000 && gold > 9000000 && silicon > 17000000 && meteorite > 83000 && ice > 9000000) {
  198. buildDysonTo(50); // Game defined function
  199. buildRing(); // Game defined function
  200. }
  201. if (Game.tech.isPurchased('unlockDysonSphere')) {
  202. if (ring >= 3 && titanium > 91838862 && gold > 30612923 && silicon > 61225895 && meteorite > 306080 && ice > 30612923) {
  203. buildDysonTo(100); // Game defined function
  204. buildSwarm(); // Game defined function
  205. }
  206. }
  207. }
  208. } else if (Game.tech.isPurchased('unlockDyson') && buildDysonSegments == 'yes') {
  209. getDyson();
  210. if (dyson == 250) {
  211. buildSphere();
  212. }
  213. }
  214. }
  215.  
  216. function convertEnergyAndPlasma() {
  217. var offsetEnergyFlux;
  218. if (getMaxEnergy() < 1000000) {
  219. offsetEnergyFlux = 1000;
  220. } else {
  221. offsetEnergyFlux = 100000;
  222. }
  223. if (Game.tech.isPurchased('unlockEmc')) {
  224. if ((getMaxEnergy() - offsetEnergyFlux) < energy) {
  225. convertEnergy(resourceToConvertEMC); // Game defined function
  226. }
  227. if ((getMaxPlasma() - 1000) < plasma) {
  228. convertPlasma('meteorite'); // Game defined function
  229. }
  230. }
  231. }
Add Comment
Please, Sign In to add comment