npm install @prljav/prlibin order to get the "auth" string you need to copy the first packet your client sends to the server, will look like
{"cmd":"login","msg":{"name":"your username","password":"your plaintext password","width":193,"height":33,"ttype":"play.proceduralrealms.com"},"reqId":"this does not matter"}
or
{"cmd":"token","msg":{"name":"Prljav","token":"Some text here","width":127,"height":33,"ttype":"play.proceduralrealms.com"},"reqId":"this does not matter"}
just do npm run build
The changes are sorted by priority, the first one being highest and the last lowest.
- Add a websocket server, allowing for the official web client to connect to the bot and make debugging and controling the bot much easier.
- Publish to NPM.
- Keep the state of the bot, where it's at, it's food, stamina and similar. (stamina and food not done, but the coords and region are)
- Add a better way to run popular commands, movement and chatting.
- Easier way for making commands, maybe even built-in?
How do i use the debugging feature?
- Set up a proxy between you and PR, you want to degrade the connection to a HTTP one, so that you can connect to non secure websocket servers. I am hosting a HTTP instance of a client here, you can use it, but i recommend you use your own, as you cannot trust me. It can be done extremely easily with Caddy, look it up (you can also do it by self hosting the client yourself, but its easier to just proxy the official one)
- Make sure you enabled the debug flag when defining the bot.
- After that go to your proxied PR web client and open your dev console and go on the Network tab.
- Refresh the tab and click on the websocket connection that opened (if you cant find it select the WS filter)
- Go to the "Initiator" tab and select the highest function in the "Request call stack" (click on the index-....js:numbers)
- Enable local overrides, this depends on the browser but is usually very simple to do.
- Replace
new window.WebSocket(b),withnew window.WebSocket("ws://localhost:8008"),. - Refresh your tab and login as any account in your list.
- You are done, now you and your bot are on the same client, you can play manually while your bot can work and do things, or you can just monitor and debug the bot much easier since you have a whole UI.
big thanks to the PR devs for making the web client open source, allowing me to make the live debugging feature muuuch more easily