kolton / d2bot-with-kolbot

d2bot game manager by D3STROY3R with kolbot libs by kolton for d2bs
346 stars 334 forks source link

How to leave the game if no one invites me. #3096

Open Samael36 opened 3 years ago

Samael36 commented 3 years ago

Issue with D2BotPubJoin.dbj in chaos & baal games if:

  1. Game is old/empty
  2. Game is full, but no party invitation
  3. Everyone suddenly quits/chickens during chaos or before Baal.

Results vary:

  1. Bot stalls in the game until Config.MaxGameTime is reached.
  2. Bot continues the run alone.

What I'd like to set up:

  1. Quit if no party request within 5 seconds. (Something like Config.DiabloHelper.Wait, but faster)
  2. Quit within 5 seconds if out of party.
Samael36 commented 3 years ago

Solution found for problem 1. and 3. Added this command at specific locations in the script:

if (Misc.getPlayerCount() <= 3) { throw new Error("Empty game"); // Alone in game return false; // End script }

Tried this to fix problem number 2 with:

if (!getParty()) { scriptBroadcast("quit"); }

But doesn't work...