PAI-BOT WINDOWS INSTALLATION
PAI-Bot Installation Guide
In order to use the PAI system, you will need to connect to PAI-NET.
please make sure you acquire the following information before you start the installation process:
- PAI-NET URL – the URL of the PAI-NET you will be using
- Organization name
- PAI-NET user & password
Before you install PAI-Bot you will need to set up the PAI environment.
PAI environment includes a directory (the PAI\directory) that stores all PAI’s files:
Set an environment variable of PAI with value C:\PAI (necessary before Bot installation )
here are the steps to permanently add an environment variable on Windows:
In Windows 10 you can directly get to the Environment Variables window using Search the web and Windows box next to the Start menu. Type environment variables in Windows Search box which gives you two options in search results:
- Edit the system environment variables
- Edit environment variables for your account.
Choose either option and you can add, edit or delete environment variables like PATH.
- Click the “Environment Variables…” button.
- Under the “System Variables” section (the lower half), find the row with “Path” in the first column, and click edit.
- The “Edit environment variable” UI will appear. Here, you can click “New” and type in the new path
- Variable=PAI & Value=C:\PAI
- Choose “OK”. Your changes are saved!
- To test it, in new CMD window, type:
$ cd %PAI%
- It suppose to move you to the C:\PAI directory
PAI-Bot cannot work without the PAI directory, please make sure all files and directories are properly configured before you continue.
After you set up the environment, we can start installing the Bot.
PAI-Bot is a Node-JS application, and require you to install Node-JS and npm on your machine.
PAI Bot installation guide:
- Open git bash
- Move with cd to the folder – C:\PAI\Bot
- Clone the project from our GitHub repository with the command: ‘ git clone https://github.com/PAI-Tech/PAI-BOT.git ‘
- Open node terminal as an administrator, go to the project folder in ‘C:\PAI\Bot\PAI-BOT’ and run: ‘ npm i -g npm’ first, to update NPM. Then run ` npm i `. this will install all PAI-Bot packages that are required for running the bot.
- Run the command: ‘ npm i -g –production windows-build-tools ‘ – in order to install windows tools – Python & Visual Studio tools
- In order to control your Bot with PAI-Control-Panel, you will need to register your Bot to PAI-NET:
Run the command ` node run init ` in your terminal, this will set up your Bot, and will ask you questions to configure your Bot:
- “Your Bot is not connected to PAI-NET. Would you like to register your bot to PAI-NET ?” – Press Enter
- “Please enter PAI-NET URL” – The URL you got from us
- “Please enter PAI-NET username (email):” – enter your PAI-NET username
- Enter your PAI-NET password
- You should get now: token is now active & login success
- “Do you want to register new bot or load an existing bot ?” – Choose “CREATE NEW BOT”
- “Please enter Bot’s nickname:” – enter any nickname you want for your Bot.
- “Select organization: ” – Choose “Developers”
- You should get now: bot created: $NICKNAME & token is now active & login success & Done
Congratulations! you’ve successfully created your first new PAI-Bot
- After you configured your Bot, open the webstorm and run the bot. This will start the Bot process. look for the ” PAI-NET socket connected to server ” log, if you see this message then your Bot is online!
- Go to PAI-Control-Panel and communicate with your Bot.
- Tested version : Windows 10
Q: What was the process done?
A: – Set PAI enviroment and install the bot
- Create PAI folders: Win: C:\PAI & C:\PAI\Bot
- Installed prerequisite
- Cloning Bot git project
- Install npm packages
- Running bot installation
- Bot is running
- Open console: $URL_YOU_GOT_FROM_US