Reference
Command book
After creation, everything you type is a method on hero. The creation screen is the exception: print, set_name, choose_race, and choose_class, with the word in quotes.
How a snippet is sent
hero.look()
hero.buy("bread")Press F5 or the Run button. Plain lines like these run from the top, and each one has to be a call this room allows. The output pane echoes what you sent. The status log is the story. Get Help, or hero.help(), prints the list for town, the wilds, or the fight you are in.
Add a name, an if, a loop, or a def and the whole box switches to Python. Then print, len, range, and the other builtins work, and a returned list can be indexed: recipes[0], row["id"]. That fence is the Python chapter. A lone print("hello") is only accepted while you are creating the hero.
Twenty actions make a day. Resting also ends the day. The inn will not open a tab you cannot pay. One Python snippet may also call the hero at most 200 times before it stops itself.
Town
| Call | What |
|---|---|
| hero.look() | Describe the town, stalls, and what you can do here. |
| hero.shop() | List vendors. Returns the item ids on the open counter. |
| hero.enter_shop("general") | Open general, blacksmith, or alchemist. |
| hero.buy("bread") | Pay the listed value and add one to the bag. |
| hero.sell("rat_tail") | Sell one. You receive 40% of the item’s value. |
| hero.rest() | Inn. Costs 10 gold. Fills HP, mana, and stamina, then the day advances. |
| hero.look_stations() | Station ids in this town only. |
| hero.craft("recipe_cured_rawhide") | Craft if you have the station, the profession level, and the ingredients. Returns true or false. |
| hero.upgrade("cotton_armor#1") | Raise that exact piece one tier, up to tier 4. Tools, rings, and necklaces refuse. |
| hero.professions() | Every profession, its level, and its rank. |
| hero.profession("enchanter") | One profession’s ladder and what it unlocks. |
| hero.recipe_list("leatherer") | Recipes for one profession, or all of them if you omit the name. |
| hero.recipe_available() | Ids you can make right now. recipes[0] is the first; hero.craft(recipes[0]) makes it. |
| hero.enchant("copper_short_sword", "minor_keen") | Inscribe a rune onto a piece. Needs the rune table and enchanter progress. |
| hero.disenchant("copper_short_sword") | Strip the rune from that piece. |
| hero.enchant_list() | Rune ids you can apply. |
| hero.inventory_list() | Returns a list of {id, name, qty}. |
| hero.equipment_list() | What is worn in each slot. |
| hero.equip("copper_short_sword") | Wear a bag item if the slot and your class allow it. |
| hero.unequip("offhand") | Return that slot to the bag. Slots: armor, cape, necklace, ring, mainhand, offhand, shoulder. |
| hero.bank() | Show the town bank. |
| hero.deposit("bread", 5) | Store items. Omit the number to store one. |
| hero.withdraw("bread") | Take stored items back. |
| hero.deposit_gold(50) | Bank gold. withdraw_gold(20) takes it out. |
| hero.toolbelt() | The six profession tools. They are not armor. |
| hero.equip_tool("copper_skinning_knife") | Move a tool from the bag into its profession slot. |
| hero.unequip_tool("leatherer") | Return that profession’s tool to the bag. |
| hero.stats() | Attributes, derived HP, mana, stamina, crit, dodge, carry weight. |
| hero.progress() | Level, experience to next, campaign position. |
| hero.save("save1") | Write a named slot. hero.saves() lists them. hero.quicksave() writes the quick slot. |
| hero.leave_town() | Enter the current wild stage. Pass a number to pick an unlocked stage. |
| hero.help() | Command list for town. |
| hero.quit() | Leave the game. |
Wilds
| Call | What |
|---|---|
| hero.move_right(2) | Step. Also move_left, move_up, move_down. The number defaults to 1. |
| hero.standby() | Hold still for a turn. Useful when you want the world to tick without walking. |
| hero.look() | Reread the floor you are on: foes, harvest squares, and where the gold exit sits. |
| hero.look_nodes() | Nearby harvests, then every live node on the map: id, profession, level, and a letter. Returns the names. The map draws colors, not those letters: h herb, w wood, m metal, f fiber, k hide. |
| hero.gather("chamomile_blossoms") | Harvest. With no argument, the nearest node. Returns true or false. |
| hero.skills() | Skill ids you can cast: class skills you have unlocked, plus the weapon and offhand you are holding. |
| hero.leave() | Same door as leave_town. In the wilds or a fight, this walks back to the hub for this stage. |
Combat
| Call | What |
|---|---|
| hero.in_combat() | True while a foe is still standing. |
| hero.foes() | A list of {name, hp, max_hp}. Order is the order attack(n) uses. |
| hero.attack() | Basic hit on foe 1. hero.attack(2) picks the second. Returns true or false. |
| hero.defend() | Guard this turn. The next hit is halved, and Guard raises defense for the duration. |
| hero.skill("power_strike") | Spend stamina or mana and resolve that skill. aimed_shot means the archer’s precise shot. Returns true or false. |
| hero.use("minor_hp_potion") | Spend one of that item. Healing uses the potion’s percent of your max, and never goes below its floor. |
| hero.run() | Try to leave the fight. |
| hero.hp | Your current hit points. Read it; do not call it. max resource is mana for a mage and stamina otherwise. |
Ids, not labels
buy, sell, equip, use, gather, craft, and skill all want the id you would put in quotes: minor_hp_potion, not “Minor Health Potion”. Gear you own more than once is numbered, as in cotton_armor#1, and upgrade wants that exact token. recipe_available and enchant_list exist so you never have to guess the string.