$char(gem,#) help - any way to return the full string?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

ThatOtherGuy
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Aug 05, 2003 6:12 pm

$char(gem,#) help - any way to return the full string?

Post by ThatOtherGuy » Thu Aug 07, 2003 11:54 am

The title about says it all - What I want to know is if there is a way to return the full string of the name of a spell, instead of just the name up to the first space?

Thanks in advance, sorry if it's a m0r0nic question :p
-TOG

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Thu Aug 07, 2003 12:05 pm

it already returns the full string. your macro is screwing it up. try to /echo $char(gem,#), and you'll see what I mean. if you want your macro to see the whole thing, you have to include it (and any further references to it) in quotes. e.g.

Code: Select all

/varset v55 "$char(gem,1)"
/if "$v55"=="Long Spell Name" /cast "$v55"

ThatOtherGuy
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Aug 05, 2003 6:12 pm

Post by ThatOtherGuy » Thu Aug 07, 2003 12:16 pm

Aaah much thanks
I'm used to coding in VB, where if you set a var = "something in quote" you get exactly that - what you put in quotes ^_^
-TOG

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Thu Aug 07, 2003 2:32 pm

same applies here, it's the commands themselves that make it lose the quotes... something with the Get(Next)Arg() function and the way they parse args. Just put quotes around every string, every time, no matter if it's in a variable or not, and you should be fine.