|
kaupmat Newbie
Joined: 13 Jan 2009 Posts: 4 Location: Helsinki
|
Posted: Fri Nov 10, 2023 2:08 pm
CASE random with #ALARM or #WAIT |
https://www.zuggsoft.com/zmud/help6/CASE.htm
#CASE %random {Hello} {Hi there} {Hiya} {Hi}
returns a random string from the given list to the MUD.
How do you add WAIT or ALARM for this random commands? If you just put ..
#CASE %random {#ALARM +5 Hello} {#ALARM +10 Hi there} {#ALARM +15 Hiya} {#ALARM +20 Hi}
or
#CASE %random {#WAIT +5 Hello} {#WAIT +10 Hi there} {#WAIT +15 Hiya} {#WAIT +20 Hi}
these wont work, "syntax error".
Do you have a work around for this? maybe with something else than #CASE %random ?
Thanks in advance Zuggsoft forum helpers! |
|
|
|
mikeC130 Apprentice
Joined: 03 Jul 2006 Posts: 110
|
Posted: Fri Nov 10, 2023 6:03 pm |
Your commands are incomplete. For alarm, any commands associated with it triggering must be in brackets {}, as in #ALARM +2 {Hi}. For your script, you would have nested brackets, with each case being in a set and then the command to follow the alarm within it's own brackets. Wait has a different syntax and parameter setting. Wait doesn't use +, and the value following is in milliseconds, not seconds, so waiting 2 seconds would just be #WAIT 2000. Also, sequential commands must be separated by a semicolon, so you need one between the wait and what you want sent out.
The following have been tested in CMUD, but should work for ZMUD as well. Both of these wait 2 seconds and then randomly send one of the messages.
Code: |
#CASE %random {#ALARM +2 {Hello}} {#alarm +2 {Hi there}} {#alarm +2 {Hiya}} {#alarm +2 {Hi}}
#CASE %random {#WAIT 2000; Hello} {#WAIT 2000; Hi there} {#WAIT 2000; Hiya} {#WAIT 2000; Hi}
|
|
|
|
|
kaupmat Newbie
Joined: 13 Jan 2009 Posts: 4 Location: Helsinki
|
Posted: Fri Nov 10, 2023 6:34 pm |
Oh! So easy it was! I never had two different brackets in a trigger - only 1 ! Thank You very much mikec130 for help! This will help me in other future triggers too!
|
|
|
|
|
|
|
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
|
|