View Single Post
04-03-13, 09:58 AM   #1
kittykatmax
A Fallenroot Satyr
 
kittykatmax's Avatar
Join Date: Apr 2007
Posts: 21
Script conditionals?

I dual box and use two addons for it at this point. The script below works so I can tell my focus character to follow me (for the addon Useful Extras) even if they're from another realm or not in party/raid. The /followme in line 2 is for party members for the Hydra addon, which doesn't work cross realm or with characters not in party. My problem is that when I use this script and don't have a focus, it bugs and I get an error message stating, "SendChatMessage(): Whisper message missing target player!".

Is there a way to edit the initial script with some kind of [exists, help] conditional to fix this so I won't get errors when there's no focus or I have an enemy focus?

Thanks!


/run local n,r=UnitName"focus"n=n and n..(r and"-"..r or"")or""SendChatMessage("followme","WHISPER",nil,n);
/followme
  Reply With Quote