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
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sun Sep 07, 2003 6:17 pm   

script variable question
 
i have a script that cycles thought a varaible string , it works fine for all except one of the varables

the output:

say Why won't you die
You say, "Why won't you die"
>say Dont make me show you my moves
You say, "Dont make me show you my moves"
>say You coffin is waiting for you
You say, "You coffin is waiting for you"
>say I will avenge with heaped interest the crimes you have commited
You say, "I will avenge with heaped interest the crimes you have commited"
>say Taste the bile of punishment
You say, "Taste the bile of punishment"
>say You screams will be louder than any womens
You say, "You screams will be louder than any womens"
>say I will free you of the pain of your existence
You say, "I will free you of the pain of your existence"
>say Get back in the privy you crawled out of night soil
You say, "Get back in the privy you crawled out of night soil"
>say I'm going to put you in the narrow house
You say, "I'm going to put you in the narrow house"
>say Put 1 your dirt 1 ready to die
You say, "Put 1 your dirt 1 ready to die" <<--- this is the strange output>>
the script:

#CLASS {General|Insulter}
#ALIAS Insulter {
%eval( say %item( @Insult, 1))
#VAR insult {%additem( %item( @insult, 1), @insult)}
#DELN Insult 1
}
#VAR Insult {Why won't you die|Dont make me show you my moves|You coffin is waiting for you|I will avenge with heaped interest the crimes you have commited|Taste the bile of punishment|You screams will be louder than any womens|I will free you of the pain of your existence|Get back in the privy you crawled out of night soil|I'm going to put you in the narrow house|Put on your dirt shroud and get ready to die}
#BUTTON 231 {Insulter} {Insulter} {} {} {} {} {} {Size} {60} {17} {Pos} {100} {1} {} {} {} {} "" {} {} {} {3}
#CLASS 0


any help appreciated

thanks Naz
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 07, 2003 6:38 pm   
 
Solution:
say %item( @Insult, 1)

It's because you used %eval().
On and off are boolean values. "on" evaluates to 1, "off" evaluates to 0.
AND statements are boolean values. "shroud and get" evaluates to "shroud" AND "get". Non-empty strings evaluate to 1, so both "shroud" and "get" evaluate to 1. 1 AND 1 evaluates to 1.
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