Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Stephen
Newbie


Joined: 02 Nov 2000
Posts: 8

PostPosted: Fri Feb 22, 2002 1:41 am   

A problem with aliases ( quite simple, probably )
 
Here is my alias:

#if (%1="") {emot howls angrily and spits on the ground~.} {pmot spits yellow saliva at %1~.}

Yet, if I type:
spit

It still does the second emote, but with no target.

If I use a target name, it works perfect.. Calling the second emote.

Thank you.
Reply with quote
Stephen
Newbie


Joined: 02 Nov 2000
Posts: 8

PostPosted: Fri Feb 22, 2002 1:50 am   
 
Sorry, I forgot to add:

Windows ME - P2 400, 64MB

Zmud 6.16 - Registered
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Feb 22, 2002 1:55 am   
 
Try using:
Syntax: %numparam()
returns the number of parameters passed to
an alias.

#if (%numparam() == 0) {emot howls angrily and spits on the ground~.} {pmot spits yellow saliva at %1~.}


TonDiening
Beta Upgrading to 6.26
Reply with quote
EdwinDroom
Wanderer


Joined: 25 Jan 2002
Posts: 77
Location: Ireland

PostPosted: Fri Feb 22, 2002 2:07 am   
 
confused...

well, first i presume you have a trigger on spit as a command.

If so, have tried this out and it seems to be working (in 6.26) as you want it to.

All i can suggest is uaing something like spit ground, and basing the #IF on that, as it seems not to be recognising the empty string. Or 2 separate aliases, spt and spit (say)

All the best freaks are here, please stop staring at me
Reply with quote
Stephen
Newbie


Joined: 02 Nov 2000
Posts: 8

PostPosted: Fri Feb 22, 2002 2:10 am   
 
Thank you for your prompt responses.

The best solution I have found is to change:

#if (%1="")

to

#if (%1=%null)

It now works perfectly.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Feb 22, 2002 11:30 pm   
 
quote:

Thank you for your prompt responses.

The best solution I have found is to change:

#if (%1="")

to

#if (%1=%null)

It now works perfectly.



I had a #yesno with 3 buttons, each of which assigned the appropriate value to the @script.mode variable. Using #IF (%1 = %null) actually worked, but it worked incorrectly. The first button (mode 0)pressed would set the mode correctly, but the other two would not make the assignment and the mode would get stuck on the last chosen mode. #IF (%null(%1)) totally fixed such problems.

li'l shmoe of Dragon's Gate MUD
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net