Synthetic Reality Forums   
my profile | directory login | register | search | faq | forum home

  next oldest topic   next newest topic
» Synthetic Reality Forums » Our Archives » WoS World Developer Tips » compare ...... if=

   
Author Topic: compare ...... if=
sndrsn
Healthy Member
Member # 1104

Rate Member
Icon 1 posted      Profile for sndrsn   Email sndrsn   Send New Private Message       Edit/Delete Post 
I need to know this because my script doesn't work and I don't know why:
Do COMPARE and IF= work with strings


eg.
checking if. the player typed in Their Name with #<lastask>

THE SCRIPT IS LONGER THAN MERLINS 'OH MY' TOPiC

[This message has been edited by sndrsn (edited 08-27-2001).]


Posts: 274 | Registered: Jul 2001  |  IP: Logged
samsyn
Administrator
Member # 162

Member Rated:
4
Icon 1 posted      Profile for samsyn   Author's Homepage   Email samsyn   Send New Private Message       Edit/Delete Post 
no, they do NOT work with strings. The strings are evaluated as numbers.

so "3 blind mice" = 3

and "what?" = 0


Posts: 10561 | From: California | Registered: Dec 1998  |  IP: Logged
sndrsn
Healthy Member
Member # 1104

Rate Member
Icon 1 posted      Profile for sndrsn   Email sndrsn   Send New Private Message       Edit/Delete Post 
oh No!!!!!!!!!!!!!!!!!!!!!!!!!!!
Posts: 274 | Registered: Jul 2001  |  IP: Logged
samsyn
Administrator
Member # 162

Member Rated:
4
Icon 1 posted      Profile for samsyn   Author's Homepage   Email samsyn   Send New Private Message       Edit/Delete Post 
if you want to check right after an ASK command, use this

IF Qword, @label

which will go to the label if "word" appears anywhere within the most recent "ask answer"

Now, if you need to compare with a variable value (the player's name), then you have to do something goofy like:

; get player's name into cookie
SET name, "%1"

; Ask the question
1: Say, what is your name again?
ASK 30

; see if it matches (exactly)
IF Q#<name>, @match
1: Liar! That's not your name!

...
@match
1: That's what I thought. Cool name!

---------
Of course, that's a completely untested assertion and may not work. It certainly will fail if the name has spaces in it (boo, hiss, spaces evil!)


Posts: 10561 | From: California | Registered: Dec 1998  |  IP: Logged
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Synthetic Reality

Copyright 2003 (c) Synthetic Reality Co.

Powered by UBB.classic™ 6.7.3