String comparison

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

inthrall
orc pawn
orc pawn
Posts: 13
Joined: Sun Mar 14, 2004 3:57 pm

String comparison

Post by inthrall » Sat May 22, 2004 2:27 pm

This used to work just fine:

Code: Select all


   /varset Questgiver ${Target.CleanName}
   /if (${String[Lita Hegeway].Equal[Questgiver]}) {
      /say "whatever"
   }

But now I have not been able to figure out how to do this comparison, someone please help me, thank you

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: String comparison

Post by wassup » Sat May 22, 2004 2:34 pm

inthrall wrote:This used to work just fine:

Code: Select all


   /varset Questgiver ${Target.CleanName}
   /if (${String[Lita Hegeway].Equal[Questgiver]}) {
      /say "whatever"
   }

But now I have not been able to figure out how to do this comparison, someone please help me, thank you
RTFM again...

Anyway... Questgiver is a string variable right?

Code: Select all

   /varset Questgiver ${Target.CleanName}
   /if (${Questgiver.Equal[Lita Hegeway]}) {
      /say "whatever"
   }

inthrall
orc pawn
orc pawn
Posts: 13
Joined: Sun Mar 14, 2004 3:57 pm

Post by inthrall » Sat May 22, 2004 2:40 pm

Ty.. and no offense, but ive been reading TFM but in my experinece it has not been updated as often as the project is so it becomes futile

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat May 22, 2004 2:55 pm

inthrall wrote:Ty.. and no offense, but ive been reading TFM but in my experinece it has not been updated as often as the project is so it becomes futile
*cough* Bullshit *cough*

From the most recent readme in the current zip:

MQ2DataVars section
Overview
MQ2Data was designed so that accessing information could be done utilizing a uniform system. User variables are utilized as MQ2Data Top-Level Objects.
Then read Macroquest2 Data Types section... specifically:
Syntax
The basic syntax for usage is something like this:

${TopLevelObject[index].Member[index].Member[index]}

Mister Peepers
a lesser mummy
a lesser mummy
Posts: 46
Joined: Mon Apr 19, 2004 8:10 pm

Re: String comparison

Post by Mister Peepers » Sat May 22, 2004 3:00 pm

[quote="inthrall"]

Code: Select all


   /varset Questgiver ${Target.CleanName}
   /if (${String[Lita Hegeway].Equal[[size=150][color=darkred]Questgiver[/color][/size]]}) {
      /say "whatever"
   }

Read the manual and take a lookt at whats been highlighted and tell me why its not working.