thomas-crane / famebot

A bot for Realm of the Mad God designed to automate the process of collecting fame.
MIT License
19 stars 12 forks source link

When realm closes and the bot is waiting to get into the realm, it won't search for another one #10

Closed Azukee closed 7 years ago

Azukee commented 7 years ago

/title

thomas-crane commented 7 years ago

I thought this was fixed when I added

if(!portals.Exists(ptl => ptl.ObjectId == portalId))
{
        MoveToRealms(client);
        return;
}

To the attempt connection method, but I also had this problem last night. Any ideas?

moistmaster commented 7 years ago

hmm could you make it disconnect you so it walks back up on an interval

Azukee commented 7 years ago

I'll be looking into fixing this if a fix hasn't been found yet, now that I have got a week off.

thomas-crane commented 7 years ago

Thanks @AzukiMPGH. There is still no fix but I think the problem might be that when a portal disappears it doesn't actually get removed from the portals list and so the code in my earlier comment actually never runs.

Azukee commented 7 years ago

I guess a cheap fix for this then would be to clear the portals array at the start of the OnUpdate method devenv_2017-04-18_23-15-53

thomas-crane commented 7 years ago

Fixed. See commit ef2b79c54a48cc10494e113b28d8c90ecf7e3636 for details. MoveToRealms(...) only works if gotoRealm is true, but after MoveToRealms(...) exits gotoRealm is set to false. Setting gotoRealm to true before calling MoveToRealms(...) from AttemptConnection(...) fixed this.