Banker 175 Share Posted October 14, 2016 Okay so with my current script, i have come across an issue where if 2 commands are send at once (or very little time apart), the bot will simply ignore them. Is there a way i can queue the commands? I was thinking that maybe add the command to an array then remove it after it has been completed and then move on, wondering if there is any more efficient way to do this. Any help/suggestions is appreciated. Thanks. Link to comment Share on other sites More sharing options...
Hashtag 8692 Share Posted October 14, 2016 I would use a list here. Link to comment Share on other sites More sharing options...
slasso 27 Share Posted October 14, 2016 It will ignore them? As is not hit the onMessage() for either message? Link to comment Share on other sites More sharing options...
Banker 175 Author Share Posted October 14, 2016 It will ignore them? As is not hit the onMessage() for either message? Nope, it just doesnt type anything, then if i send another command on its own, it will do it as normal. It acts as though there wasnt even a command send if 2 are sent at same time :/ Link to comment Share on other sites More sharing options...
slasso 27 Share Posted October 14, 2016 Nope, it just doesnt type anything, then if i send another command on its own, it will do it as normal. It acts as though there wasnt even a command send if 2 are sent at same time :/ Are you using the AdvancedMessageListener Link to comment Share on other sites More sharing options...
Banker 175 Author Share Posted October 14, 2016 Are you using the AdvancedMessageListener Yep, and its all in the onClanMessage(Message msg) {} Link to comment Share on other sites More sharing options...
Mad 86 Share Posted October 15, 2016 Yep, and its all in the onClanMessage(Message msg) {} It probably doesn't poll fast enough to see both messages, you may have to implement your own. Link to comment Share on other sites More sharing options...
Banker 175 Author Share Posted October 16, 2016 It probably doesn't poll fast enough to see both messages, you may have to implement your own. I was thinking of using ArrayList then just adding each message thats a command, then removing it as it is completed/executed. Link to comment Share on other sites More sharing options...
Mad 86 Share Posted October 17, 2016 I was thinking of using ArrayList then just adding each message thats a command, then removing it as it is completed/executed. You can, a map would be better though so you can identify the message by the key to prevent duplicates Link to comment Share on other sites More sharing options...
Banker 175 Author Share Posted October 17, 2016 You can, a map would be better though so you can identify the message by the key to prevent duplicates Ah okay thanks, ill look into it when i get working on it again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.