Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- (function(){var d=document,s=d.createElement('script');s.src='https://github.com/kitten-science/kitten-scientists/releases/download/v2.0.0-beta.7/kitten-scientists-2.0.0-beta.7.user.js';d.body.appendChild(s);})();
- javascript:(function(){var d=document,s=d.createElement('script');s.src='https://pastebin.com/raw/TSS37BiV?.js';d.body.appendChild(s);})();
- _ ____ _ _
- (_) | _ \ | | (_)
- _ __ _ _ __ | |_) | ___ | |_ _ ___
- | '_ \| | '_ \| _ < / _ \| __| | / __|
- | | | | | |_) | |_) | (_) | |_ _| \__ \
- |_| |_|_| .__/|____/ \___/ \__(_) |___/
- | | _/ |
- |_| |__/
- */
- /*
- var enstr = "\n";
- gamePage.bld.meta[0].meta.forEach(
- function(montruck)
- {
- enstr += montruck.name+"\t";
- if(montruck.label)
- {
- enstr += montruck.label+"\n";
- }
- else if(montruck.stage)
- {
- montruck.stages.forEach(
- function(monmachin)
- {
- enstr += monmachin.label+"\t";
- });
- enstr += "\n"
- }
- else
- {
- enstr += montruck.name+" ?\n";
- }
- });
- enstr
- Name Label Stage2
- field Catnip Field
- pasture Pasture Solar Farm
- aqueduct Aqueduct Hydro Plant
- hut Hut
- logHouse Log House
- mansion Mansion
- library Library Data Center
- academy Academy
- observatory Observatory
- biolab Bio Lab
- barn Barn
- warehouse Warehouse
- harbor Harbour
- mine Mine
- quarry Quarry
- smelter Smelter
- calciner Calciner
- steamworks Steamworks
- magneto Magneto
- lumberMill Lumber Mill
- oilWell Oil Well
- workshop Workshop
- factory Factory
- reactor Reactor
- accelerator Accelerator
- tradepost Tradepost
- mint Mint
- amphitheatre Amphitheatre Broadcast Tower
- chapel Chapel
- temple Temple
- unicornPasture Unic. Pasture
- ziggurat Ziggurat
- chronosphere Chronosphere
- aiCore AI Core
- zebraOutpost Zebra Outpost
- zebraWorkshop Zebra Workshop
- zebraForge Zebra Forge
- -------------------------------------------
- var enstr = "";
- gamePage.village.jobNames.forEach(
- function(montruck){
- enstr += montruck+"\n";
- }
- );
- enstr
- woodcutter
- farmer
- scholar
- hunter
- miner
- priest
- geologist
- engineer
- -------------------------------------------
- var enstr = "";
- for (let [key, value] of Object.entries(gamePage.science.metaCache)) {
- //console.log(`${key}: ${value.name}`);
- enstr += `${value.name}`+"\n";
- }
- enstr
- paradoxalKnowledge
- voidSpace
- tachyonTheory
- dimensionalPhysics
- chronophysics
- exogeophysics
- hydroponics
- terraformation
- antimatter
- superconductors
- advExogeology
- thorium
- exogeology
- orbitalEngineering
- oilProcessing
- sattelites
- particlePhysics
- nanotechnology
- blackchain
- quantumCryptography
- ai
- robotics
- rocketry
- nuclearFission
- ecology
- electronics
- combustion
- metalurgy
- mechanization
- genetics
- biochemistry
- industrialization
- biology
- drama
- metaphysics
- electricity
- chemistry
- acoustics
- architecture
- archeology
- physics
- navigation
- cryptotheology
- astronomy
- theology
- steel
- machinery
- philosophy
- writing
- engineering
- currency
- construction
- math
- civil
- metal
- animal
- archery
- mining
- agriculture
- calendar
- brewery
- -------------------------------------------
- var enstr = "";
- gamePage.workshop.meta[0].meta.forEach(
- function(montruck){
- enstr += montruck.name+"\n";
- }
- );
- enstr
- mineralHoes
- ironHoes
- mineralAxes
- ironAxes
- steelAxe
- reinforcedSaw
- steelSaw
- titaniumSaw
- alloySaw
- titaniumAxe
- alloyAxe
- unobtainiumAxe
- unobtainiumSaw
- stoneBarns
- reinforcedBarns
- reinforcedWarehouses
- titaniumBarns
- alloyBarns
- concreteBarns
- titaniumWarehouses
- alloyWarehouses
- concreteWarehouses
- storageBunkers
- energyRifts
- stasisChambers
- voidEnergy
- darkEnergy
- chronoforge
- tachyonAccelerators
- fluxCondensator
- lhc
- photovoltaic
- thinFilm
- qdot
- solarSatellites
- cargoShips
- barges
- reactorVessel
- ironwood
- concreteHuts
- unobtainiumHuts
- eludiumHuts
- silos
- refrigeration
- compositeBow
- crossbow
- railgun
- bolas
- huntingArmor
- steelArmor
- alloyArmor
- nanosuits
- caravanserai
- advancedRefinement
- goldOre
- geodesy
- register
- strenghtenBuild
- miningDrill
- unobtainiumDrill
- coalFurnace
- deepMining
- pyrolysis
- electrolyticSmelting
- oxidation
- steelPlants
- automatedPlants
- nuclearPlants
- rotaryKiln
- fluidizedReactors
- nuclearSmelters
- orbitalGeodesy
- printingPress
- offsetPress
- photolithography
- uplink
- starlink
- cryocomputing
- machineLearning
- factoryAutomation
- advancedAutomation
- pneumaticPress
- combustionEngine
- fuelInjectors
- factoryLogistics
- factoryOptimization
- factoryRobotics
- spaceEngineers
- aiEngineers
- chronoEngineers
- spaceManufacturing
- celestialMechanics
- astrolabe
- titaniumMirrors
- unobtainiumReflectors
- eludiumReflectors
- hydroPlantTurbines
- amBases
- aiBases
- amFission
- amReactors
- amReactorsMK2
- voidReactors
- relicStation
- amDrive
- pumpjack
- biofuel
- unicornSelection
- gmo
- cadSystems
- seti
- logistics
- augumentation
- internet
- neuralNetworks
- assistance
- enrichedUranium
- coldFusion
- thoriumReactors
- enrichedThorium
- hubbleTelescope
- satnav
- satelliteRadio
- astrophysicists
- mWReactor
- eludiumCracker
- thoriumEngine
- oilRefinery
- oilDistillation
- factoryProcessing
- voidAspiration
- distorsion
- turnSmoothly
- -------------------------------------------
- var enstr = "";
- gamePage.diplomacy.races.forEach(
- function(montruck){
- enstr += montruck.name+"\n";
- }
- );
- enstr
- lizards
- sharks
- griffins
- nagas
- zebras
- spiders
- dragons
- leviathans
- -------------------------------------------
- -------------------------------------------
- -------------------------------------------
- -------------------------------------------
- -------------------------------------------
- */
- /*
- _____ _ _ _
- / ____| | | | | |
- | | __| | ___ | |__ __ _| | __ ____ _ _ __ ___
- | | |_ | |/ _ \| '_ \ / _` | | \ \ / / _` | '__/ __|
- | |__| | | (_) | |_) | (_| | | \ V / (_| | | \__ \
- \_____|_|\___/|_.__/ \__,_|_| \_/ \__,_|_| |___/
- */
- //Frame count of spiner
- var myCount = 0;
- //Trigger mySpinner() evry x ticks
- var evryTicks = 5;
- //Store last trick that triggered mySpinner
- var lastTick = 0;
- // Array to store craft list, [i][0] = resToCraftName [i][1] = resTriggerName
- var craftList = [
- ["wood", "catnip"],
- ["beam", "wood"],
- ["slab", "minerals"],
- ["plate", "iron"],
- ["steel", "coal"],
- ["manuscript", "culture"],
- ["kerosene", "oil"],
- ["thorium", "uranium"],
- ["alloy", "titanium"],
- ["eludium", "unobtainium"]
- ];
- var myConfig = {
- speed :1,
- speedTmp :1,
- autoObserveBtn :false,
- autoHunt :false,
- autoHuntSec :10,
- autoPraise :false,
- autoPraiseSec :10,
- autoTradeZebras :false,
- autoTradeZebrasTitaniumPerCent :80,
- autoTradeZebrasSpend :20,
- autoTradeLeviathans :false,
- autoTradeLeviathansSec :10,
- autoTradeLeviathansSpend :40,
- autoTradeBcoin :false,
- autoTradeBcoinBuyMax :1000,
- autoTradeBcoinSellMin :1088,
- autoCombustTC :false,
- autoCombustTCHeat :10,
- autoCombustTCNb :1,
- autoResetPraise :false,
- autoResetPraiseUnit :999999,
- autoFurs :false,
- autoFursSec :10,
- autoCompedium :false,
- autoCompediumSec :10,
- autoCompediumSpend :2,
- autoBlueprint :false,
- autoBlueprintSec :10,
- autoBlueprintSpend :1,
- wood :false,
- woodSec :10,
- woodSpend :10,
- beam :false,
- beamSec :10,
- beamSpend :10,
- slab :false,
- slabSec :10,
- slabSpend :10,
- plate :false,
- plateSec :10,
- plateSpend :10,
- steel :false,
- steelSec :10,
- steelSpend :10,
- manuscript :false,
- manuscriptSec :10,
- manuscriptSpend :1,
- kerosene :false,
- keroseneSec :10,
- keroseneSpend :10,
- thorium :false,
- thoriumSec :10,
- thoriumSpend :10,
- alloy :false,
- alloySec :10,
- alloySpend :10,
- eludium :false,
- eludiumSec :10,
- eludiumSpend :10
- };
- if(!!localStorage.getItem("nipBotConfig"))
- {
- myConfig = JSON.parse(localStorage.getItem("nipBotConfig"));
- }
- /*
- _____ _ _
- |_ _| (_) | |
- | | _ __ _ ___ ___| |_
- | | | '_ \| |/ _ \/ __| __|
- _| |_| | | | | __/ (__| |_
- |_____|_| |_| |\___|\___|\__|
- _/ |
- |__/
- */
- game.server.refreshNiped = game.server.refresh;
- game.server.refreshNipedCount = 0;
- game.server.refresh = function (){
- game.server.refreshNipedCount++;
- if(game.server.refreshNipedCount > (myConfig.speed * 100))
- {
- game.server.refreshNiped();
- game.server.refreshNipedCount = 0;
- }
- }
- game.resetAutomaticNiped = game.resetAutomatic;
- game.resetAutomatic = function (){
- myTurnOffJobs();
- game.resetAutomaticNiped();
- }
- gamePage.time.gainTemporalFlux = function (timestamp){
- if (!this.game.science.get("calendar").researched){
- return;
- }
- var now = Date.now();
- var delta = now - ( timestamp || 0 );
- if (delta <= 0){
- return;
- }
- // Update temporalFluxMax from values loaded
- this.game.updateCaches();
- this.game.resPool.update();
- var temporalAccelerator = this.getCFU("temporalAccelerator");
- var energyRatio = 1 + (temporalAccelerator.val * temporalAccelerator.effects["timeRatio"]);
- var temporalFluxGained = Math.round(delta / ( 60 * 1000 ) * (this.game.ticksPerSecond * energyRatio)); // 5 every 60 seconds
- temporalFluxGained = Math.round(temporalFluxGained * myConfig.speed)
- var temporalFluxAdded = this.game.resPool.addResEvent("temporalFlux", temporalFluxGained);
- var bonusSeconds = Math.floor(temporalFluxAdded / this.game.ticksPerSecond);
- if (bonusSeconds > 0){
- this.game.msg("You have recharged " + bonusSeconds + " second"
- + (bonusSeconds > 1 ? "s" : "") + " of temporal flux");
- }
- }
- gamePage.timer.updateScheduledEvents = function()
- {
- nipBot();
- for (var i in this.scheduledHandlers)
- {
- this.scheduledHandlers[i]();
- }
- this.scheduledHandlers = [];
- };
- document.getElementById('motd').innerHTML += " <a href='#' class='myAnimStart' id='mySpinner' onclick='toggleMenu();'>?</a>";
- setTimeout(function (){
- g('mySpinner').className = "myAnimEnd";
- }, 1000);
- setTimeout(function (){
- g('mySpinner').className = "";
- }, 5000);
- mySpinner();
- injectCss();
- injectHtmlMenu();
- if(!gamePage.nipUpdateModel){gamePage.nipUpdateModel = gamePage.updateModel;}
- gamePage.updateModel = function()
- {
- for(var myi = 0; myi < myConfig.speed; myi++)
- {
- if(myi != 0)
- {
- game.calendar.tick();
- }
- game.nipUpdateModel();
- }
- }
- /*
- ______ _ _ _____
- | ____| | | | |_ _|
- | |__ _ _ _ __ ___ ___ | | | | | |
- | __| | | | '_ \ / __/ __| | | | | | |
- | | | |_| | | | | (__\__ \ | |__| |_| |_
- |_| \__,_|_| |_|\___|___/ \____/|_____|
- */
- function g(id)
- {
- return document.getElementById(id);
- }
- function gr(id)
- {
- return gamePage.resPool.get(id);
- }
- function myLast(arr)
- {
- return arr[arr.length -1];
- }
- function getRace(race)
- {
- for(var i=0;i<gamePage.diplomacyTab.racePanels.length;i++)
- {
- if(gamePage.diplomacyTab.racePanels[i].race.name == race)
- {
- return gamePage.diplomacyTab.racePanels[i].race;
- }
- }
- return false;
- }
- function getWorkshop(upgrade)
- {
- for(var i=0;i<gamePage.workshop.meta[0].meta.length;i++)
- {
- if(gamePage.workshop.meta[0].meta[i].name == upgrade)
- {
- return gamePage.workshop.meta[0].meta[i];
- }
- }
- return false;
- }
- function toggleMenu()
- {
- if(g('myMenuId').style.display == "none")
- {
- myConfig.speedTmp = myConfig.speed;
- myConfig.speed = 1;
- printHtmlMenu();
- g('myMenuId').style.display = "block";
- }
- else
- {
- myConfig.speed = myConfig.speedTmp;
- mySaveConfig();
- g('myMenuId').style.display = "none";
- }
- }
- function mySpinner()
- {
- var frames = ['⠋','⠛','⠙','⠹','⠸','⢸','⢰','⣰','⣠','⣤','⣄','⣆','⡆','⡇','⠇','⠏'];
- document.getElementById('mySpinner').innerHTML = ""+frames[myCount];
- myCount++;
- if(myCount >= frames.length)
- {
- myCount = 0;
- }
- }
- function printCss()
- {
- var cssCode = "";
- cssCode += `
- #mySpinner
- {
- text-decoration:none;
- transition: transform ease 4s, background-color ease 4s;
- transform-origin: left top;
- }
- .myAnimStart
- {
- position: fixed;
- transform: scale(30);
- background-color:rgba(30,30,30,0.6);
- }
- .myAnimEnd
- {
- position: fixed;
- transform: scale(1);
- background-color:rgba(200,200,200,0);
- }
- .close
- {
- transition : background-color ease 0.3s;
- }
- .close:hover
- {
- background-color:rgba(255,0,0,0.3);
- }
- .scheme_grassy #myMenuId
- {
- padding: 30px;
- background-color: #C6EBA1;
- }
- #myMenuIdTable
- {
- text-align:center;
- width:100%;
- }
- #myMenuIdTable > tbody > tr > td
- {
- padding:8px 0 8px 0;
- }
- `;
- return cssCode;
- }
- function printHtmlMenu()
- {
- var myStrHtml = ""
- myStrHtml = `
- <a href="#" class="close" onclick="toggleMenu();" style="position: absolute; top: 0px; right: 0px; padding:16px;">close</a>
- <table id="myMenuIdTable"><tbody>
- <tr>
- <td style="text-align:right;"><input id="autoObserveBtn" type="checkbox" `+((myConfig.autoObserveBtn) ? "checked" : "")+`>
- <label for="autoObserveBtn">Auto Observe </label></td><td style="text-align:left;"> the Sky </td><td> </td><td> </td><td> </td><td> </td>
- </tr>
- <tr style="display:`+((gr("manpower").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoHunt" type="checkbox" `+((myConfig.autoHunt) ? "checked" : "")+`>
- <label for="autoHunt">Auto send </td><td>hunters</td><td> if </td><td>` +gr('manpower').title+` </td><td> will be full in </label> </td><td><input type="number" id="autoHuntSec" value="`+(myConfig.autoHuntSec)+`" style="width:8ch" /> seconds</td>
- </tr>
- <tr style="display:`+((gr("faith").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoPraise" type="checkbox" `+((myConfig.autoPraise) ? "checked" : "")+`>
- <label for="autoPraise">Auto Praise </td><td> the sun</td><td> if </td><td>`+gr('faith').title+` </td><td> will be full in </label> </td><td><input type="number" id="autoPraiseSec" value="`+(myConfig.autoPraiseSec)+`" style="width:8ch" /> seconds</td>
- </tr>
- <tr style="display:`+((gamePage.workshop.getCraft("parchment").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoFurs" type="checkbox" `+((myConfig.autoFurs) ? "checked" : "")+`>
- <label for="autoFurs">Auto Craft </td><td>`+gr("parchment").title+` </td><td> if </td><td>`+gr('furs').title+` </td><td> is more than </label> </td><td><input type="number" id="autoFursSec" value="`+(myConfig.autoFursSec)+`" style="width:18ch" /> units </td>
- </tr>
- <tr style="display:`+((gamePage.workshop.getCraft("compedium").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoCompedium" type="checkbox" `+((myConfig.autoCompedium) ? "checked" : "")+`>
- <label for="autoCompedium">Auto Craft </td><td>`+gr("compedium").title+` </td><td> if </td><td> `+gr("science").title+` </td><td> will be full in </label> </td><td><input type="number" id="autoCompediumSec" value="`+(myConfig.autoCompediumSec)+`" style="width:8ch" /> sec, spend <input type="number" min="1" max="100" id="autoCompediumSpend" value="`+(myConfig.autoCompediumSpend)+`" style="width:8ch" />%</td>
- </tr>
- <tr style="display:`+((gamePage.workshop.getCraft("blueprint").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoBlueprint" type="checkbox" `+((myConfig.autoBlueprint) ? "checked" : "")+`>
- <label for="autoBlueprint">Auto Craft </td><td>`+gr("blueprint").title+` </td><td> if </td><td> `+gr("science").title+` </td><td> will be full in </label> </td><td><input type="number" id="autoBlueprintSec" value="`+(myConfig.autoBlueprintSec)+`" style="width:8ch" /> sec, spend <input type="number" min="1" max="100" id="autoBlueprintSpend" value="`+(myConfig.autoBlueprintSpend)+`" style="width:8ch" />%</td>
- </tr>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- <tr style="display:`+((getRace("zebras").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoTradeZebras" type="checkbox" `+((myConfig.autoTradeZebras) ? "checked" : "")+`>
- <label for="autoTradeZebras">Auto Trade </td><td>`+getRace("zebras").title+`</td><td> if </td><td>` +gr('titanium').title+` </td><td> is lower than </label> </td><td><input type="number" min="0" max="100" id="autoTradeZebrasTitaniumPerCent" value="`+(myConfig.autoTradeZebrasTitaniumPerCent)+`" style="width:8ch" />% try to send <input type="number" id="autoTradeZebrasSpend" value="`+(myConfig.autoTradeZebrasSpend)+`" style="width:8ch" /> trades</td>
- </tr>
- <tr style="display:`+((getRace("leviathans").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoTradeLeviathans" type="checkbox" `+((myConfig.autoTradeLeviathans) ? "checked" : "")+`>
- <label for="autoTradeLeviathans">Auto Trade </td><td>`+getRace("leviathans").title+`</td><td> if </td><td>` +gr('unobtainium').title+` </td><td> will be full in </label> </td><td><input type="number" id="autoTradeLeviathansSec" value="`+(myConfig.autoTradeLeviathansSec)+`" style="width:8ch" /> sec, spend <input type="number" min="1" max="100" id="autoTradeLeviathansSpend" value="`+(myConfig.autoTradeLeviathansSpend)+`" style="width:8ch" />%</td>
- </tr>
- <tr style="display:`+((gr("blackcoin").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoTradeBcoin" type="checkbox" `+((myConfig.autoTradeBcoin) ? "checked" : "")+`>
- <label for="autoTradeBcoin">Auto Trade </td><td>`+gr("blackcoin").title+`</td><td> Buy if </td><td>` +gr('blackcoin').title+` </td><td>price is lower than </label> </td><td><input type="number" id="autoTradeBcoinBuyMax" value="`+(myConfig.autoTradeBcoinBuyMax)+`" style="width:8ch" /> , Sell if pice is higher than <input type="number" id="autoTradeBcoinSellMin" value="`+(myConfig.autoTradeBcoinSellMin)+`" style="width:8ch" /> </td>
- </tr>
- <tr style="display:`+((gamePage.religion.meta[1].meta[8].val) ? "table-row" : "none")+`">
- <td><input id="autoResetPraise" type="checkbox" `+((myConfig.autoResetPraise) ? "checked" : "")+`>
- <label for="autoResetPraise">Auto Reset </td><td>`+gr("faith").title+` </td><td> if accumulated</td><td>`+gr('faith').title+` </td><td> is more than </label> </td><td><input type="number" id="autoResetPraiseUnit" value="`+(myConfig.autoResetPraiseUnit)+`" style="width:18ch" /> units </td>
- </tr>
- <tr style="display:`+((getWorkshop("chronoforge").unlocked && gr("timeCrystal").unlocked) ? "table-row" : "none")+`">
- <td><input id="autoCombustTC" type="checkbox" `+((myConfig.autoCombustTC) ? "checked" : "")+`>
- <label for="autoCombustTC">Auto Combust </td><td>`+gr("timeCrystal").title+`</td><td> if </td><td>heat</td><td> is lower than </label> </td><td><input type="number" id="autoCombustTCHeat" value="`+(myConfig.autoCombustTCHeat)+`" style="width:8ch" /> , Combust
- <select id="autoCombustTCNb">
- <option value="1" `+((myConfig.autoCombustTCNb == 1)? `selected` : `` )+`>1</option>
- <option value="5" `+((myConfig.autoCombustTCNb == 5)? `selected` : `` )+`>5</option>
- <option value="45" `+((myConfig.autoCombustTCNb == 45)? `selected` : `` )+`>45</option>
- <option value="500" `+((myConfig.autoCombustTCNb == 500)? `selected` : `` )+`>500</option>
- </select> TC</td>
- </tr>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- `;
- // <input type="number" id="autoCombustTCNb" value="`+(myConfig.autoCombustTCNb)+`" style="width:8ch" />
- //gamePage.time.heat
- myStrHtml += genCraftList();
- myStrHtml += `</body></table><br><br> !Déja Vus ! speed : <input id="mySpeed" type="number" min="1" max="640" value="`+(myConfig.speedTmp)+`" style="width:5ch"><br><br>
- <a href="#" class="close" onclick="toggleMenu();" style="position: relative; top: 0px; right: 0px; padding:16px;">close</a>
- <br><br>`;
- g("myMenuId").innerHTML = myStrHtml;
- }
- function genCraftList()
- {
- var myStr = "";
- var trDisplay = "";
- craftList.forEach(function(truck){
- //if(gamePage.workshop.getCraft(truck[0]).unlocked)
- //{
- console.log(truck[0]+" et "+truck[0]);
- if( (gamePage.workshop.getCraft(truck[0]).unlocked && gr(truck[0]).unlocked && gr(truck[1]).unlocked) )
- {
- trDisplay = "table-row";
- }
- else
- {
- trDisplay = "none";
- }
- console.log(trDisplay);
- myStr += `
- <tr style="display:`+trDisplay+`">
- <td><input id="auto`+truck[0]+`" type="checkbox" `+( (eval("myConfig."+truck[0]) ) ? "checked" : "")+`>
- <label for="auto`+truck[0]+`">Auto Craft </td><td>`+gr(truck[0]).title+` </td><td> if </td><td> `+gr(truck[1]).title+` </td><td> will be full in </label> </td><td><input type="number" id="auto`+truck[0]+`Sec" value="`+(eval('myConfig.'+truck[0]+'Sec'))+`" style="width:8ch" /> sec, spend <input type="number" min="1" max="100" id="auto`+truck[0]+`Spend" value="`+(eval('myConfig.'+truck[0]+'Spend'))+`" style="width:8ch" />%</td>
- </tr>
- `;
- //}
- })
- return myStr;
- }
- function injectCss()
- {
- var cssCode = printCss();
- var styleElement = document.createElement("style");
- styleElement.type = "text/css";
- if (styleElement.styleSheet)
- {
- styleElement.styleSheet.cssText = cssCode;
- }
- else
- {
- styleElement.appendChild(document.createTextNode(cssCode));
- }
- document.getElementsByTagName("head")[0].appendChild(styleElement);
- }
- function injectHtmlMenu()
- {
- var myDiv = document.createElement("div");
- //myDiv.innerHTML = myStrHtml;
- myDiv.setAttribute("class", "dialog help");
- myDiv.setAttribute("style", "height: 72vh !important;top:225px !important;display:none; overflow:auto;width:720px;margin-left:-30%;");
- myDiv.setAttribute("id", "myMenuId");
- document.body.appendChild(myDiv);
- }
- function myTurnOffJobs()
- {
- myConfig.autoHunt = false;
- myConfig.autoPraise = false;
- myConfig.autoTradeZebras = false;
- myConfig.autoTradeLeviathans = false;
- myConfig.autoTradeBcoin = false;
- myConfig.autoCombustTC = false;
- myConfig.autoResetPraise = false;
- myConfig.autoFurs = false;
- myConfig.autoCompedium = false;
- myConfig.autoBlueprint = false;
- myConfig.wood = false;
- myConfig.beam = false;
- myConfig.slab = false;
- myConfig.plate = false;
- myConfig.steel = false;
- myConfig.manuscript = false;
- myConfig.kerosene = false;
- myConfig.thorium = false;
- myConfig.alloy = false;
- myConfig.eludium = false;
- localStorage.setItem("nipBotConfig", JSON.stringify(myConfig));
- }
- function mySaveConfig()
- {
- myConfig.speed = g('mySpeed').value;
- //console.log(myConfig.speed);
- if(myConfig.speed < 1 || myConfig.speed > 640){myConfig.speed = 1}
- myConfig.autoObserveBtn = g('autoObserveBtn').checked;
- myConfig.autoHunt = g('autoHunt').checked;
- myConfig.autoHuntSec = g('autoHuntSec').value;
- myConfig.autoPraise = g('autoPraise').checked;
- myConfig.autoPraiseSec = g('autoPraiseSec').value;
- myConfig.autoTradeZebras = g('autoTradeZebras').checked;
- myConfig.autoTradeZebrasTitaniumPerCent = g('autoTradeZebrasTitaniumPerCent').value;
- myConfig.autoTradeZebrasSpend = g('autoTradeZebrasSpend').value;
- myConfig.autoTradeLeviathans = g('autoTradeLeviathans').checked;
- myConfig.autoTradeLeviathansSec = g('autoTradeLeviathansSec').value;
- myConfig.autoTradeLeviathansSpend = g('autoTradeLeviathansSpend').value;
- myConfig.autoTradeBcoin = g('autoTradeBcoin').checked;
- myConfig.autoTradeBcoinBuyMax = g('autoTradeBcoinBuyMax').value;
- myConfig.autoTradeBcoinSellMin = g('autoTradeBcoinSellMin').value;
- myConfig.autoCombustTC = g('autoCombustTC').checked;
- myConfig.autoCombustTCHeat = g('autoCombustTCHeat').value;
- myConfig.autoCombustTCNb = g('autoCombustTCNb').value;
- //myConfig.autoCombustTCNb = g('autoCombustTCNb').selected;
- myConfig.autoResetPraise = g('autoResetPraise').checked;
- myConfig.autoResetPraiseUnit = g('autoResetPraiseUnit').value;
- myConfig.autoFurs = g('autoFurs').checked;
- myConfig.autoFursSec = g('autoFursSec').value;
- myConfig.autoCompedium = g('autoCompedium').checked;
- myConfig.autoCompediumSec = g('autoCompediumSec').value;
- myConfig.autoCompediumSpend = g('autoCompediumSpend').value;
- myConfig.autoBlueprint = g('autoBlueprint').checked;
- myConfig.autoBlueprintSec = g('autoBlueprintSec').value;
- myConfig.autoBlueprintSpend = g('autoBlueprintSpend').value;
- myConfig.wood = g('autowood').checked;
- myConfig.woodSec = g('autowoodSec').value;
- myConfig.woodSpend = g('autowoodSpend').value;
- myConfig.beam = g('autobeam').checked;
- myConfig.beamSec = g('autobeamSec').value;
- myConfig.beamSpend = g('autobeamSpend').value;
- myConfig.slab = g('autoslab').checked;
- myConfig.slabSec = g('autoslabSec').value;
- myConfig.slabSpend = g('autoslabSpend').value;
- myConfig.plate = g('autoplate').checked;
- myConfig.plateSec = g('autoplateSec').value;
- myConfig.plateSpend = g('autoplateSpend').value;
- myConfig.steel = g('autosteel').checked;
- myConfig.steelSec = g('autosteelSec').value;
- myConfig.steelSpend = g('autosteelSpend').value;
- myConfig.manuscript = g('automanuscript').checked;
- myConfig.manuscriptSec = g('automanuscriptSec').value;
- myConfig.manuscriptSpend = g('automanuscriptSpend').value;
- myConfig.kerosene = g('autokerosene').checked;
- myConfig.keroseneSec = g('autokeroseneSec').value;
- myConfig.keroseneSpend = g('autokeroseneSpend').value;
- myConfig.thorium = g('autothorium').checked;
- myConfig.thoriumSec = g('autothoriumSec').value;
- myConfig.thoriumSpend = g('autothoriumSpend').value;
- myConfig.alloy = g('autoalloy').checked;
- myConfig.alloySec = g('autoalloySec').value;
- myConfig.alloySpend = g('autoalloySpend').value;
- myConfig.eludium = g('autoeludium').checked;
- myConfig.eludiumSec = g('autoeludiumSec').value;
- myConfig.eludiumSpend = g('autoeludiumSpend').value;
- localStorage.setItem("nipBotConfig", JSON.stringify(myConfig));
- }
- /*
- ______ ____ _
- | ____| | _ \ | |
- | |__ _ _ _ __ ___ | |_) | ___ | |_
- | __| | | | '_ \/ __| | _ < / _ \| __|
- | | | |_| | | | \__ \ | |_) | (_) | |_
- |_| \__,_|_| |_|___/ |____/ \___/ \__|
- */
- function nipBot()
- {
- if(gamePage.ticks >= lastTick + evryTicks)
- {
- //console.log(gamePage.ticks);
- mySpinner();
- myJobs();
- setTimeout(myJobsTrade1, 450);
- setTimeout(myJobsTrade2, 850);
- lastTick = gamePage.ticks;
- }
- }
- function myJobsTrade1()
- {
- if(myConfig.autoTradeZebras)
- {
- //console.log("BRUH_autoTradeZebras");
- if(myConfig.autoTradeZebrasTitaniumPerCent == 100)
- {
- gamePage.diplomacy.tradeMultiple(getRace("zebras"), myConfig.autoTradeZebrasSpend);
- //console.log("autoTradeZebrasTitaniumPerCent==100");
- }
- else if (gr("titanium").value < ((gr("titanium").maxValue / 100) * myConfig.autoTradeZebrasTitaniumPerCent) )
- {
- gamePage.diplomacy.tradeMultiple(getRace("zebras"), myConfig.autoTradeZebrasSpend);
- //console.log("autoTradeZebrasTitaniumPerCent!=100");
- }
- }
- }
- function myJobsTrade2()
- {
- if(myConfig.autoTradeLeviathans)
- {
- //console.log("BRUH_autoTradeLeviathans");
- //gamePage.diplomacy.tradeMultiple(getRace("leviathans"), 99)
- if(getRace("leviathans").duration > 10)
- {
- if ((gr("unobtainium").value + (gr("unobtainium").perTickCached * 5 * myConfig.autoTradeLeviathansSec)) > gr("unobtainium").maxValue)
- {
- nbToCraft = Math.floor( (gr("unobtainium").value * (myConfig.autoTradeLeviathansSpend / 100)) / 5000 );
- if(nbToCraft < 1){nbToCraft = 1;}
- gamePage.diplomacy.tradeMultiple(getRace("leviathans"), nbToCraft)
- //console.log("autoTradeLeviathans_nbToCraft="+nbToCraft);
- }
- }
- }
- }
- function myJobs()
- {
- var nbToCraft = 0;
- var objTemp;
- var objTempSec;
- var priceTmp;
- myConfig.speedTmp = myConfig.speed;
- myConfig.speed = 1;
- if(myConfig.autoObserveBtn)
- {
- if (g('observeBtn') != null)
- {
- g('observeBtn').click();
- }
- }
- if(myConfig.autoHunt)
- {
- if ((gr("manpower").value + (gr("manpower").perTickCached * 5 * myConfig.autoHuntSec)) > gr("manpower").maxValue)
- {
- gamePage.village.huntAll();
- }
- }
- if(myConfig.autoTradeBcoin)
- {
- if(getRace("leviathans").duration > 1)
- {
- if(gamePage.calendar.cryptoPrice < myConfig.autoTradeBcoinBuyMax)
- {
- if( (gamePage.resPool.resourceMap.relic.value / gamePage.calendar.cryptoPrice) >= (gamePage.resPool.resourceMap.blackcoin.value / 1000) )
- //if(gamePage.resPool.resourceMap.relic.value >= (gamePage.calendar.cryptoPrice * 100) )
- {
- game.diplomacy.buyBcoin();
- }
- }
- if(gamePage.calendar.cryptoPrice > myConfig.autoTradeBcoinSellMin)
- {
- if(gamePage.resPool.resourceMap.blackcoin.value > 0)
- {
- game.diplomacy.sellBcoin();
- }
- }
- }
- }
- if(myConfig.autoCombustTC)
- {
- if(gamePage.time.heat < myConfig.autoCombustTCHeat)
- {
- if(myConfig.autoCombustTCNb == 1)
- {
- gamePage.timeTab.cfPanel.children[0].children[0].onClick();
- }
- else if(myConfig.autoCombustTCNb == 5)
- {
- gamePage.timeTab.cfPanel.children[0].children[0].model.nextCycleLink.handler();
- }
- else if(myConfig.autoCombustTCNb == 45)
- {
- gamePage.timeTab.cfPanel.children[0].children[0].model.previousCycleLink.handler();
- }
- else if(myConfig.autoCombustTCNb == 500)
- {
- gamePage.timeTab.cfPanel.children[0].children[0].model.tenErasLink.handler();
- }
- //gamePage.timeTab.cfPanel.children[0].children[0].onClick();
- //gamePage.timeTab.cfPanel.children[0].children[0].model.nextCycleLink.handler(); //x5
- //gamePage.timeTab.cfPanel.children[0].children[0].model.previousCycleLink.handler(); //x45
- //gamePage.timeTab.cfPanel.children[0].children[0].model.tenErasLink.handler(); //x500
- }
- }
- if(myConfig.autoResetPraise)
- {
- if(gamePage.religion.faith > myConfig.autoResetPraiseUnit)
- {
- //gamePage.tabs[5].resetFaithInternal(1.01);
- //gamePage.religionTab.resetFaithInternal(1.01);
- game.religion.resetFaith(1.01, false);
- }
- }
- if(myConfig.autoPraise)
- {
- if ((gr("faith").value + (gr("faith").perTickCached * 5 * myConfig.autoPraiseSec)) > gr("faith").maxValue)
- {
- gamePage.religion.praise();
- }
- }
- if(myConfig.autoFurs)
- {
- if (gr("furs").value > myConfig.autoFursSec)
- {
- gamePage.craft("parchment", Math.floor(gr("furs").value / 1000) );
- }
- }
- if(myConfig.autoCompedium)
- {
- if ((gr("science").value + (gr("science").perTickCached * 5 * myConfig.autoCompediumSec)) > gr("science").maxValue)
- {
- //nbToCraft = Math.floor( (gr("science").perTickCached * 5 * myConfig.autoCompediumSec) / 10000);
- nbToCraft = Math.floor( (gr("science").value * (myConfig.autoCompediumSpend / 100)) / 10000 );
- if(nbToCraft < 1){nbToCraft = 1;}
- gamePage.craft("compedium", nbToCraft);
- }
- }
- if(myConfig.autoBlueprint)
- {
- if ((gr("science").value + (gr("science").perTickCached * 5 * myConfig.autoBlueprintSec)) > gr("science").maxValue)
- {
- //nbToCraft = Math.floor( (gr("science").perTickCached * 5 * myConfig.autoBlueprintSec) / 25000);
- nbToCraft = Math.floor( (gr("science").value * (myConfig.autoBlueprintSpend / 100)) / 25000 );
- if(nbToCraft < 1){nbToCraft = 1;}
- gamePage.craft("blueprint", nbToCraft);
- }
- }
- craftList.forEach(function(truck){
- objTemp = eval("myConfig."+truck[0]);
- objTempSec = eval("myConfig."+truck[0]+"Sec");
- priceTmp = myLast(gamePage.workshop.getCraft(truck[0]).prices).val;
- if(objTemp)
- {
- if ((gr(truck[1]).value + (gr(truck[1]).perTickCached * 5 * objTempSec)) > gr(truck[1]).maxValue)
- {
- //nbToCraft = Math.floor( (gr(truck[1]).perTickCached * 5 * objTempSec) / priceTmp);
- nbToCraft = Math.floor( (gr(truck[1]).value * ( eval("myConfig."+truck[0]+"Spend") / 100)) / priceTmp );
- if(nbToCraft < 1){nbToCraft = 1;}
- gamePage.craft(truck[0], nbToCraft);
- }
- }
- })
- myConfig.speed = myConfig.speedTmp;
- }
- //
- // Lag test
- //
- var checkLagOld = 0;
- var checkLagNow = 0;
- var checkLagSpeed = 0;
- var checkLagIsLaggin = false;
- var checkLagNbSecToCheck = 300;
- checkLag();
- function checkLag()
- {
- //console.log("checkLag Start");
- checkLagOld = Math.round(game.calendar.trueYear() * game.calendar.seasonsPerYear * game.calendar.daysPerSeason * game.calendar.ticksPerDay / game.ticksPerSecond);
- setTimeout(checkLagNext, 1000);
- }
- function checkLagNext()
- {
- //console.log("checkLagNow Start");
- checkLagNow = Math.round(game.calendar.trueYear() * game.calendar.seasonsPerYear * game.calendar.daysPerSeason * game.calendar.ticksPerDay / game.ticksPerSecond);
- calculatedSpeed = Math.round(checkLagNow - checkLagOld);
- console.log("Speed\t"+calculatedSpeed+"/"+myConfig.speed);
- if(checkLagIsLaggin)
- {
- if(calculatedSpeed > myConfig.speed + 2)
- {
- console.log("DejaVu!");
- setTimeout(checkLag, 1000*2);
- }
- else
- {
- console.log("DejaVu stoped ^^' "+game.calendar.year);
- checkLagIsLaggin = false;
- myConfig.speed = checkLagSpeed;
- setTimeout(checkLag, 1000*checkLagNbSecToCheck);
- }
- }
- else
- {
- //if(calculatedSpeed < myConfig.speed)
- //{
- checkLagIsLaggin = true;
- checkLagSpeed = myConfig.speed;
- myConfig.speed = 1;
- setTimeout(checkLag, 1000*5);
- //}
- //else
- //{
- // setTimeout(checkLag, 1000*checkLagNbSecToCheck);
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement