Bots - Slackaduts/Deimos-Wizard101 GitHub Wiki

How to make Bots

Basic Info

For information on XYZ's and Orients, check the Flythroughs section of this wiki.

Syntax

Here's the syntax for bot commands (You can also use commas to separate these instead of spaces):

client action arguments

Keep in mind that the client argument must be omitted for commands that do not use a client.

Specifying Clients

To do things to all clients at once, use "mass" as your client string. Example:

mass teleport XYZ(0, 0, 0)

To do things on multiple clients, use a colon to seperate the clients. Example:

p1:p2:p4 teleport XYZ(0, 0, 0)

To do things on all clients EXCEPT 1 or more clients, use "except". Example:

except p1:p2 teleport XYZ(0, 0, 0)

Comment Tags

The Bot Creator supports single-line comment tags, used as they are in Python. Anything after a # (comment tag) will be ignored by the bot. Multi-line comment tags are not supported, however you can place as many single line comments as you want.

Comments can take up an entire line:

# icecream

Or they can be placed in the middle of a line, as such:

mass teleport XYZ(0, 0, 0)  # cold popcorn

Command List

teleport or tp

Teleports the client(s) to a specified XYZ. Does not move afterward. Example:

p1 tp XYZ(0, 0, 0)

Optional parameter "closestmob" or "mob" teleports to each listed client's nearest mob. Example:

p1 tp closestmob

Optional parameter "quest", "questpos", or "questposition" teleports each listed client to their own quest position. Example:

mass tp quest

You can also optionally enter a client as the third parameter. This will teleport the listed clients to the client that you provide. This only works if the provided client is in the same zone as the teleporting clients. If you need inter-zone teleporting, use the friendtp command instead. In this example, we teleport all clients except p1 to client p1:

except p1 tp p1

walkto or goto

Walks the client(s) in a straight line to a specified XYZ. Keep in mind the Z coordinate here is irrelevant. Example:

p1 walkto XYZ(0, 0, 0)

sendkey, press, or presskey

Sends a specified key press (check #reference for a list of valid key names) to the client(s) and holds for a specified period of time (in seconds). Example:

p1 sendkey A, 0.1

waitfordialog or waitfordialogue

Waits for dialogue to appear on the specified client(s). Optional "completion" argument waits for dialogue to stop. Example:

p1 waitfordialogue

waitforbattle or waitforcombat

Waits for combat on the specified client(s). Optional "completion" argument waits for combat to stop. Example:

p1 waitforcombat completion

waitforzonechange

Waits for the zone to change on the specified client(s) Optional "completion" argument waits for the loading screen to finish. Example:

p1 waitforzonechange completion

Optional 'zone' parameter (and a fourth parameter providing the name of the zone) allows for safe zone changes that avoid race conditions. waitforzonechange will specifically wait until the client's zone is different than the zone name provided. To be clear, the zone name you provide is the zone you are coming from, not going to. In this example, the bot will wait for our zone to change from ravenwood to anything else:

mass waitforzonechange zone WizardCity/WC_Ravenwood

waitforfree

Waits until the specified client(s) is not in combat, dialogue, or a loading screen. Optional "completion" argument waits for the opposite of this. Example:

p1 waitforfree

usepotion

Uses a potion on the specified client(s). Example:

p1 usepotion

Optionally you can include a third (health) and fourth (mana) parameter. A potion will then only be used if your health falls below the provided values (note that these are percentages). In this example, a potion will be used if your health falls below 50% or your mana falls below 15%:

mass usepotion 50, 15

buypotions

Buys potions on the specified client(s). Returns via a mark location. Example:

p1 buypotions

Optional 'ifneeded' parameter will force buypotions to only buy potions when you run out of potions. Note: does not work on clients that are level 5 or below. Example:

mass buypotions ifneeded

sleep, wait, or delay

Delays for a specified number of seconds. Example:

sleep 2

kill, killbot, stop, stopbot, end, exit

Kills the bot. Allows for running bots once, instead of looping infinitely. Example:

kill

logoutandin or relog

Logs out and then logs back in on the specified client(s). Example:

p1 relog

click

Clicks at the specified screen X and screen Y. Example:

p1 click 400 500

clickwindow

Clicks the specified window, by its window path. Example:

p1 clickwindow ['WorldView', 'windowHUD', 'compassAndTeleporterButtons', 'OpenCantripsButton']

friendtp or friendteleport

Uses the friend teleport feature to sync up clients. Enter a wizard name as the third parameter and the selected clients will read their friends list and teleport to the wizard with the matching name. Example:

except p1 friendtp Connor Storm

For rare cases in which you have multiple friended wizards with the same name, you can enter 'icon' as the third parameter. The selected clients will teleport to the wizard on their friend list that has been given a fish icon. This is NOT recommended, and most people should use the wizard name method. Example:

except p1 friendtp icon

waitforwindow or waitforpath

Waits for a specific window, by its path, to be visible. Optional "completion" argument waits for the opposite of this. Example:

p1 waitforwindow ['WorldView', 'windowHUD', 'compassAndTeleporterButtons', 'OpenCantripsButton']

entitytp or entityteleport

Teleports to the entity that closest matches a specified name. This works with inexact names. Example:

p1 entitytp Mana

log, debug, or print

Logs a string of text. Example:

print "This is a log."
print 'This is another log.'

Optional "window" parameter lets you print out text from a window, by its path. Example:

print window ["WorldView", "windowHUD", "QuestHelperHud", "ElementWindow", "", "txtGoalName"]

tozone

Attempts to teleport clients to the provided zone. This does not work for all zones, but will work for most main street zones in the game. Example:

mass tozone WizardCity/WC_Ravenwood