Help with looping an action ever x seconds

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
slick2175
Posts: 3
Joined: Fri Dec 24, 2010 1:09 am

Help with looping an action ever x seconds

#1 Post by slick2175 »

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
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: Help with looping an action ever x seconds

#2 Post by Administrator »

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>
slick2175
Posts: 3
Joined: Fri Dec 24, 2010 1:09 am

Re: Help with looping an action ever x seconds

#3 Post by slick2175 »

FIXED didnt realize its case sensitive.
slick2175
Posts: 3
Joined: Fri Dec 24, 2010 1:09 am

Re: Help with looping an action ever x seconds

#4 Post by slick2175 »

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.
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: Help with looping an action ever x seconds

#5 Post by Administrator »

Then just remove the while loop.
Post Reply