ZMud scripting problem

Scripts and support for your favorite MUD client.
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

ZMud scripting problem

Postby Sarvis » Fri Apr 23, 2004 11:24 pm

Ok, for some reason this if statment isn't working:

#if ((@currLyre != @currentInstrument) & (@Dualing == OFF)) {
rem bp
rem @currentInstrument
put @currentInstrument bp
get @currLyre bp
hold @currLyre
@currentInstrument = @currLyre
wear bp
}
sing 'song of regeneration'

I have no idea, it looks right... the syntax highlights properly and everything in the editing window. It's logically correct, but it always evaluates false and the commands don't happen.

I'm just now trying to add the dual wield check, it was working before with just #if (@currLyre != @currentInstrument)
<a href="http://www.code-haven.com">Code Haven</a> - For all your programming needs.

I detest what you write, but I would give my life to make it possible for you to continue to write. - Some Guy Who Paraphrased Voltaire
Vikaz
Sojourner
Posts: 92
Joined: Mon Feb 10, 2003 4:22 am
Contact:

Postby Vikaz » Sat Apr 24, 2004 5:27 am

1st line should be:
#if ((@currLyre != @currentInstrument) && (@Dualing == OFF)) {
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Sat Apr 24, 2004 5:42 am

Nope, && isn't an operator in zmud... comes up as a syntax error. :(
<a href="http://www.code-haven.com">Code Haven</a> - For all your programming needs.

I detest what you write, but I would give my life to make it possible for you to continue to write. - Some Guy Who Paraphrased Voltaire
Stamm
Sojourner
Posts: 446
Joined: Wed Jun 27, 2001 5:01 am

Postby Stamm » Sat Apr 24, 2004 11:19 am

I don't use ANDs in my triggers, I just nest IFs.
Vikaz
Sojourner
Posts: 92
Joined: Mon Feb 10, 2003 4:22 am
Contact:

Postby Vikaz » Sat Apr 24, 2004 11:37 pm

might come up as a syntax error but it works when you try it out ..

Try this out on the command line to check for yourself

#if (1 && 1) {#echo hi}
#if (1 && 0) {#echo hi}
V
Sarvis
Sojourner
Posts: 6369
Joined: Fri Jan 26, 2001 6:01 am
Location: Buffalo, NY, USA
Contact:

Postby Sarvis » Sun Apr 25, 2004 4:45 am

got it, needed quotes around OFF...

ZMud's a funny funny scripting language. I mean, if you compare to variables set to OFF they match. But if you compare a variable set to OFF with OFF it doesn't match, you have to compare the variable set to OFF to "OFF" to make it work.

It just doesn't feel consistent to me. Especially when you are trying to figure the language out as you go.
<a href="http://www.code-haven.com">Code Haven</a> - For all your programming needs.

I detest what you write, but I would give my life to make it possible for you to continue to write. - Some Guy Who Paraphrased Voltaire

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 10 guests