check if the bot is stuck macro

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Message
Author
kamirie
Plain Yogurt
Plain Yogurt
Posts: 96
Joined: 22 Jul 2009, 23:19
Noob?: Yes

check if the bot is stuck macro

#1 Post 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
}

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: check if the bot is stuck macro

#2 Post 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:

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: check if the bot is stuck macro

#3 Post by SkylorD »

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

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: check if the bot is stuck macro

#4 Post 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? :?

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

kamirie
Plain Yogurt
Plain Yogurt
Posts: 96
Joined: 22 Jul 2009, 23:19
Noob?: Yes

Re: check if the bot is stuck macro

#5 Post 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

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: check if the bot is stuck macro

#6 Post by fadreus »

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

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

kamirie
Plain Yogurt
Plain Yogurt
Posts: 96
Joined: 22 Jul 2009, 23:19
Noob?: Yes

Re: check if the bot is stuck macro

#7 Post 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
}

kamirie
Plain Yogurt
Plain Yogurt
Posts: 96
Joined: 22 Jul 2009, 23:19
Noob?: Yes

Re: check if the bot is stuck macro

#8 Post 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.

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: check if the bot is stuck macro

#9 Post 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.

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

kamirie
Plain Yogurt
Plain Yogurt
Posts: 96
Joined: 22 Jul 2009, 23:19
Noob?: Yes

Re: check if the bot is stuck macro

#10 Post 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
}

Post Reply