How to skip a script in-game

For example., if something is already done, I would like to hit a button (in game), that allows me to skip the current script it is running and to go to the next one. that way if I do not hit the button it will run the script.

Unfortunately you can’t do that without a lot of edits.

kolbot was written in other way than d2nt. The boss/area named “scripts” are in fact only Javascript functions.
Usually a script in Javascript begins with:

function main() {
...
}

And if you are looking for togglePause function, you’ll find it in lines 143-171 of ToolsThread.js.
from line 145 you’ll see the running scripts which will be paused/resumed:

scripts = ["default.dbj", "tools/townchicken.js", "tools/antihostile.js", "tools/party.js", "tools/rushthread.js"];

The only way to skip a boss/area script (function) for an automated bot is to pause it (Pause/Break key).
Move the char in other area (or in town) and resume the script. You’ll get an error and the bot should move to the next script. Note that too many errors can bring the end of the game.

Previous scripts on the current run can be accessed only if you pause the bot and edit the config file, then reload the config using chat/console typing https://github.com/blizzhackers/documentation/blob/master/kolbot/Hotkeys.md#d2bs-core-commands.
Otherwise the edited char config will be loaded on next run.

Doesn’t the pause make the bot crash fairly quickly? or is that when I do .stop I know I had tried in the past and within a few seconds it crashes, cause I don’t want that.

Also I appreciate how prompt and often you respond to threads :slight_smile:.

/e I figured it out thanks sir I guess there is a pause break that you can do I thought .stop was the same thing. Thank you

Sorry to revive an old post, but this is the only post I could locate that resembled my question.

I would like to pause the bot (to do a look around, or play, or whatever without stopping and "crashing’ the game.
I tried hitting the pause break button and nothing happens. Is there a way to pause the bot without closing the game?

Pause/break key is defined in https://github.com/kolton/d2bot-with-kolbot/blob/master/d2bs/kolbot/tools/ToolsThread.js#L352-L355

it should work as intended, if your files haven’t any bug. Try to revert the ToolsThread.js.
Always use tortoiseSVN or other method to download d2bot-with-lolbot and keep it updated.

As a note for skipping a script, you could customize your own key in the ToolsThread.js, which can have the going to town, like

		case 145: // Screen Lock
			Town.goToTown();

			break;

so finally you’ll have to press this key sequence < Pause/Break > - < Scr LK > - < Pause/Break >

great, thank you.
As for the pause/brk issue, my keyboard don’t have those keys (its got the pause/play for video but that wasn’t working) so I just bought a new KB and it works as intended. Thank you

these default set keys can be changed, but you should avoid to set the same key for many functions, so check https://github.com/blizzhackers/documentation/blob/master/kolbot/Hotkeys.md/#changing-the-default-keys

OK, issue seems to still be an issue.
I have the keys set and I can see from the screen that it is “pausing” but its not stopping, the char keeps heading in its own direction. After about 15 seconds of fighting with char to go where I want it to go, it gets a crash error “failed to go to town” but this happens while im IN town…

What other changes did you add to the ToolsThread.js ?
use pastebin.com , and here post the link to it.

none, I left it as default since I bought a new keyboard.
Ill try to explain better what is happening.
Bot is clearing an area. He goes into town (i think to buy jugs) I hit pause… it say “pausing” yet he is still heading back to portal to return to fight. when I hit pause a 2nd time, it says resuming and lag becomes extreme. I hit pause a 3rd time and it crashes.
However if I catch him at the beginning of the script (before he starts) it pauses no issues.

This is because kolbot already pauses your script when you go to town for potions (or with TownHP / TownMP). So if you hit pause at that moment, it will actually restart the current script which assumes you are still in the fighting area and not in town. Incidentally the thread townchicken would still be running so various errors can arise.

TL;DR to be safe don’t hit pause when your bot goes to town in the middle of a script