Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug 3 message events from 2 messages

Joined
Jun 20, 2015
Messages
161
I'm using onMessageReceived() and there seems to be a bug where previous messages are re-detected in some situations. I just paused my bot and clicked on someone else's plant twice, and got two messages:

00:17:24 DEBUG Message received: This plant was planted by *****
00:17:24 DEBUG Somebody else planted in our area.
00:17:25 DEBUG Message received: This plant was planted by *****
00:17:25 DEBUG Somebody else planted in our area.

After unpausing, the bot triggered another message, which seems like it re-triggered the previous message event:

00:19:00 DEBUG Message received: It doesn't need watering now.
00:19:01 DEBUG Message received: This plant was planted by *****
00:19:01 DEBUG Somebody else planted in our area.

Here's the chatlog showing only two of the relevant messages when three were detected:

V3rHUIZ.png


@Party @Cloud
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
To be fair you had it paused and intervened, because we don't use injection we can only simulate event dispatching and it's far from easy to detect chat event changes since we have to look for where the difference in the list starts since there are 100 events max in the chat and the rest get removed, so we find the difference as to where it was previously compared to this time (not always easy when it's a lot of the same messages) and then from there we dispatch the events.
 
Top