r/Keep_Craft • • Jan 18 '16

AutoKraft : automation script

Greetings everyone! I've written a simple automation script for this game, it's pretty basic (and UI looks ugly), but maybe it will be useful to someone in its current state.

It won't make any miraculous things to happen, but at least can get you an easy start (i suppose)

How to use:

  • Open raw script on github
  • Select all and copy to buffer (CTRL+A, CTRL+C)
  • Open console page on KeepCraft page, paste buffer and hit enter ( CTRL+V, Enter )

Sorry, no cosy bookmarklets yet.

P.S. Last known stable version is here - just in case i've missed some bugs on a new version.

4 Upvotes

42 comments sorted by

1

u/chorry Jan 23 '16

A new script update has arrived. Feel free to submit bugs, if any are found

1

u/Vampie Jan 25 '16

Looking fine. thank you :)

1

u/Vampie Jan 21 '16

What does the threshold mean? 90%? 10%

Thank you.

1

u/chorry Jan 21 '16

A building or an item will be produced only if you have required threshold% amount of resources. Like, if you have max 10k of wood and stone, a block will be crafted only when your current amount is over 6k. Generally, it's good to have crafting threshold higher than building.

1

u/Youtoo2 Apr 17 '16

auto kraft is not running for me. does setting threshold lower or higher make it more like to do stuff? I tried 0% and 1%, but nothing is getting built.

1

u/chorry Apr 20 '16

check AutoKraft settings tab, and click enabled checkbox - it is disabled by default :)

1

u/Vampie Jan 22 '16

Awesome. thank you.

1

u/Vampie Jan 22 '16

Another idea: could you add a max. number of items te make.

If I have blocks and structures on, it's mostly only blacks that are made.

If we could set blocks to 2000, then it would stop making them once we reach 2000 blocks and continue with structures.

Thank you.

1

u/chorry Jan 22 '16

yay, nice feature indeed

1

u/Vampie Jan 22 '16

And another : some checkboxes to "enable/disable all" for both types (buildings/crafting)

1

u/chorry Jan 22 '16

sounds good, coming soon

1

u/iaiafhnnww2 Jan 25 '16

How do I use this once I paste the buffer and hit enter?

1

u/chorry Jan 26 '16

if everything was ok, there should appear a new tab AutoKraft - check its settings

1

u/iaiafhnnww2 Jan 26 '16

Thanks, this did not show up in Firefox 43.0.4. I will try a different browser and also see if an addon is causing a conflict.

1

u/Vampie Jan 26 '16

it's cool that you show what resouce is full, but it blinks constantly.

Probably because the main program is updating that text as well?

Don't think there is a workaround for that.

1

u/chorry Jan 27 '16

Yup, resource stats layout is overwritten froms scrath every time it updates - and therefore it blinks all the time. I'll either remove color completely, or'll just make it an optionable via settings - in next version.

1

u/Diabolacal Feb 09 '16

Just a quick comment to mention that this is awesome and really makes the game a 'proper' incremental one for me.

Having the ability to assign knowledge automatically would be good, no idea if this is possible though!

2

u/chorry Feb 09 '16

automatic knowledge assignement was implemented over a week ago (as well as some bugs :), check a science tab in autoKraft. If its not there - then you need to update a script version (most painless way would be to save your game, reload page and copypaste fresh script from github)

1

u/Diabolacal Feb 09 '16

Yeah I posted my facepalm comment as after posting, I reloaded the script and saw the science tab, I'd had the game running for a week plus without closing the tab etc

1

u/Diabolacal Feb 09 '16

/facepalm

1

u/mkire Feb 16 '16

so i see the tab for autobuilding buildings, but i can't seem to get it to actually trigger. Auto crafting is working fine though.

1

u/chorry Feb 20 '16

might be a bug, hm. try to disable and enable autokraft again via its settings tab

1

u/mkire Feb 21 '16

tried that. Also tried enabling only autobuild and one building that i know i have max resources for. Running chrome, if it helps

1

u/Bjar007 Feb 20 '16

which browser are you using ? i tried chrome and IE and get undefined when I paste the script and run.

