After a few hours of failing at this figured id come here and maybe get some insight..
I could careless if its done with an ingame macro or if its somehting that starts when the bot loads..
What im looking for is for every 5 seconds for the bot to target pet, assist pet, and attack
What I had in game with macro was
/run TargetUnit("pet")
/run AssistUnit("pet")
/run UseAction(1) -- Reg Attack
/wait 1
/script if UnitHealth("player") > 0 then UseAction(7); end; -- I figured id run a if statement to check if my hp is greater then 0 to keep using action 7 which is where the macro is set on the actionbar.
I just cant get it to loop. If i manually press it, it works but it wont loop. Any help be much appreicated
Help with looping an action ever x seconds
- Administrator
- Site Admin
- Posts: 5353
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Help with looping an action ever x seconds
Use a waypoint script.
Code: Select all
<onLoad>
function myTimedEvent()
-- do stuff here.
RoMScript("TargetUnit('pet')");
RoMScript("AssistUnit('pet')");
RomScript("UseAction(1)");
end
registerTimer("whatever_you_want", secondsToTimer(5), myTimedEvent);
while(true) do
yrest(1);
end
</onLoad>
Re: Help with looping an action ever x seconds
FIXED didnt realize its case sensitive.
Re: Help with looping an action ever x seconds
Hrm well i guess it did for what I asked.. Lol but not what i wanted.
Now its just in a constant loop of assisting the pet and not going to waypoints, Just wanted it to check to see if my pet was still fighting anything every 5-10 seconds and assist it instead of moving on to the next waypoint of monster.
I tried to have it only run at each waypoint but I got an error of nil, im assuming its because the pet had no target and the bot shuts down.
Now its just in a constant loop of assisting the pet and not going to waypoints, Just wanted it to check to see if my pet was still fighting anything every 5-10 seconds and assist it instead of moving on to the next waypoint of monster.
I tried to have it only run at each waypoint but I got an error of nil, im assuming its because the pet had no target and the bot shuts down.
- Administrator
- Site Admin
- Posts: 5353
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Help with looping an action ever x seconds
Then just remove the while loop.