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
Kronas
Wanderer


Joined: 28 Dec 2003
Posts: 62
Location: Australia

PostPosted: Sun Feb 15, 2004 6:41 am   

LOOPS
 
Hello I have this one pattern, but can have many replies
how do you set it up to reply the 1st, then goes to the 2nd and 3rd each time that pattern shows up
Zmud 6.62
example PATTERN (%W)says, hey there,*
1 you say, %1 blah,blah

the same pattern comes up and It goes to the next response 4 up all together. then goes back to the 1st. So its a loop

any ideas appreciated thanks
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Feb 15, 2004 9:11 am   
 
#var answers {hey|hello|what up|yeah yeah|go to he**}
#var answerct {0}
#trigger {%w) says, hey there,*} {say %1 %item(@answers,@answerct);#if %numitems(@answerct)=@answerct {answerct=1} {#add answerct 1}}

should do the trick but may be using %random would be better?

#trigger {%w) says, hey there,*} {say %1 %item(@answers,%random(1,%numitems(@answers))}
Reply with quote
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Sun Feb 15, 2004 12:59 pm   
 
#var answers {hey|hello|what up|yeah yeah|go to he**}
#var answerct {0}
#trigger {%w) says, hey there,*} {say %1 %item(@answers,@answerct);#if %numitems(@answerct)=@answerct {answerct=1} {#add answerct 1}}

should that be #if %numitems(@answers)=@answerct ??
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Feb 15, 2004 4:01 pm   
 
oops, yeah :)
hey it was late last i was tired :)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 15, 2004 7:02 pm   
 
And a couple more minor typo corrections:
#var answers {hey|hello|what up|yeah yeah|go to he**}
#var answerct {1}
#trigger {(%w) says, hey there,} {say %1 %item(@answers,@answerct);#if %numitems(@answers)=@answerct {answerct=1} {#add answerct 1}}

Added ( before %w to make it %1. Also dropped the * at the end of the pattern, since it doesn't add anything useful. Changed initial value of @answerct to 1, since there is no item 0.
Reply with quote
Kronas
Wanderer


Joined: 28 Dec 2003
Posts: 62
Location: Australia

PostPosted: Mon Feb 16, 2004 12:32 am   
 
OK, Thanks guys
Peace
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Mon Feb 16, 2004 7:49 pm   
 
quote:
And a couple more minor typo corrections:
#var answers {hey|hello|what up|yeah yeah|go to he**}
#var answerct {1}


Actually I had this at 0 for its first time so it would strt out at the first position and no go directly to the second one.

:)
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