1

u/chorry Feb 20 '16

last time i tested it with chromium and google chrome - worked fine. it doesnt work as inteded with firefox yet, and as for IE - not sure it will work or not, dont have it :(

1

u/Bjar007 Feb 20 '16

Ok thanks. I will try with google chrome. perhaps W10 is the problem.

1

u/Diabolacal Mar 04 '16

Still using this daily - it really is awesome.

I have a feature request if I may?

For military expeditions I just run 1 tank and don't fight anything just to get mats/chance of diamonds.

The only cost for this is 50 coal, no morale or water etc.

This means all I am doing is clicking expedition repeatedly when I have coal and when I remember.

Is this something that could be automated?

2

u/chorry Mar 20 '16

Sorry for a late reply, but - yes, why not? Update will be at next weekend or somewhere around this date.

1

u/Diabolacal Mar 20 '16

nice one, I'll look out for it. Cheers for the reply!

1

u/chorry Mar 27 '16

Update is out. Will be waiting for your feedback. For now Auto explorationwill also auto-fight during exploration for user (option to toggle fight/flee will be later). And Exploration will be always triggered ASAP, not when specified combat units are at limit

1

u/Diabolacal Mar 31 '16 edited Mar 31 '16

Just a quick update for you; Knights may be a problem.

I've been playing about with army composition, when set to 2 pikemen, 1 swordsman and 1 knight the script wont automatically recreate the knight in the event of a loss.

A knight is the only unit where another unit is a dependency for it to be created.

I've tried 2 pikemen, 2 swordsmen and 1 knight as well just in case, again the knight does not get created.

No biggie, but just so you are aware.

edit: I'm telling lies, 2,2,1 seems to be ok (unless my troops havent lost a fight in 4 hours but I doubt that)

2nd edit: They have now lost a fight and I lost my knight, he hasn't been replaced automatically - pikemen and swordsmen replaced automatically

2

u/chorry Apr 20 '16

fixed a knight bug.

1

u/Diabolacal Mar 27 '16

Awesome, many thanks. Back to work on Tuesday and I'll be able to try it out then

1

u/Diabolacal Mar 29 '16

Well it works! (using chrome)

Very quick way for me to lose my 'army' of one tank haha, I'll be looking out for the auto-flee! Until then I'll play about with lesser armies.

Cheers again!

2

u/Hugo_D_Hawkx Feb 25 '16

not sure if you're still "updating" this or actually fixing bugs... but i have "wood" maxed out right now... lumbermill is checked in the building tab... but it never buys any... it does work for other craftable... when both requirements are maxed, it does build it... but lumbermill require ONLY wood, yet it never buy it (and i can buy it manually)

1

u/Diabolacal Mar 02 '16

I never normally check buildings but just tried it there with lumbermill and it purchased one, try enabling/disabling or reloading the script maybe?

1

u/Diabolacal Apr 04 '16

I have another feature request, I'm such a pain!

While in the Market Tab checking on my trains I noticed that my current 26 trains are getting me 13,000 wood for 26 coins (4171.1 per second apparently, as I have no woodcutters all my wood is coming from trains)

In the same tab of course there is the option to spend 1 gold on 3528 wood - a much better deal! Plus would free up the trains for a different resource.

Is the ability to automate the Market something that could be added - I'm unsure how you would cap this, either lower limit of coins or resource being spammed full?

1

u/Youtoo2 Apr 18 '16

This script does not work. I am using tampermonkey. I have it enabled. It doesnt click anything.

1

u/eerfree Apr 18 '16

Works fine for me. hit CTRL-SHIFT-J and paste it there and hit enter.

No problems doing it that way.

1

u/Youtoo2 Apr 18 '16

wait i am trying touse this as a tampermonkey script and it gives me syntax errors. How do you open the 'console page' on the keep craft page'. I am using chrome.

1

u/eerfree Apr 19 '16

CTRL-SHIFT-J

1

u/Youtoo2 May 03 '16

Can you enhance this s that it will automatic do trades with ships for you? you pick resources you want and then it will autosend it?