|
Kronas Wanderer
Joined: 28 Dec 2003 Posts: 62 Location: Australia
|
Posted: 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 |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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))} |
|
|
|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: 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 ?? |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun Feb 15, 2004 4:01 pm |
oops, yeah :)
hey it was late last i was tired :) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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. |
|
|
|
Kronas Wanderer
Joined: 28 Dec 2003 Posts: 62 Location: Australia
|
Posted: Mon Feb 16, 2004 12:32 am |
OK, Thanks guys
Peace |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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.
:) |
|
|
|
|
|