Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Space Engine Autoclicker by Itzamna
- `
- Right click and use inspect element on a resource gain button then paste
- script into the browser console.
- This script will gain resources and upgrade the storage. Charcoal will
- only upgrade to a max storage of 25600 since there appears to be no
- need to go higher. There is commented out storage upgrade function
- that is meant to push for the Interstellar Communication Breakthrough.
- You can uncomment it in the main loop and comment out the normal
- storage upgrade function.
- Once EMC is unlocked, energy will be converted to your desired resource
- and plasma will be converted to meteorite. At the beginning of the script
- there is a minimum plasma variable that you can set to your desired minimum
- level to maintain for wonders and such.
- Once Dyson Segments are unlocked, rings and swarms will be built.
- Currently, the script is set to only build Dyson Segments when there
- are enough resources to build an entire ring or swarm. This may have to be
- tweaked to balance storage limits and energy production. Swarms are built
- after 3 rings as that has seemed to work the best for me so far. Spheres are
- not automated yet as I really am not sure when how to go about it or if it's
- even worth automating in the first place. There is a variable at the beginning
- of the script to change whether or not the script will build rings and swarms.
- If you set it to no it will only build segments and build them as soon as there
- are enough resources to do so. Use this to push for a sphere or if you just
- prefer to have more control over rings and swarms. It will build a sphere if
- if you reach 250 segments in this mode. There is another variable to turn off
- production of dyson segments as well.
- */
- var resourceToConvertEMC = 'titanium';
- var minimumPlasma = 500100;
- var buildRingsAndSwarms = 'no';
- var buildDysonSegments = 'yes';
- // Create variables for storage upgrades. className will be used.
- var uraniumFull = document.getElementById('uranium');
- var lavaFull = document.getElementById('lava');
- var oilFull = document.getElementById('oil');
- var metalFull = document.getElementById('metal');
- var gemFull = document.getElementById('gem');
- var charcoalFull = document.getElementById('charcoal');
- var woodFull = document.getElementById('wood');
- var siliconFull = document.getElementById('silicon');
- var lunariteFull = document.getElementById('lunarite');
- var methaneFull = document.getElementById('methane');
- var titaniumFull = document.getElementById('titanium');
- var goldFull = document.getElementById('gold');
- var silverFull = document.getElementById('silver');
- var hydrogenFull = document.getElementById('hydrogen');
- var heliumFull = document.getElementById('helium');
- var iceFull = document.getElementById('ice');
- var meteoriteFull = document.getElementById('meteorite');
- // Main loop
- var loop = setInterval(function() {
- upgradeStorage();
- //upgradeStorageMIM(); // Push for the Interstellar Communications Breakthrough
- increaseResources();
- convertEnergyAndPlasma();
- buildDysonStuff();
- }, 1)
- // Increase resources
- function increaseResources() {
- if (document.getElementById('plasmaNav').className != 'sideTab hidden') {
- gainResource('plasma'); // Game defined function
- }
- if (document.getElementById('uraniumNav').className != 'sideTab hidden') {
- gainResource('uranium');
- }
- if (document.getElementById('lavaNav').className != 'sideTab hidden') {
- gainResource('lava');
- }
- if (document.getElementById('oilNav').className != 'sideTab hidden') {
- gainResource('oil');
- }
- gainResource('metal');
- gainResource('gem');
- gainResource('wood');
- if (document.getElementById('siliconNav').className != 'sideTab hidden') {
- gainResource('silicon');
- }
- if (document.getElementById('lunariteNav').className != 'sideTab hidden') {
- gainResource('lunarite');
- }
- if (document.getElementById('methaneNav').className != 'sideTab hidden') {
- gainResource('methane');
- }
- if (document.getElementById('titaniumNav').className != 'sideTab hidden') {
- gainResource('titanium');
- }
- if (document.getElementById('goldNav').className != 'sideTab hidden') {
- gainResource('gold');
- }
- if (document.getElementById('silverNav').className != 'sideTab hidden') {
- gainResource('silver');
- }
- if (document.getElementById('hydrogenNav').className != 'sideTab hidden') {
- gainResource('hydrogen');
- }
- if (document.getElementById('heliumNav').className != 'sideTab hidden') {
- gainResource('helium');
- }
- if (document.getElementById('iceNav').className != 'sideTab hidden') {
- gainResource('ice');
- }
- if (plasma > minimumPlasma && document.getElementById('meteoriteNav').className != 'sideTab hidden' ) {
- gainResource('meteorite'); // Game definied function for clicking gain button
- }
- }
- /* Upgrade storage. Full storage is indicated by green text
- which is changed using class.
- */
- function upgradeStorage() {
- if (Game.tech.isPurchased('unlockStorage')) {
- if (uraniumFull.className == 'green') {
- upgradeUraniumStorage(); // Game defined function
- }
- if (lavaFull.className == 'green') {
- upgradeLavaStorage();
- }
- if (oilFull.className == 'green') {
- upgradeOilStorage();
- }
- if (metalFull.className == 'green') {
- upgradeMetalStorage();
- }
- if (gemFull.className == 'green') {
- upgradeGemStorage();
- }
- if (charcoalFull.className == 'green' && this.getStorage('charcoal') < 25600) {
- upgradeCharcoalStorage();
- }
- if (woodFull.className == 'green') {
- upgradeWoodStorage();
- }
- if (siliconFull.className == 'green') {
- upgradeSiliconStorage();
- }
- if (lunariteFull.className == 'green') {
- upgradeLunariteStorage();
- }
- if (methaneFull.className == 'green') {
- upgradeMethaneStorage();
- }
- if (titaniumFull.className == 'green') {
- upgradeTitaniumStorage();
- }
- if (goldFull.className == 'green') {
- upgradeGoldStorage();
- }
- if (silverFull.className == 'green') {
- upgradeSilverStorage();
- }
- if (hydrogenFull.className == 'green') {
- upgradeHydrogenStorage();
- }
- if (heliumFull.className == 'green') {
- upgradeHeliumStorage();
- }
- if (iceFull.className == 'green') {
- upgradeIceStorage();
- }
- if (meteoriteFull.className == 'green') {
- upgradeMeteoriteStorage();
- }
- }
- }
- /* Upgrade storage for metal, ice and meteorite
- Used to reach the first commmunication upgrade
- Disable normal upgrade storage with comments
- */
- function upgradeStorageMIM() {
- //rebuildStargate();
- if (metalFull.className == 'green') {
- upgradeMetalStorage();
- }
- if (iceFull.className == 'green') {
- upgradeIceStorage();
- }
- if (meteoriteFull.className == 'green') {
- upgradeMeteoriteStorage();
- }
- }
- function buildDysonStuff() {
- if (buildRingsAndSwarms == 'yes') {
- if (Game.tech.isPurchased('unlockDyson')) {
- if (ring < 3 && titanium > 25000000 && gold > 9000000 && silicon > 17000000 && meteorite > 83000 && ice > 9000000) {
- buildDysonTo(50); // Game defined function
- buildRing(); // Game defined function
- }
- if (Game.tech.isPurchased('unlockDysonSphere')) {
- if (ring >= 3 && titanium > 91838862 && gold > 30612923 && silicon > 61225895 && meteorite > 306080 && ice > 30612923) {
- buildDysonTo(100); // Game defined function
- buildSwarm(); // Game defined function
- }
- }
- }
- } else if (Game.tech.isPurchased('unlockDyson') && buildDysonSegments == 'yes') {
- getDyson();
- if (dyson == 250) {
- buildSphere();
- }
- }
- }
- function convertEnergyAndPlasma() {
- var offsetEnergyFlux;
- if (getMaxEnergy() < 1000000) {
- offsetEnergyFlux = 1000;
- } else {
- offsetEnergyFlux = 100000;
- }
- if (Game.tech.isPurchased('unlockEmc')) {
- if ((getMaxEnergy() - offsetEnergyFlux) < energy) {
- convertEnergy(resourceToConvertEMC); // Game defined function
- }
- if ((getMaxPlasma() - 1000) < plasma) {
- convertPlasma('meteorite'); // Game defined function
- }
- }
- }
Add Comment
Please, Sign In to add comment