Spaceplan
jhollands.co.uk
jhollands.co.uk
var clickBestThing = function(){
var things = [...document.querySelectorAll("#manufacture__container > div")].map(function(e){
var res = {e};
[...e.getElementsByTagName("span")].map(function(s){
res[s.id] = +s.innerText.replace(/[^0-9]/g, '')
})
if(e.id === "item__spudGun" || e.id === "item__potatoLauncher") res.powerGain *= 1000;
res.score = res.cost / res.powerGain;
// res.score = res.cost / res.spudGain;
res.name = e.getElementsByClassName("manufacture__name")[0].innerText;
return res
}).sort(function(a,b){return a.score - b.score})
window.things = things;
var bestThing = things[0];
if(!things[things.length-1].score) bestThing = things[things.length-1]
console.info("clicking " + bestThing.name)
things[0].e.click();
}
var timer = setInterval(clickBestThing, 5000)
Of course it's much easier to `power = 999...`, but this feels more like automation and less like cheating.Copy and paste the code in your browser's javascript console. In Chrome it's under View/Developer/JavaScript Console.
For a good intro on how this works: https://www.khanacademy.org/computing/computer-programming/h...
cA/p + cB/(p+pA) < cB/p + cA/(p+pA)
Solving this, we get cA * (p+pA)/pA < cB * (p+pB)/pB Since the left side is all in A, if we pick the item minimizing that quantity, it is faster to buy it before any other item. So changing res.score to be res.cost * (cur_power + res.powerGain)/res.powerGain is going to be a bit faster
cA/p is just the time it would take to earn the money to buy A at the current production level - seems much simpler now.
I think the last term should be `cA/(p+pB)`. When I solve from there[1] I get `cB * pB < cA * pA`, which means that the most optimal item A will have the largest product `cA * pA`.
This would translate to:
res.score = res.cost*res.powerGain
...
}).sort(function(a,b){return b.score - a.score})
Does that check out? It seems too simple, and now that I'm thinking more about it I think this would be functionally equal to what I already have. Did I do my inequality[1] wrong?https://gist.github.com/thexa4/2da63028a1d8007dedbd0ba9432c8...
...I'd complain but I'm too busy micromanaging space potatoes.
The level of polish is what kept me clicking 285 times just to 'start' the game. Very cool.
Kudos to the developers. Really lovely game, intuitive and entertaining, well-built.
var ki = setInterval(function() { kinetigenClick(); kinetigenRelease(); }, 10);
Then later on at a certain point in the game, I had to stop it:
clearInterval(ki);
(program):1 Uncaught ReferenceError: kinetigenClick is not defined
What am I doing wrong?
You put a clicker in front of me and baam. Lost a hour.
Good stuff, thanks for sharing!
var x = 0; while(x < 10000) { x++; kinetigenClick(); kinetigenRelease(); }
That is the nicest thing anyone has ever called me.
power = n; (where n is whatever you need)
sol.mass = 3e7;
Cool game!
Fun game concept!
Also [[SPOILERS]] the ending sequence wedged after 'go be a hero', luckily when I refreshed the page it put me back to just before the black hole bit. Maybe it broke because I was on the solar system view and not the planet view or something? It worked the second time anyway.
They should change it to: молодец.
Also, thanks for ruining my dissertation...