[quote='razorbax',index.php?page=Thread&postID=1163 45#post116345]But when I do the version with the variables
[code]/rpc Razorslax CreateMacro "Heal1" 1 "/cast [target=" .. UnitName(Player) .. "]heal" 1 1[/code]
It errors and only graps the first "/cast [target=" part. Anyone know what is used as joiners? I have tried ".." and "&" and "," and "and".[/quote]The [url='http://www.lua.org/manual/5.1/manual.html#2.5.4']concatentation[/url] operator is .. try it without spaces (blah..blah..blah) and also on that page at linked there is a section 2.1 - Lexical Conventions which explains what I say below.
UnitName takes a string (type of variable); so you'll need to pass "player" to it for it to work. But because you are using " in UnitName, you need to use [[ and ]] instead of " around the complete string.
so you might like to try:
[[/cast [target="..UnitName("player").."] heal]]
I make no guarantees that this will work for you; good luck in your macro manipulation quest. (Do you get a phat reward when you hand it in?)
Connect With Us