Thread Tools Display Modes
09-20-10, 08:34 PM   #1
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Resurrection Macro

I'm trying to do two things with a macro. I don't know how to do it tho.

Cast Resurrection

Say "(Resurrection) on 'PlayerName'". I want the (Resurrection) to be the actual spell link. I want it to use raid or party depending on whether im in raid or not.

Possible?
__________________
  Reply With Quote
09-20-10, 09:35 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you just want it to send the message every time you press the button:

/run SendChatMessage(GetNumRaidMembers()>0 and "RAID" or "PARTY","Casting "..GetSpellLink("Resurrection").." on "..UnitName("target") or "No Target")
  Reply With Quote
09-20-10, 09:46 PM   #3
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
That didn't work for me
__________________
  Reply With Quote
09-20-10, 10:20 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Phanx has the arguments switched around. Should be message first:

Code:
/run SendChatMessage("Casting "..GetSpellLink("Resurrection").." on "..UnitName("target") or "No Target",GetNumRaidMembers()>0 and "RAID" or "PARTY")
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-20-10, 10:29 PM   #5
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Worked.. however, if I'm not in a party and I want to rez a nube who happen to get killed by the environment, this pops.

Date: 2010-09-20 23:29:02
ID: 1
Error occured in: Global
Count: 1
Message: [string "SendChatMessage("Casting "..GetSpellLink("R..."] line 1:
attempt to concatenate a nil value
Debug:
(tail call): ?
[C]: ?
[string "SendChatMessage("Casting "..GetSpellLink("R..."]:1: in main chunk
[C]: RunScript()
..\FrameXML\ChatFrame.lua:1996: value()
..\FrameXML\ChatFrame.lua:4070:
..\FrameXML\ChatFrame.lua:3997
[C]: ChatEdit_ParseText()
..\FrameXML\ChatFrame.lua:3660: ChatEdit_SendText()
..\FrameXML\ChatFrame.lua:2477:
..\FrameXML\ChatFrame.lua:2470
[C]: ?
[C]: UseAction()
..\FrameXML\SecureTemplates.lua:310: handler()
..\FrameXML\SecureTemplates.lua:529:
..\FrameXML\SecureTemplates.lua:478
__________________
  Reply With Quote
09-21-10, 02:19 AM   #6
Guardix
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 42
Code:
/run SendChatMessage("Casting "..GetSpellLink("Resurrection").." on "..UnitName("target") or "No Target",GetNumRaidMembers()>0 and "RAID" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
Simply added a GetNumPartyMembers() and make it use "SAY" if you are not in raid nor party.
__________________
  Reply With Quote
09-21-10, 05:53 PM   #7
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
You rock! Thanks.
__________________
  Reply With Quote
10-01-10, 09:43 PM   #8
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Originally Posted by Guardix View Post
Code:
/run SendChatMessage("Casting "..GetSpellLink("Resurrection").." on "..UnitName("target") or "No Target",GetNumRaidMembers()>0 and "RAID" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
Simply added a GetNumPartyMembers() and make it use "SAY" if you are not in raid nor party.
Ok, it's working except for if I accidentally hit it while not targeting, it kills the macro all together.
__________________
  Reply With Quote
10-01-10, 09:47 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Put the /run line after your /cast line (if you mean what I think you mean, that is).
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
10-01-10, 09:54 PM   #10
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Code:
#showtooltip Resurrection
/cast Resurrection
/run SendChatMessage("Casting "..GetSpellLink("Resurrection").." on "..UnitName("target") or "No Target",GetNumRaidMembers()>0 and "RAID" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
That's what it looks like. If I happen to just be standing there and I hit the rez key without anyone targeted it pops up the error I posted a few ones up.

I've managed to narrow it down to this;

Code:
"..UnitName("target") or "No Target"
If the "..UnitName" piece is in it errors. It's like the command isn't understanding to use UnitName or No Target if nothing is targeted.
__________________
  Reply With Quote
10-01-10, 09:58 PM   #11
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
That probably made no sense. It works period if you have someone targeted. It will use say when not in party, party when in a party, and raid when in a raid. However, the unitname and no target clause don't seem to work with one another.

It reminds me of an IF/OR statement that should say IF targeted use UnitName OR not targeted use "No Target".
__________________
  Reply With Quote
10-01-10, 10:56 PM   #12
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
try

Code:
/run SendChatMessage(("Casting "..GetSpellLink("Resurrection").." on "..UnitName("target")) or "No Target",GetNumRaidMembers()>0 and "RAID" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
the difference being putting paraenthesis around the entire string so

if (longString..with..concat..UnitName) or "No Target"

so the whole string is all or nothing
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote
10-01-10, 11:27 PM   #13
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
eh, I would try them here

Code:
/run SendChatMessage("Casting "..GetSpellLink("Resurrection").." on "..(UnitName("target") or "No Target"),GetNumRaidMembers()>0 and "RAID" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
But this would definitely work:
Code:
/run local n=UnitName("target") or "No Target" SendChatMessage("Casting "..GetSpellLink("Resurrection").." on "..n",GetNumRaidMembers()>0 and "RAID" or GetNumPartyMembers()>0 and "PARTY" or "SAY")
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-15-11, 10:34 AM   #14
Maleekha
A Kobold Labourer
Join Date: Jul 2011
Posts: 1
But what if the target is out of range or out of line of sight? The macro is enabled, informing ppl but my char does not cast the spell.... :S could any1 help me pls?
  Reply With Quote
07-15-11, 11:27 AM   #15
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
You'll need an addon watching events to detect if you actually started casting a resurrection spell instead of erroring due to range/LoS. Due to the nature of the code required, it wouldn't be practical to run from a macro.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Resurrection Macro

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off