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
lYPhiD
Newbie


Joined: 28 Nov 2002
Posts: 3
Location: Australia

PostPosted: Sun Feb 23, 2003 6:27 am   

#IF
 
i have zmud 6.16 currently, is there a way to get this to work?
i want the alias to send the text of a variable to the mud pending an if statement

#VAR x {1}
#VAR y {plain text}
#AL go {#IF @x {@y}}
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sun Feb 23, 2003 6:41 am   
 
is this currently not working? because it should, so far as i know. you might try:

#al go {#if (@x) {@y}}

but version 6.53 is running it fine the way you have it. Can you pinpoint the problem a little more, maybe put an else segment in:

#al go {#if @x {@y} {#show x is false}}

or is it that the variable isn't expanding?

--------

moon.icebound.net:9000
Reply with quote
lYPhiD
Newbie


Joined: 28 Nov 2002
Posts: 3
Location: Australia

PostPosted: Sun Feb 23, 2003 7:02 am   
 
thanx Emit,

oops i have mislead you a little i just tried it like that and it works
but inside my script it doesnt seem to
i am talking achaea btw, if that makes any difference

i have string list setup to add actions with my add alias
then i can type go and it will send them to the mud
then when the string list is epmty and i type go
i would like a default item to automatically be added

#AL add {#ADDITEM action_list {%1 %2 %3 %4 %5 %6 %7 %8 %9};action_list_score=%numitems(@action_list)}
#AL go {#IF @action_list_score=0 {#ADDITEM action_list {@action_default}};%item(@action_list, 1);#DELNITEM action_list 1;action_list_score=%numitems(@action_list)}

#VAR action_list {}
#VAR action_list_score {0} {0}
#VAR action_default {action_attack}

if this is valid code, i guess i will try zmud 6.53
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Feb 23, 2003 8:23 am   
 
The paranthesis arround the expression of an #IF are not required but highly recommended. Also the return value from %item has hidden quotes, so #EXEC or #SEND are used to properly send the command to the mud.

Changes noted in red:
#AL add {#ADDITEM action_list {%-1};action_list_score=%numitems(@action_list)}
#AL go {#IF (@action_list_score=0) {#ADDITEM action_list {@action_default}};#EXEC %item(@action_list, 1);#DELNITEM action_list 1;action_list_score=%numitems(@action_list)}
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