Getting Started
To setup your playerbot-lua
development environment, follow the installation instructions below.
Installation instructions (Windows):
The following instructions will guide you through installing the playerbot CLI to a global location (optional) and initializing a script source directory.
- In a global location, such as
C:\Program Files\
, create a folder calledPlayerbot CLI
. - Download the file
playerbot.zip
from the latest release. - Right click on the downloaded file and choose
Extract All
from the context menu. - In the destination text box, enter the folder path created in step 1 e.g.
C:\Program Files\Playerbot CLI\
and pressExtract
. - Open the windows start menu, and begin typing
environment variables
. Choose the first resultEdit the system environment variables
. ASystem Properties
window will appear. - Click the
Environment Variables...
button at the bottom right. AEnvironment Variables
windows will appear. - In the first table in the new window titled
User variables for <user>
, locate and double click on the row with the variable namePath
. A new window titledEditor Environment Variable
will appear. - Press the
New
button at the top right of the window. A new row in the table will appear. - In the new row text box, enter the folder location of
playerbot.exe
e.g.C:\Program Files\Playerbot CLI\
. - Click
Ok
at the bottom of theEditor Environment Variable
window, theEnvironment Variables
window, and theSystem Properties
window. - Open a new terminal such as
Powershell
orCommand Prompt
or open VS Code and run a terminal (CTRL+SHIFT+`) at the location where the lua script files will be located (if a terminal is already open, close and re-open it or restart VS Code). - Run the command
playerbot
. The directory will be initialized with a configuration file. - In the WoW client, run the command
.bot ai get token
. Enter the provided token into the configuration file'sTOKEN
field value. - Modify the configuration file to update the
API_HOST
andLOG_HOST
addresses to point to the correct location. If desired, change the relative path where lua script files should be stored (default issrc/
). - Run the command
playerbot
again. It will attempt to authorize the token. If successful, the provided directory will initialize. - Run the command
playerbot -deploy
. The hello world provided script will deploy. - Add a bot as normal using the command
bot add <name>
. - In-game, run the command
.bot ai use lua
to switch to lua scripting mode. - A system message will appear as instructed in
main.lua
which will readAI scripting is alive :)
. - Outside the game, edit the
main.lua
script file to change the printed string to something else, e.g.AI scripting is alive!
. - In-game, run the command
.bot ai load
. The changed string will appear printed as written. - For more information on what the CLI can do, run the command
playerbot --help
or check the documentation.
Workflow
- Login to the WoW server and choose your master character.
- In the in-game chat, run the command
.bot ai use lua
. - Run the command
.bot ai get token
and updateconfig.yml
in your script source directory with the updated token if necessary. - Begin scripting using the API.
- Once you'd like to your run your scripts, run
playerbot -deploy
. - In-game, run the command
.bot ai load
.
Repeat steps 4 through 6 as you develop your scripts. If you get errors on deployment indicating that your token has expired, repeat step 3.
Bug reports, suggestions, or any other questions should be created as issues here.