Hello.
Please, be careful about which forum/section you are posting. You are using Kasteria OTBot but posted in the Classitibia Bot section. Bots can have specific functions that don't exist in the other, so I could spend time developing the script for bot X using functions that only exist in it but would not be useful, because you need to use it in bot Y.[/b]
Pause Bot pauses everything, including Persistents except those that you disable "Pause on Pause Bot?".
Pausing Bot while a GM is trying to block you will not stop you from being banished. In fact, this is more likely to prove you're a botter. xD
Maybe would be better to just play sound/flash instead of pause bot OR also say a message instead of just pausing bot.
1. If you just wanna check how long you are standing still on sqm sqm then use Alerts -> Stand Time. Then use a Persistent to check for how long Bot is paused and unpause it.
2. If you wanna check if you Bot stucked while trying to reach a waypoint then use Cavebot -> Unreachable Skip -> Play Sound & Flash client or "Pause Bot". Then use a Persistent to check for how long Bot is paused and unpause it.
3. A combination of both, check for message "there is no way" and if you are standing still on sqm sqm for more than 10s. That doesn't means this will trigger only if you are actually standing on sqm due to being trapped or so, for example: you stand on same sqm attacking and looting multiple creatures for 12 seconds then after killing all of it, bot tries to walk and receives "There is no way" then the script will be triggered. I recommend you to test it before leaving it afk.
local StuckTime = 10000 -- In milliseconds. How long standing in same sqm?
if statusmessage() == 'There is no way.' and standtime() >= StuckTime then
playsound('default')
flashclient()
end
An alternative to the script above, which also sends messages but only triggers if the script didn't been triggered in last X milliseconds to avoid spamming message or so.
local Messages = { '?', 'sup?', '??', 'hello?' } -- Random messages to say.
local StuckTime = 10000 -- In milliseconds. How long standing in same sqm?
local TriggerTime = 10000 -- In milliseconds. How long since last time script was triggered? Only triggers if the script didn't been triggered in last X milliseconds to avoid spamming message or so.
if statusmessage() == 'There is no way.' and standtime() >= StuckTime and (LAST_TRIGGER_TIME == nil or (runningtimems() - LAST_TRIGGER_TIME) >= TriggerTime) then
pausebot(true)
say(random(1, #Messages))
playsound('default')
flashclient()
LAST_TRIGGER_TIME = runningtimems()
end