1.) Intro
Kitten craft is an automation tool for kittensgame. http://bloodrizer.ru/games/kittens/ It does some frequent crafting tasks like: craft wood from catnip, hunt, or gather some star charts.
2.) Getting started
You can control Kitten craft from your browsers javascript console.
How to open console: http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers
a. Open console
b. Copy the script, and then paste it to the console
c. Hit that enter
The script starts to run with the default settings.
3.) Resource types in my way
Common: the raw materials they crafted from, have cap limit (like wood, beam, slab, plate, etc.)
Uncommon: the raw materials they crafted from, haven't got cap limit (like parchment, compedium, etc.)
Transient: manpower, faith, star chart, and trading actions (i know, it makes no sense...)
4.) Basics
Start kittenCraft:
kittenCraft.start()
Stop kittenCraft:
kittenCraft.stop()
Set refresh interval: if you set this too low, and manpower / faith / trade if turned on the ui will disturbingly flicker due to tab changes. I recommend 5 seconds or above. If you set this during running, kittenCraft wil restart, but settings will not change.
kittenCraft.setRefresh(milliseconds) => kittenCraft.setRefresh(5000) => one tick will be 5 seconds
Export customized settings:
kittenCraft.export(); => you got a string in the console. Save that string somewhere.
Import your settings:
kittenCraft.import("{youSettingString}") => replace {youSettingString} with the string you got with from export.
4.a) Logging
Kitten craft makes some logging. You can turn it on and off.
Logger.toggle()
You can set the appearance of the message.
The type variable value can be: 'console', 'game', 'both'
Any other value for type indicates no logging.
Logger.setType(type)
4.b) Resource manipulation
All resources have name, amount, limit and enabled properties
@prop name:
You can use this properties, to refer to the resource object, to make further actions with it.
kittencraft uses the exact resource names from kittens game, witch means you can get the names from the user interface.
!! Except for compendium, witch was first misspelled in the game, so it can be referred in the code as: compedium !!
kittenCraft.getRes('wood') => shows you in the console the wood resource object, you can check all the props, and more...
kittenCraft.getRes('compedium') => yes its compedium, if you skipped the few lines above
@prop amount:
Represents the amount of resource witch will be crafted / tick if the other conditions are true.
The amount is the base amount for craft, not effected with modifiers like workshop or factory
Amounts value can be number, or 'all'. All will craft the maximum possible amount from the resource.
kittenCraft.getRes('wood').set({amount: 100})
kittenCraft.getRes('plate').set({amount: 'all'})
@prop limit:
You can set limitations for crafting.
Common resources: if the values of the raw materials of the resource hits the {maximum value} * limit, {amount} amount resource will be crafted.
kittenCraft.getRes('wood').set({amount: 100, limit: 0.8}) => 100 wood will be crafted if the value of catnip reaches 80% of it's maximum value.
kittenCraft.getRes('steel').set({amount: 'all', limit: 0.8}) => maximum possible amount of steel will be crafted if the value of iron and coal reaches 80% of their maximum values.
Uncommon resources: limit refers to the raw material of the resource, and means, that the value of the raw material can't fall below this value. If you have at least 5000 + {price} * {amount} raw material, {amount} amount resource will be crafted
kittenCraft.getRes('parchment').set({amount: 10, limit: 5000}) => 10 parchment will be crafted if you have at least 5000 + 175 * 10 = 6750 furs
kittenCraft.getRes('manuscript').set({amount: 'all', limit: 0}) => maximum possible amount of manuscript will be crafted if you have the price for at least 1
@prop enabled:
You can turn on or off the production for the resources
kittenCraft.toggle('wood') => run this command once, and you turn it off, run it again to turn it back on
kittenCraft.toggle('manpower')
kittenCraft.disableAllRes() => turns off all resource production
4.c) Transients
Manpower:
Send your kittens to hunt. Parameterization is the same as for common resources:
kittenCraft.getRes('manpower').set({amount: 3, limit: 0.8}) => if manpower reaches {manpowers max value} * {limit} (here 80%) send 3 squads of hunters (uses 300 manpower to hunt)
kittenCraft.getRes('manpower').set({amount: 'all', limit: 0.8}) => if manpower reaches {manpowers max value} * {limit} (here 80%) send all possibel squads to hunt (uses all the manpower)
kittenCraft.toggle('manpower') => turns on/off the hunting
Religion:
if religion is unlocked, then you can set to praise automatically. Amount has no meaning here due the game allows only to praise only all your current faith.
kittenCraft.getRes('faith').set({limit: 0.8}) => praise if current faith reaches your total faith's 80%
kittenCraft.toggle('faith') => turns on/off the praising
Calendar:
gather star charts
kittenCraft.toggle('calendar') => turns on/off the the observation
Trading:
Trading automation. Depends only on current gold amount.
kittenCraft.getRes('trade').set({limit: 0.8}); => trade will occur when gold reaches its 80% of max value
kittenCraft.toggle('trade') => turns on/off the trading
You add races to trade with automatically
kittenCraft.getRes('trade').addRace({name: 'Zebras', amount: 1, seasons:{spring: true, summer: true, autumn: true, winter: true}})
=> you add the zebras, to trade with 1 time in any seasons if gold amount is over 80% / tick
kittenCraft.getRes('trade').addRace({name: 'Sharks', amount: 5, seasons: {winter: true}}) => you add the sharks, to trade with 5 time in only in winter if gold amount is over 80% / tick
kittenCraft.getRes('trade').toggleRace('sharks') => turns on/off the trading with sharks
You can set race properties
kittenCraft.getRes('trade').getRace('sharks').setSeasons({spring: true, summer: true, autumn: true, winter: false}) => changes season limitation for the specified
kittenCraft.getRes('trade').getRace('zebras').setSeasons({spring: true}) => like above
kittenCraft.getRes('trade').getRace('zebras').setSeasons({amount: 10}) => trades from now 10 times / tick for zebras
Important to know, the crafting occurs only if the resource is already unlocked / researched in the game, and enabled in kittenCraft
5.) Defaults
For common:
name: 'wood', amount: 100, limit: 0.8
name: 'beam', amount: 25, limit: 0.8
name: 'slab', amount: 25, limit: 0.8
name: 'steel', amount: 'all', limit: 0.8
name: 'plate', amount: 10, limit: 0.8
For uncommon:
name: 'parchment', amount: 50, limit: 5000
name: 'manuscript', amount: 'all', limit: 0
name: 'compedium', amount: 'all', limit: 0
For transient:
name: 'calendar'
name: 'faith', amount: 0, limit: 0.1
name: 'manpower', amount: 3, limit: 0.8
name: 'trade', amount: 3, limit: 0.8
name: 'Zebras', amount: 1, seasons:{spring: true, summer: true, autumn: true, winter: true}
name: 'Sharks', amount: 1, seasons: {winter: true}
All resources are enabled.
Logging is set to 'both'.
Refresh rate is set for 5 seconds.
6.) Known issues
- Uncommon resources limitations not working exactly like i want to (as i wrote above) - FIXED
- UI flickers disturbingly if refresh is set too low (around below 3 seconds) - due tab changes - FIXED
- if you reset while script is running some weird shit can happen:
you get the karma and paragon, but all buildings, resources, and everything remains (not sure its my fault, but can be)
- game gets really slow after a few hours of run with kittenCraft. Recommended to reload the whole thing then.
I can only hope this mess is understandable. Enjoy.
dio 2014.08.02. on reddit