Openkore.com
http://forums.openkore.com/

check if the bot is stuck macro
http://forums.openkore.com/viewtopic.php?f=32&t=212778
Page 1 of 2

Author:  kamirie [ 23 Sep 2018, 20:31 ]
Post subject:  check if the bot is stuck macro

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:
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
}

Author:  fadreus [ 23 Sep 2018, 22:24 ]
Post subject:  Re: check if the bot is stuck macro

Code:
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:
$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:

Author:  SkylorD [ 24 Sep 2018, 02:27 ]
Post subject:  Re: check if the bot is stuck macro

eval $char->{isIdle} something this way.

Author:  fadreus [ 24 Sep 2018, 02:50 ]
Post subject:  Re: check if the bot is stuck macro

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? :?

Author:  kamirie [ 24 Sep 2018, 20:45 ]
Post subject:  Re: check if the bot is stuck macro

SkylorD wrote:
eval $char->{isIdle} something this way.


Can I specify the number of secs ? I'm not quiet familiar yet with eventMacros . .Thanks

Author:  fadreus [ 24 Sep 2018, 21:46 ]
Post subject:  Re: check if the bot is stuck macro

eventMacro just like macro.
eventMacro is rework of macro.
Most of it is similar.

Author:  kamirie [ 24 Sep 2018, 22:04 ]
Post subject:  Re: check if the bot is stuck macro

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:
automacro idle {
InLockMap 1
call {
commands
}
timeout 5
}

Author:  kamirie [ 25 Sep 2018, 02:13 ]
Post subject:  Re: check if the bot is stuck macro

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.

Author:  fadreus [ 25 Sep 2018, 02:26 ]
Post subject:  Re: check if the bot is stuck macro

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.

Author:  kamirie [ 25 Sep 2018, 02:37 ]
Post subject:  Re: check if the bot is stuck macro

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:
automacro warpcancel {
location $lockmap
console /Warp Portal/i
call {
do warp cancel
}
timeout 3
}

Page 1 of 2 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/