Page 1 of 2

check if the bot is stuck macro

Posted: 23 Sep 2018, 20:31
by kamirie
Good Day,
I always encounter the issue of being stuck while handling ranged monsters. The bot will try to attack but stay's in the same spot then after some time it will be stuck and cannot use any skill. I want to create a macro to check it's position every 5 secs and if the position is the same 5-10 secs ago , it will do a manual move like north , east , south or west . I can use the $.pos

Code: Select all

automacro checkpos {
not location town1,town2,town3
location $lockmap <-- I have a macro the changes the lockmap via console conf
timeout 5
call movepos
}

macro movepos{
$oldpos = $.pos <-- I'm not preety sure how this line will respond , if it saves the current position every 5 secs
if ( $oldpos == $.pos) call move
}

macro move{
$dir = @rand (1,4)
if ($dir == 1) do north
if ($dir == 2) do south 
if ($dir == 3) do east 
if ($dir == 4) do west
}

Re: check if the bot is stuck macro

Posted: 23 Sep 2018, 22:24
by fadreus

Code: Select all

attackCheckLOS
How about this?
or reduce time to drop if can't reach target in timouts.txt?
Then increase time to retry to attack same monster so it will search for other monster?
teleport when dropping target?
kamirie wrote:macro movepos{
$oldpos = $.pos <-- I'm not preety sure how this line will respond , if it saves the current position every 5 secs
if ( $oldpos == $.pos) call move
}
You need to run 2 check;

Example

Code: Select all

$OldPos = $.pos
$NewPos = $.pos

if ($OldPos == $NewPos) then move
Much more simple solution is eventMacro with checkconfigkey.
Just add in config Pos1 and Pos2
Run eventmacro check if config key Pos1 equal Pos2.

Though I didn't try this kind of stuff yet coz I'm too lazy to use eventMacro :lol:

Re: check if the bot is stuck macro

Posted: 24 Sep 2018, 02:27
by SkylorD
eval $char->{isIdle} something this way.

Re: check if the bot is stuck macro

Posted: 24 Sep 2018, 02:50
by fadreus
SkylorD wrote:eval $char->{isIdle} something this way.
I thought he meant the bot is attempt to attack monster but stuck.
So it would be on route,attacking instead of idle.. am I wrong? :?

Re: check if the bot is stuck macro

Posted: 24 Sep 2018, 20:45
by kamirie
SkylorD wrote:eval $char->{isIdle} something this way.
Can I specify the number of secs ? I'm not quiet familiar yet with eventMacros . .Thanks

Re: check if the bot is stuck macro

Posted: 24 Sep 2018, 21:46
by fadreus
eventMacro just like macro.
eventMacro is rework of macro.
Most of it is similar.

Re: check if the bot is stuck macro

Posted: 24 Sep 2018, 22:04
by kamirie
fadreus wrote:eventMacro just like macro.
eventMacro is rework of macro.
Most of it is similar.
Yes, Yes ,
eval $char->{isIdle} < where do i insert this line with 5 secs check?

Code: Select all

automacro idle {
InLockMap 1
call { 
commands
}
timeout 5
}

Re: check if the bot is stuck macro

Posted: 25 Sep 2018, 02:13
by kamirie
I think I know why my bot is getting stuck. It's when being mobbed and casting teleport skill , it will initialize the casting but "figuratively" sticks at finishing the teleport , like having the teleport prompt waiting to press enter in-game.

Re: check if the bot is stuck macro

Posted: 25 Sep 2018, 02:26
by fadreus
kamirie wrote:I think I know why my bot is getting stuck. It's when being mobbed and casting teleport skill , it will initialize the casting but "figuratively" sticks at finishing the teleport , like having the teleport prompt waiting to press enter in-game.

Simply use macro warp cancel for that.

Re: check if the bot is stuck macro

Posted: 25 Sep 2018, 02:37
by kamirie
fadreus wrote:
kamirie wrote:I think I know why my bot is getting stuck. It's when being mobbed and casting teleport skill , it will initialize the casting but "figuratively" sticks at finishing the teleport , like having the teleport prompt waiting to press enter in-game.

Simply use macro warp cancel for that.
Like this?

Code: Select all

automacro warpcancel {
location $lockmap
console /Warp Portal/i 
call {
do warp cancel
}
timeout 3
}