Mines Malingerer
Posts: 45
Joined: Saturday, 13th August 2011, 14:21
Zot Bot - A Stone Soup Borg [v0.1.6]
Zot Bot is an AI script that will play DCSS by itself without any player intervention. These are commonly called "borgs" in the context of roguelikes. Mine was inspired by the APW-Borg for Angband which was eventually turned into a screensaver. Zot Bot's base code was primarily based on elliptic's autorobin FeBe bot as well as parts of N78291's and 7hm's bots. The main difference with Zot Bot is that it autoruns without any player intervention (at least in theory) and isn't specialized for a specific character build. My hope is to eventually have it perform with at least basic competency regardless of the species/background used. I'd like to turn it into a screensaver as well!
Installation and Usage (written for Windows 7, should be similar for all versions of Windows)
- Download the ZotBot.rc file and place it in the "settings" folder of your Crawl directory.
- Create a Windows shortcut for crawl.exe
- Right-click the shortcut and select Properties. Go to the Shortcut tab.
- In the Target field, add this to the end: -rc settings/ZotBot.rc
(example: C:\Games\stone_soup-0.9\crawl.exe -rc settings/ZotBot.rc) - Double click the shortcut to start! Zot Bot will run automatically after you've chosen a character.
- (Optional) Set a macro to ===s if you'd like to pause/resume Zot Bot to control the character yourself.
Current Behavior
- Uses autotravel for most exploration.
- Rests whenever not at max HP and MP
- Attacks monsters at range with throwable weapons (if available)
- Engages in melee combat when in close quarters
- Attempts to escape when at low health (<25%)
- Attempts to back into a corridor when fighting multiple enemies in melee combat
- Basic scroll and potion usage
- Eats when hungry. Will attempt to butcher corpses when no food is available.
- Trys on rings and amulets
- Drops unneeded items and weapons it is not trained in
- Uses ranged weapons over melee depending on character skills
- Automatically chooses STR on level up
Contributions are welcome! If you think you can improve upon an existing function or want to write one to handle something on the to-do list, please do! I'm sure there's many better Lua scripters than me on this forum (I'm new to Lua) and there's definitely better DCSS players.
Right now, the main problem is detecting the stat choice prompt on level up. Checking you.xl() does not work, the value changes after the player inputs their choice. I've dealt with this for now by inputting an 's' after every turn, which is a horribly inefficient and limiting solution. If someone knows a better way, please let me know!
To-Do List
- Proper detection and handling of stat choice on level up.
- Use spells.
- Use abilities
- God worship
- Define more use cases for specific scrolls and potions
- Handle shopping
- Stop fleeing and attack if unable to escape
- Use stairs to aid fleeing
- Use found weapons and armor
- Handle invisible enemies (no idea how)
- Actively search for corpses when hungry
Original Post:
Last year, I found a bot for Angband that allowed it to be run as a screensaver and I absolutely loved it. Great fun watching the AI progress through the levels and seeing how far it could get each time. I'd love to have the same setup for DCSS as I much prefer it to Angband and I think it'd be a lot more interesting to watch. I found this thread and have been altering elliptic's great bot, stripping it down and trying to clean up some bugs before I flesh it out for a specific build of my choice. Things are going great so far. I do have one hang-up though. I can't figure out how to make the bot run itself without having to hold down a key. All three of the bots in that thread were designed to be run via a macro binded to "d" and just holding down the key. I'm a decent programmer but I'm new to Lua and haven't played around with a roguelike's code before, so hopefully I'm just missing something obvious. Any help would be much appreciated!