This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Polymorph macro
Post Reply
Return to board index
Post by
Tildy
Taken from Cogwheel's macro guide, which is a sticky thread in the official UI and Macro forum (not my work).
/cast polymorph
/run for i=1,GetNumRaidMembers()-1 do local u,t="raid"..i,"target"if UnitIsUnit(u..t,t)then SendChatMessage("Change targets! Trying to sheep...","WHISPER",nil,UnitName(u))end end
This is a pretty neat macro that definitely deserves a spot here, if only to provide an example of the power of scripts and macros in practical applications. This will cast a spell (in this case, polymorph), and whisper a message to each member of your raid who has the same target as you (can be adapted to work in non-raid groups). So if somebody is targetting what will soon be your sheep, they get a message like 'get off my sheep! :q
If you don't understand the script, it might be worth your while to take the time to understand what makes it work; you'll be able to make better macros because of it, I think.
Post by
Clear
An really awesome macro indeed. Thanks for posting it here, else I would've never seen it ;)
Post by
Goose
Pretty neat. Thanks for sharing!
Post by
88604
This post was from a user who has deleted their account.
Post by
61086
This post was from a user who has deleted their account.
Post by
Clear
Nice. I assume if you want it just to warn off party rather than Raid members you would just change the 'GetNumRaidMembers' to 'GetNumPartyMembers'
You'd also need to change "raid" to "party".
I tried this, but it didn't seem to work. Anyone who got it working for a party, or even better, got one that detects if you're in a raid or party? Tried to make it myself, but *cough*.. Didn't work out ^^
Post by
94109
This post was from a user who has deleted their account.
Post by
Tildy
I tried this, but it didn't seem to work. Anyone who got it working for a party, or even better, got one that detects if you're in a raid or party?
/cast polymorph
/run for i=1,GetNumPartyMembers()-1 do local u,t="party"..i,"target"if UnitIsUnit(u..t,t)then SendChatMessage("Change targets! Trying to sheep...","WHISPER",nil,UnitName(u))end end
That should work, you just use GetNumPartyMembers() instead, and rather than refer to each player as "raid#" it's "party#".
Post by
Clear
This is what I use:
#showtooltip Polymorph
/castrandom Polymorph, Polymorph: Pig
/run for i=1,GetNumPartyMembers()-1 do local u,t="party"..i,"target"if UnitIsUnit(u..t,t)then SendChatMessage("Change targets! I'm trying to sheep %t.","WHISPER",nil,UnitName(u))end end
which is as far as i can see the same as what you're saying. Still it doesn't worked with only one party member. When i was in a party of 5 it seemed to work normally.
I'm starting to think maybe another addon is causing problems becouse I can't see any error in the code. Guess I should clean up my addons ;)
Post by
Tildy
Oh, I hadn't really thought about that.
Try this and see if it fixes the problem with the small party:
/cast polymorph
/run for i=0,GetNumPartyMembers() do local u,t="party"..i+1,"target"if UnitIsUnit(u..t,t)then SendChatMessage("Change targets! Trying to sheep...","WHISPER",nil,UnitName(u))end end
Post by
Tildy
Alright, I made a macro that will work in both party and raid, but it's around the 250 character cap so your message has to be short. Perhaps notify the group in advance to better explain the short message, or use something short like "My sheep!", OR you could instead call another macro from this macro, and include a ton of text or whatever you like in the second macro. To keep it all in one macro, though, it needs to be pretty small.
/cast Polymorph
/run local t,u,z="target"if UnitInRaid("player")then u,z="Raid",GetNumRaidMembers()else u,z="Party",GetNumPartyMembers()end for i=0,z do u=u..i+1 if UnitIsUnit(u..t,t)then SendChatMessage("My sheep!","WHISPER",nil,UnitName(u))end end
Also note that I'm not an experienced programmer, and I've never used lua before on top of that, so there may well be a shortcut or two that could be utilized in order to shore up some free characters. Let me know if you see any.. I already tried concatenating the function (GetNumPartyMembers() or GetNumRaidMembers()) in a few different ways to save space, but I can't get it to work that way so the "if"s were used for that purpose as well.
edit: is the cap 255? Um, well, that frees up a couple more characters if it is :q
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.