Wait for cooldown

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Wait for cooldown

#1 Post by kanta »

I've been searching around but haven't been able to find anything in reference to an idea I would like to try in my waypoint file.

Right now, in my KS farming waypoint, I have it waiting for a random amount of time (player:restrnd) before entering combat with a boss so that my Arrow of Essence (5 minute cooldown) is ready before I continue. The time varies greatly due to how quickly the previous boss was killed and how long it takes to get to the next boss. Is there a command I can use that will make my character wait at a specific waypoint until a cooldown has ended?

Such as

if skill_cooldown == 0 then
player:findTarget("Goddess of Art's Disciple");

thanks in advance
Scout/Knight/Rogue 70/66/66
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Wait for cooldown

#2 Post by rock5 »

Probably the easiest way would be to use the ingame function GetSkillCooldown.

Code: Select all

local cooldown, remaining = RoMScript("GetSkillCooldown(4,1)")
And then rest the remaining time.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Wait for cooldown

#3 Post by kanta »

Wow, ok, didn't expect such a quick reply. I'll have to try this tomorrow, getting ready to sleep for work tomorrow. Thanks Rock :)
Scout/Knight/Rogue 70/66/66
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Wait for cooldown

#4 Post by kanta »

Well, I couldn't figure out how to make it rest the remaining time so this is what I did:

Code: Select all

	<!-- #125 --><waypoint x="2365" z="4909" y="340">
			local cooldown, remaining = RoMScript("GetSkillCooldown(4,1);")
				if remaining > 1 then
					__WPL:setWaypointIndex(125);
				else
					__WPL:setWaypointIndex(126);
               end;
	</waypoint>
**EDIT**
changed code to:

Code: Select all

			local cooldown, remaining = RoMScript("GetSkillCooldown(4,1);")
				while remaining > 1 do
					player:restrnd(101, 5, 10);
        end;
**EDIT #2**
Scratch that last code change.... It doesn't come out of the loop.
Scout/Knight/Rogue 70/66/66
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Wait for cooldown

#5 Post by rock5 »

I would have just done

Code: Select all

player:rest(remaining)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Wait for cooldown

#6 Post by kanta »

Once again, you have my gratitude Rock.

See, I didn't know that was even possible. I'm completely new to this scripting. All I know is the information I can find floating around and much of what can be done is not documented, or at least not easily searchable. The examples given for most commands are pretty vague and rely on people knowing how to script in the first place. I rely mainly on scripts I can find and reverse engineer. But since most people do not share any scripts of worth, even that avenue of learning is severely lacking.
Scout/Knight/Rogue 70/66/66
Post Reply