musical instrument onload

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

musical instrument onload

#1 Post by kuripot » Sun May 13, 2012 4:05 am

Code: Select all

	function Boss_buff()

	if Magic_Tambourine == true then
		if inventory:itemTotalCount(204463) >= 1 then
			inventory:useItem(204463) -- 3 days
			yrest(5500)
		elseif inventory:itemTotalCount(204571) >= 1 then
			inventory:useItem(204571) -- 7 days
			yrest(5500)
		elseif inventory:itemTotalCount(206420) >= 1 then
			inventory:useItem(206420) -- 30 days
			yrest(5500)
		end
		elseif Magic_Tambourine == party_true then
			yrest(5500)
		end
	if Magic_Guitar == true then
		if inventory:itemTotalCount(204461) >= 1 then
			inventory:useItem(204461) -- 3 days
			yrest(5500)
		elseif inventory:itemTotalCount(206418) >= 1 then
			inventory:useItem(206418) -- 7 days
			yrest(5500)
		elseif inventory:itemTotalCount(204569) >= 1 then
			inventory:useItem(204569) -- 30 days
			yrest(5500)
		end
		elseif Magic_Tambourine == party_true then
			yrest(5500)
		end
		changeProfileSkill("MAGE_FLAME", "AutoUse", true);
		changeProfileSkill("MAGE_FIREBALL", "AutoUse", true);
		changeProfileSkill("MAGE_FLAME", "Priority", 90);
		changeProfileSkill("MAGE_FIREBALL", "Priority", 100);
		player:cast("MAGE_ESSENCE_OF_MAGIC");
		player:cast("PRIEST_MAGIC_BARRIER");
		player:cast("MAGE_ENERGY_INFLUX");
		player:cast("MAGE_ELECTROSTATIC_CHARGE");
		player:cast("MAGE_INTENSIFICATION");
		player:cast("MAGE_ELEMENTAL_CATALYSIS");
		player:cast("PRIEST_REGENERATE");
	end
this onload for mage/priest are working... but my question is how to ignore the instrument if instrument are in cooldown stage?? because time consuming when he try to cast instrument even this is in cooldown stage

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: musical instrument onload

#2 Post by rock5 » Sun May 13, 2012 4:33 am

You could use GetBagItemCooldown
http://www.theromwiki.com/API:GetBagItemCooldown
In the bot it would look something like this

Code: Select all

local maxCD, CurrentCD = RoMScript("GetBagItemCooldown(".. (item.SlotNumber - 60) ..")")
That's after you've found the item you want to check the cooldown of.
  • 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

srknszgn
Posts: 1
Joined: Tue Aug 11, 2015 11:20 am

Re: musical instrument onload

#3 Post by srknszgn » Tue Aug 11, 2015 11:24 am

where will be written. Please details. my English is bad

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: musical instrument onload

#4 Post by lisa » Tue Aug 11, 2015 11:24 pm

instead of a yrest(5500) do a small yrest(500) and then do a loop waiting for cast bar to finish.

Code: Select all

yrest(500)
while (player.Casting) do
player:updateCasting()
yrest(500)
end
If the cast bar hasn't started yet then it won't wait, so you might need to increase the first yrest(500) until it works 100%

Code: Select all

yrest(800)
while (player.Casting) do
player:updateCasting()
yrest(500)
end
Since you will use the code a few times make a local function for it, so it's easier to use and edit =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: musical instrument onload

#5 Post by lisa » Fri Aug 14, 2015 9:02 pm

I use this in one of my profiles for bossbuff

Code: Select all

	function BossBuff()
		local starttime = getTime()
		yrest(5000)
		
		-- use instrument 206420 30 day tambo
		inventory:useItem(206420)
		yrest(800)
		while (player.Casting) do
			player:updateCasting()
			yrest(500)
		end
		
		-- rest until fight starts or 15 seconds after timer started, I use 20 second timer
		repeat
			player:updateBattling()
			yrest(500)
		until deltaTime(getTime(),starttime) >= 15000 or player.Battling
		
		player:cast("WARDEN_SAVAGE_POWER");
		player:cast("SCOUT_ARROW_OF_ESSENCE");
		player:cast("SCOUT_BLOOD_ARROW");	
	end
Just to give you an example of timing and such.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests