Heiz Posted November 17, 2023 Share Posted November 17, 2023 Is there any way to transfer information between instances of scripts running by OsBot? I know it's a strange question, but the reason is this: I developed a script, for personal use, where my objective is to earn as many points as possible in a minigame. To do this, I would need to obtain information from the players who were on each team, in order to make calculations that would allow me to draw up routes to maximize the points on each account. Thanks Quote Link to comment Share on other sites More sharing options...
Alakazizam Posted November 17, 2023 Share Posted November 17, 2023 3 hours ago, Heiz said: Is there any way to transfer information between instances of scripts running by OsBot? I know it's a strange question, but the reason is this: I developed a script, for personal use, where my objective is to earn as many points as possible in a minigame. To do this, I would need to obtain information from the players who were on each team, in order to make calculations that would allow me to draw up routes to maximize the points on each account. Thanks I was trying to do something kind of like that a while back and I got some advice that was a bit over my head. Might help you out if you know more about this sort of thing though. Quote Link to comment Share on other sites More sharing options...
Heiz Posted November 17, 2023 Author Share Posted November 17, 2023 21 minutes ago, Alakazizam said: I was trying to do something kind of like that a while back and I got some advice that was a bit over my head. Might help you out if you know more about this sort of thing though. I was thinking about sockets but I chose to ask if there was any solution for this within the osbot API itself. Apparently there isn't, so I'll implement a socket anyway, thanks! 1 Quote Link to comment Share on other sites More sharing options...
yfoo Posted November 18, 2023 Share Posted November 18, 2023 (edited) Use Kafka? Probably too overkill + Extra dependency. I would write a separate Rest API that all your scripts can call to disseminate information to every other registerd script. Idea is very similar to how a listener works between classes. Don't forget authentication if this is not local. Your script would also need to expose an endpoint that this REST API would use. - POST: Register script instance Pass in your script instance's endpoint - POST: Broadcast message Broadcast whatever it is to all your script instances. Call the script's endpoint that was register before. - POST: Close server Tell all your scripts to shut up. Pretty much a chatroom. Edited November 18, 2023 by PayPalMeRSGP 1 Quote Link to comment Share on other sites More sharing options...
yfoo Posted November 18, 2023 Share Posted November 18, 2023 This is LMS isn't it. Since you want one bot instance to run to another and then kill each other to guarantee points. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted November 18, 2023 Share Posted November 18, 2023 14 hours ago, Heiz said: Is there any way to transfer information between instances of scripts running by OsBot? I know it's a strange question, but the reason is this: I developed a script, for personal use, where my objective is to earn as many points as possible in a minigame. To do this, I would need to obtain information from the players who were on each team, in order to make calculations that would allow me to draw up routes to maximize the points on each account. Thanks 1. Use a file to write data in and read in other instances (Same machine) 2. Use Sockets 3. Create a Rest application Some will be harder than others ^^ 1 Quote Link to comment Share on other sites More sharing options...
Heiz Posted November 18, 2023 Author Share Posted November 18, 2023 7 hours ago, PayPalMeRSGP said: This is LMS isn't it. Since you want one bot instance to run to another and then kill each other to guarantee points. Nah, it's much simpler than that! I would just like to get information on how many players there are on each Castle Wars team, because the team with the most players, I will win the game, to maximize the amount of tickets obtained 6 minutes ago, Khaleesi said: 1. Use a file to write data in and read in other instances (Same machine) 2. Use Sockets 3. Create a Rest application Some will be harder than others ^^ Omg, this file idea is extremely simple and can be very effective! I hadn't thought about that, thank you so much 1 Quote Link to comment Share on other sites More sharing options...
FushigiBot Posted November 18, 2023 Share Posted November 18, 2023 (edited) I'd use local files. Multiple files for each acc to avoid write/access problems and one main file where you put all the data. Edit: Nvm Khal suggested it already lol. Edited November 18, 2023 by FushigiBot 1 Quote Link to comment Share on other sites More sharing options...