need help with onskill cast and with buff table

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Romplayer
Posts: 120
Joined: Wed Jan 11, 2012 10:07 am

need help with onskill cast and with buff table

#1 Post by Romplayer » Wed May 08, 2013 4:35 am

Code: Select all

	<onSkillCast><![CDATA[
		local ii = 1
		while player.Buffs[ii] ~= nil do
			buf = player.Buffs[ii]
			if buf == "621252" then
				player:cast("WARLOCK_PSYCHIC_ARROWS");
				player:cast("WARLOCK_PSYCHIC_ARROWS");
				player:cast("WARLOCK_PSYCHIC_ARROWS");
				player:cast("WARLOCK_PSYCHIC_ARROWS");
				player:cast("WARLOCK_PSYCHIC_ARROWS");
			end
			ii = ii+1
		end
	]]></onSkillCast>
This doesn't seem to work. I'm not sure how the player.Buffs table is setup either. But I am trying to cast a spell a bunch of times if a certain buff gets applied to my character. Would a for statement do better?

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

Re: need help with onskill cast and with buff table

#2 Post by rock5 » Wed May 08, 2013 5:16 am

Buffs are saved as table values about that buff, eg. name, id, etc. So "buf" will never equal the id of the buff, but buf.Id will. buf.Id is a number, though, not a string, so this should work

Code: Select all

if buf.Id == 621252 then
Note, though, that this code will run after every skill cast, even when not in combat. You might want to add extra checks such as if in combat.

If you are interested in the buffs table structure you can start the commandline and type the following

Code: Select all

table.print(player.Buffs)
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests