Jump to content
Sign in to follow this  
hdnine

[SOLVED] Are there a similar addon/macro to castSequence()?

Recommended Posts

As  a priest i wanted to cast my buffs in the easiest possible way, hope fully with only one button. I read about the castSequence() function which apparently was introduced in BC (?) where you can set up a sequence of spells you want to cast and the press the same key over and over. Would this be possible?

EDIT:
With SuperMacro i managed to code a piece that works:

/run b=buffed;c=cast;s1="Power Word: Fortitude";s2="Inner Fire";s3="Touch of Weakness";if UnitIsFriend("player","target") then c(s1);else if not b(s1) then c(s1);else if not b(s2) then c(s2);else if not b(s3) then c(s3);end;end;end;end;

 

Edited by hdnine

Share this post


Link to post
Share on other sites

The Supermacro MOD has the ability to do what you're after. It has a function called DoOrder(). It "does" the first entry in the list and skips the rest. Subsequent executions will cast the next entry if the first is unavailable, on cool down or otherwise fails for some reason. You can include match conditions as well like...

/script DoOrder( not FindBuff("mark") and "mark of the wild" or "", not FindBuff("thorns") and "thorns" or "" )

 

 

Share this post


Link to post
Share on other sites

castSequence() like thingy is not possible in vanilla - actions needs a user input (keyboard, mouse etc)

Share this post


Link to post
Share on other sites

Ok, i couldn't get DoOrder() to work but i wrote this little piece of code that seems to do the job with the added bonus that you also can buff friendlies with PW:F. Take note that this code do require SuperMacro to function.

/run b=buffed;c=cast;b1="Power Word: Fortitude";b2="Inner Fire";b3="Touch of Weakness";if not b(b1) then c(b1);else if not b(b2) then c(b2);else if not b(b3) then c(b3);end;end;end;

SuperMacro seems a bit tricky since there are no instructions anywhere and when i first ran the code it didn't work for some reason. Now it does so go figure?

EDIT: Need to rethink this one. I was able to buff a few friendlies but now it has stopped working again for some reason? Can only buff myself. :/

EDIT 2: Ok, it works on friendlies if i am myself not buffed with PW:F, but not if i have it on me. So the script only checks my active buffs apparently.

EDIT 3 (final?):
So finally got it to work with a UnitIsFriend() check:

/run b=buffed;c=cast;s1="Power Word: Fortitude";s2="Inner Fire";s3="Touch of Weakness";if UnitIsFriend("player","target") then c(s1);else if not b(s1) then c(s1);else if not b(s2) then c(s2);else if not b(s3) then c(s3);end;end;end;end;

Edited by hdnine

Share this post


Link to post
Share on other sites

There is a functions.txt in the addons directory. it's a "user guide" of sorts.

Here are some of my priest SM functions. In coming wall of txt.

-- Cast SWP if it's not already on the target
/script UIErrorsFrame:Hide()
/script if not buffed("Shadow Word: Pain", 'target') then CastSpellByName("Shadow Word: Pain") end

-- Don't double up on Renew
/script UIErrorsFrame:Hide()
/script if UnitExists("target") and UnitIsFriend("target", "player") then if not buffed("Renew", 'target') then CastSpellByName("Renew") end return end if not buffed("Renew", 'player') then cast("Renew",1) end

-- Self-Buffs:
/script if not buffed("Power Word: Fortitude", 'player') then CastSpellByName("Power Word: Fortitude",1) end;end

-- Rotation:
/script UIErrorsFrame:Hide()
/script if not buffed("Shadow Word: Pain", 'target') then CastSpellByName("Shadow Word: Pain") end DoOrder("Mind Blast", "Smite") SM_Channel("mind flay")

-- Mashable Wand Cast
/script UIErrorsFrame:Hide()
/script if (UnitName('target')==nil) then TargetNearestEnemy() else if not IsAutoRepeatAction(12) then CastSpellByName("Shoot") end;end

-- Instant Casts
/script UIErrorsFrame:Hide()
/script SpellStopCasting()
/script CastSpellByName("Desperate Prayer",1)

/script UIErrorsFrame:Hide()
/script SpellStopCasting()
/script CastSpellByName("Fade",1)

/script UIErrorsFrame:Hide()
/script SpellStopCasting()
/script CastSpellByName("Power Word: Shield",1)

-- Self-heal if no target
/script UIErrorsFrame:Hide()
/script SpellStopCasting()
/script if UnitExists("target") and UnitIsFriend("target", "player") then CastSpellByName("Lesser Heal") else CastSpellByName("Lesser Heal",1) end

/script UIErrorsFrame:Hide()
/script SpellStopCasting()
/script if UnitExists("target") and UnitIsFriend("target", "player") then CastSpellByName("Heal") else CastSpellByName("Heal",1) end

/script UIErrorsFrame:Hide()
/script SpellStopCasting()
/script if UnitExists("target") and UnitIsFriend("target", "player") then CastSpellByName("Flash Heal") else CastSpellByName("Flash Heal",1) end

-- Buff target based on level (You have to alter the spell name according to the spell you want to cast and change i=6 by the number of ranks you currently have for that spell)
/script a="Power Word: Fortitude" b={1,2,14,26,38,50} c="target" d="(Rank " e=CastSpellByName if (UnitLevel(c) ~= nil and UnitIsFriend("player",c)) then for i=3,1,-1 do if (UnitLevel(c) >= b[i]) then e(a..d..i..")") return end end else e(a,1) end

/script a="Renew" b={1,2,10,16,22,28,34,40,46} c="target" d="(Rank " e=CastSpellByName if (UnitLevel(c) ~= nil and UnitIsFriend("player",c)) then for i=3,1,-1 do if (UnitLevel(c) >= b[i]) then e(a..d..i..")") return end end else e(a,1) end

-- Grind
/script --CastSpellByName("Mind Blast")
/script UIErrorsFrame:Hide()
/script if not buffed("Weakened Soul") then if not buffed("Power Word: Shield", 'player') then CastSpellByName("Power Word: Shield",1) end;end if not UnitExists("target") then	return;end if not buffed("Shadow Word: Pain", 'target') then CastSpellByName("Shadow Word: Pain") end DoOrder("Mind Blast", "Smite")

 

Share this post


Link to post
Share on other sites

How would you write hunter rotation with this? Autoshot -> Aimed -> AA Mutli AA AA -> Aimed 

Edited by Morathe

Share this post


Link to post
Share on other sites

I found most all of these macro's online.... *insert fav search engine here* is your friend. ;)

There was an old forum thread on the Nost forums that was a source of really awesome info. That had stuff for Locks and Hunters.

Share this post


Link to post
Share on other sites
11 hours ago, Dyaxler said:

I found most all of these macro's online.... *insert fav search engine here* is your friend. ;)

There was an old forum thread on the Nost forums that was a source of really awesome info. That had stuff for Locks and Hunters.

Could you share a link please?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×