Page 1 of 1

Converting string data to boolean?

Posted: Sun Sep 26, 2004 8:39 pm
by overnuker2323
I want to check to see if I have a buff on, and if not... cast it...

I know that ${Me.Buff[Call of Bones]} will return NULL if it's not up, and "Call of Bones" if it is. How do I change this to a boolean value so I can use it in /if commands? I've searched through the help file and am lost atm...

If anyone can point me inthe direction of some more example of how to write /if commands and how to convert string data to boolean (etc) I'd really appreciate it.

Also, is there a way to remove a buff other than clicking on it? I can write the /mouseto and /click left if I really need to, was just wondering if there's an easier way to do it.. Thanks!

-S

Posted: Sun Sep 26, 2004 8:57 pm
by SlimFastForYou
This should work:

Code: Select all

/if (${Me.Buff["Call of Bones"]}) {
    /echo I have that buff
} else {
    /echo I need that buff
}
An if statement should evaluate to be true if it is non-zero if I'm not mistaken.

Posted: Sun Sep 26, 2004 9:01 pm
by blueninja
${Me.Buff[call of bones].ID}

Woot!

Posted: Sun Sep 26, 2004 9:14 pm
by overnuker2323
Blueninja wins the prize! :) Thanks again, folks!

Posted: Mon Sep 27, 2004 3:58 am
by SlimFastForYou
Oops, forgot the ID part. My way might have still worked but his was better.