kolton / d2bot-with-kolbot

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

Add Disconnected delay when using D2BotLead.dbj #1353

Open PoBErs opened 5 years ago

PoBErs commented 5 years ago

When using d2botlead.dbj when the bot tries to connect and get the "You were disconnected from Battle.net. Please Reconnect" it will turn off the bot. Is there a way to make it wait and start again like UnableToConnectDelay or RealmDownDelay? Can I add for example DisconnectedDelay in D2BotLead.dbj?

Edit: This is what I get in the d2bot "Login Error - Battle.net is not responding. Please try connecting again in a few minutes."

So what I realy would like it to do is instead of closing the bot/profile is to add a delay.

5noop commented 5 years ago

In D2BotLead there is a function locationAction with a switch case. You have to find which case corresponds to your event, it looks like it's case 10. There you search where "Login Error ..." is printed and below you add something like ControlAction.timeoutDelay("Login error", your_delay_in_second*1000);

ghost commented 5 years ago

In D2BotLead there is a function locationAction with a switch case. You have to find which case corresponds to your event, it looks like it's case 10. There you search where "Login Error ..." is printed and below you add something like ControlAction.timeoutDelay("Login error", your_delay_in_second*1000);

Would it be correct if it looked like this?

break MainSwitch;
        default:
            D2Bot.updateStatus("Login Error");
            D2Bot.printToConsole("Login Error - " + string);

            if (gameInfo.switchKeys) {
                ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
                D2Bot.restart(true);
            } else {
                ControlAction.timeoutDelay("Login error", 720 * 1000);
            }

            break;

If I want 720s delay then restart/retry instead of :

break;
        case getLocaleString(5347):
            D2Bot.updateStatus("Disconnected");
            D2Bot.printToConsole("Disconnected");
            ControlAction.click(6, 335, 412, 128, 35);

            break MainSwitch;
        default:
            D2Bot.updateStatus("Login Error");
            D2Bot.printToConsole("Login Error - " + string);

            if (gameInfo.switchKeys) {
                ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
                D2Bot.restart(true);
            } else {
                D2Bot.stop();
            }