Hope i'm in the right place.
So, I try so hard to build my macro to place my firewall ... I didn't find any workaround :/
here is my macro.txt
Code: Select all
automacro castFW { #name of the macro
timeout 10 #I want to run it once by monster
exclusive 1 #override AI
monster Pupa, #on monster pupa ( xD yeah i'm testing) add "< 9" see edit
call useFW #run the macro called "useFW"
}
macro useFW { #The macro called and its actions
$px = @arg ("$.pos", 1) #get char position X
$py = @arg ("$.pos", 2) #get char position Y
$mx = @arg ("$.lastMonsterPos", 1) #get monster position X
$my = @arg ("$.lastMonsterPos", 2) #get monster position Y
$distance = 6 #The distance from the monster => deleted see edit
$ThisX = @eval($mx-$distance) #calculate the position coordinate from the monster X => deleted see edit
$ThisY = @eval($my-$distance) #calculate the position coordinate from the monster Y => deleted see edit
$CurrentMap = @arg ("$.map", 1) #In the current map => deleted see edit
do move $ThisX $ThisY $CurrentMap #move on those coordinates in this map => deleted see edit
$Xzone = @eval(($px+$mx)/2) #here is the first problem ... some coordinates result on decimals... how can I cut them ? please => fixed with int see edit
$Yzone = @eval(($py+$my)/2) #same here => fixed with int see edit
do sl 18 $Xzone $Yzone 10 #Cast firewall lvl 10 on those middle coordinates
}
and my config.txt
Code: Select all
automacro castFW { #name of the macro
timeout 10 #I want to run it once by monster
exclusive 1 #override AI
monster Pupa, #on monster pupa ( xD yeah i'm testing) add "< 9" see edit
call useFW #run the macro called "useFW"
}
1)how to use integer position and round doubles one ?
2)When I move using "move X Y map" when AI is On it doesn't move. WHen I toggle to manual it moves avery 10 seconds (timeout value).
I don't know what to do
What can I do to make this work correctly, and is there any improvement to do :/ ? thx if you help me
Edit :
For the question 1 I searched again ... during the whole night. I tried many things, I tried whithout luck with int... But I was not doing it right. Then regexp etc ... this was not working at all . So I fixed this... so much fails for 3 letters : int. This is the way to round a meadian position :
Code: Select all
$Xzone = @eval(int(($px+$mx)/2))
$Yzone = @eval(int(($py+$my)/2))
monster Pupa < 9
in your macro.txt
Now it remains this question :
How to trigger this macro 1 time only (use-once ?)
and re-enable it (release ?)
1 - when the fire wall dies,
or
2 - when the $.lastmonster dies,
or
3 - if I target a new monster. (wolf 1 to wolf 2, or wolf to argos ...)
Please guys, some help a bit if you have any idea. It would be nice ^^