Zistrosk bot script
How to Make a Bot : The general techniques involved in running a character on triggers, and samples thereof.
Source: Zistrosk's zMud Page – Information from way back when...
Making a bot is the culmination of all other techniques discussed on this collection of web pages. If you haven't taken the time to read through the other sections, and played with a few of the samples, then it is likely you will have a harder time understanding the materials here, excepting the case where you already know how to make bots, in which case this material may or may not be of any use to you. This page is organized a little differently than the others in that you will find examples up front, and then a brief description of how to make a bot further down. If you have truly read and understand the other sections presented here, then these bot scripts will make sense to you once you see them in action, and need little explanation. If you have not read the other sections, then at least there are some scripts provided here for you to play with, and it's your choice to "jump in at the deep end" if you so desire. In either case, good luck to you in all of your botting endeavors, and please stay out of trouble with your local MUD administrators.
These "Bot Scripts" are provided as-is with all the usual disclaimers. These scripts _do_ work, but whether they will work for you is another matter entirely. For something as complicated as a bot script, it is very difficult to write it to work for every version of zMud. You will find multiple versions of some bot scripts below, and only single versions of others. Some bot scripts won't run under zMud version 4.62 but will be fine under v6.16. Some will run fine under v5.55 but not under v4.62 or v6.16! All of them can be modified to run on any version from v4.62 and up, and some of them might just run under 3.62 with a little coaxing. In "college terms", these modifications are left as an exercise to the reader (i.e. YOU). There is enough reference material on this page already that you should be able to figure out why something is or is not working, and draw from other examples to find a way to modify them so that they perform the way you intend them to.
BREW BOT TRIGGERS FOR ZMUD V4.62
BREW BOT TRIGGERS FOR ZMUD V6.16
SANION'S BREWING BOT TRIGGERS (Thank You Sanion, You ROCK!!)
COMPLETE CLERIC BOT FOR REALMS OF DESPAIR (for zMud 6.16 based on Hedonn, a bot I once ran)
COMPLETE MAGE BOT FOR REALMS OF DESPAIR (for zMud 6.16 based on Sidia, a bot I once ran)
What does it take to make a bot?
1. A bot must do something repetitively.
This may seem rather obvious, but honestly, if your going to make a bot then you must have some purpose in mind. Whatever it does, you probably want it to do that thing over and over and over again so you don't have to sit there, bored, and type it yourself. There are many things that a bot can do, but a few ideas I have seen are:
A bot that casts spells on others upon request (i.e. a "spellbot") A bot that automatically brews or scribes a certain number of certain spells for your use later (i.e. "brewbot" or "scribebot") A bot that makes something to sell (i.e. a "shopkeeper" bot, perhaps another form of brewbot) A bot that runs a game for money, paying out customers who win (i.e. a "gamblingbot") A bot that monitors the auction channel and adds the items found to a database (i.e. a "databot") A bot that runs around and kills mobs automatically (i.e. a "killbot") NOTE-- Killbots are usually illegal, and will get you banned from a mud, so best to ask if this is OK first than to try to beg forgiveness later!!!
In order to make a bot do something repetitively, there must be some kind of trigger, alias, or something set up that runs in a loop of some kind. For example, mages will run out of mana and have to trance or meditate to regain their mana. If you program a trigger that goes off when the don't have any mana left, and then makes them trance back up, then you've just made a loop. The loop starts when they run out of mana, and continues until they run out of mana again, thereby restarting the loop again. A more efficient way of doing this is to use the Ticktimer, and program an alias into it that will check the mana your mage has and decide whether to automatically trance/meditate or not. Also, consider a galblingbot. A gamblingbot's loop might start when a new game starts, and run until the next game starts. The loop simply signifies a definite, repeating action that is a starting or ending point for the bot's cycle. Every bot has one, whether it's obvious or not. When you decide to make a bot, you have to decide "how it will go", what steps the bot will take, and when the loop starts and stops. No loop means no repetitive action, which means you are not running a bot.
2. A bot must have instruction in the form of triggers, aliases, and other settings, so that it can accomplish it's work.
If you want a bot to do something, then you have to not only figure out how, you must also tell it how. Triggers will take action based on text from the mud, or from aliases. Aliases can be executed by triggers, alarms, and the tick timer. Alarms can be set to countdown to a new action to perform. Use these functions together in a kind of mini bot-operating-system to get the bot to perform for your intended audience. For example, if you want a bot to heal people when they ask, you'll need a trigger to catch that request from the mud. After that, it's up to you as to whether you have the trigger cast heal on the requestor, or if you want to make it a bit more complicated and use aliases, lists, parsing, text manipulation, etc. There are many many ways to make bots, and it's likely that once you have a bot running you'll find ways to improve upon them and make them better for your intended users.
3. A bot must have some kind of spam-protection.
This not only refers to the bot not getting disconnected because it is spamming the MUD, but that it should not cause undue spam to the room in which it resides or the users it services. Since, by design, a bot usually runs unattended by you, there needs to be protection in place so that the MUD administrators don't get mad at you and lock up your bot (or worse). It is for this reason that it is unwise to use triggers that respond immediately with an action that is sent back to the MUD. Granted, these are the easiest triggers to make, but they should not be used for a public bot that might be subject to abuse by the general population of the MUD. Adding counters, lists, timer delays, and that sort of thing, can go a long way towards keeping the spam down and keeping your bots running smoothly.
4. A bot should have a point of contact for comments, suggestions, and complaints.
If you choose to run a public bot, then you have to provide feedback for your users. On the other hand, if the bot is just for you, then this isn't a concern.
Since that's pretty much it, I leave you with my top 10 list of things bots should be:
A bot should be: 1. Non-spammy 2. User friendly 3. Useful 4. Accessible (i.e. not hard to find and use) 5. Responsive 6. Difficult to abuse 7. Maintained properly 8. Updated as often as needed 9. Carefully tested 10.Completely Legal, according to the rules of the MUD it is on
Good luck, and Happy Botting!
See Also: Text Manipulation