Zor Posted May 7, 2018 Share Posted May 7, 2018 So I was thinking about it and the only way I can think of is to have bot1 write to a text file. And have bot2 reading that text file. Is that how most people make auto muling etc or how is it done? (I am new to scripting so I may just not know of some easy method) Quote Link to comment Share on other sites More sharing options...
Alek Posted May 7, 2018 Share Posted May 7, 2018 34 minutes ago, Zor said: So I was thinking about it and the only way I can think of is to have bot1 write to a text file. And have bot2 reading that text file. Is that how most people make auto muling etc or how is it done? (I am new to scripting so I may just not know of some easy method) This would lead to race conditions, so it would probably not work. 1 Quote Link to comment Share on other sites More sharing options...
dazeldo Posted May 7, 2018 Share Posted May 7, 2018 38 minutes ago, Zor said: So I was thinking about it and the only way I can think of is to have bot1 write to a text file. And have bot2 reading that text file. Is that how most people make auto muling etc or how is it done? (I am new to scripting so I may just not know of some easy method) That's how I deal with it for now, not the best way but definitely works. Quote Link to comment Share on other sites More sharing options...
Vilius Posted May 7, 2018 Share Posted May 7, 2018 As @Alek said having multiple threads write/read one file would create a data race. You could setup a server which would communicate with the clients over sockets and such. This would eliminate that because a server could handle the data requests accordingly. 3 Quote Link to comment Share on other sites More sharing options...
MalikDz Posted May 7, 2018 Share Posted May 7, 2018 Client/server networking Clients (bots) send data to the server and according to the data received, server will send back directive for the client to execute. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 7, 2018 Share Posted May 7, 2018 30 minutes ago, Vilius said: As @Alek said having multiple threads write/read one file would create a data race. You could setup a server which would communicate with the clients over sockets and such. This would eliminate that because a server could handle the data requests accordingly. 19 minutes ago, MalikDz said: Client/server networking Clients (bots) send data to the server and according to the data received, server will send back directive for the client to execute. Can you actually allow socket permissions thru CLI? I know it's blocked by default 1 Quote Link to comment Share on other sites More sharing options...
Rudie Posted May 7, 2018 Share Posted May 7, 2018 (edited) 2 hours ago, FrostBug said: Can you actually allow socket permissions thru CLI? I know it's blocked by default Would like to know this aswell, I've tried it before but ran into the issue that it was blocked. Edited May 7, 2018 by Rudie Quote Link to comment Share on other sites More sharing options...
liverare Posted May 8, 2018 Share Posted May 8, 2018 It sort of depends on what you're communicating. If I had 10 bots all running on the same machine and I required them to communicate locally, then I'd do one of the following: In-game clan chat/direct messaging. This is the simplest method to implement which removes any other external dependencies (like hosting server). However, you risk exposing your entire bot network to JaGeX. Sockets and ports. This is by far the best method, because you can communicate on a local network and public network. However, I'm not sure OSBot enables this. External SQL servers. This is good if you have multiple networks that need a single place to communicate. However, you risk the server breaking and going offline, or being hacked. Flat-files per bot. Good if you need simple local communication only. However, race conditions (as @Alek mentioned) will be a problem. I'd probably go with flat files: Each bot would create a flat file. The bot that owns that file is the only bot permitted to write to said file. The bot has read-only permissions for the other bot's files. The bot would write communications in JSON format: [ { "when":3424310251234, "to":"someRandomUsername2", "from":"someRandomUsername1", "what":"Hi!" }, { "when":3424310276666, "to":"someRandomUsername2", "from":"someRandomUsername1", "what":"Awesome!" } ] Implement a file system listener to check for newly created/updated files, then require all (except the bot that created/updated the file) to read it. Quote Link to comment Share on other sites More sharing options...