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
Cykops
Beginner


Joined: 07 Apr 2003
Posts: 20
Location: Sweden

PostPosted: Thu Mar 23, 2006 4:53 pm   

#cond question
 
Hi, im semi new to zmud and got a little question about #condition.
Why does my following code not work? and is it possible to have more than one condition in same trigger? as my example below:

What my mud send:

You hold forth your shield and unleash a ring of devastation!

Angel screams as she's torn to shreds!

Angel screams as he's torn to shreds!

Angel screams as he's torn to shreds!


Code:
Pattern is: You hold forth your shield and unleash a ring of devastation!

Value:
#var shieldtimeout 60
#COND {^* screams as he's torn to shreds!} {#math @shieldtimeout+20}
#COND {^* screams as he's torn to shreds!} {#math @shieldtimeout+20}
#COND {^* screams as he's torn to shreds!} {#math @shieldtimeout+20}
#COND {^* screams as he's torn to shreds!} {#math @shieldtimeout+20}
#COND {^* screams as he's torn to shreds!} {#math @shieldtimeout+20}
#alarm +@shieldtimeout {#echo The lockout on destruction is over}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Mar 23, 2006 11:27 pm   
 
#CONDITION does not go in the code section of the trigger:

#trigger {blah blah} {yakkity shmackkity}
#condition {blah blah} {yakkity shmackkity}
#condition {blah blah} {yakkity shmackkity}
#condition {blah blah} {yakkity shmackkity}
_________________
EDIT: I didn't like my old signature
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Mar 24, 2006 1:33 am   
 
*rofl*

It looks like the same thing each time so use a loop pattern condition. 3rd time of posting this in as many weeks.

#TRIGGER {Initial pattern:} {#NOOP start stuff}
#CONDITION {Loop pattern} {#NOOP store stuff and do stuff} {looppat}
#COND {^$} {#NOOP finish and display stuff}

Click on the blue links to find out more information on each command.

In case you are wondering #NOOP is just there as a comment placeholder you replace it with what you want to do. NOOP stands for "No Operation" which is exactly what is does and should be pronounced as two words "no" and "op" unlike with loop which is pronounced as one word and has an ewwww sound.
_________________
Taz :)
Reply with quote
Cykops
Beginner


Joined: 07 Apr 2003
Posts: 20
Location: Sweden

PostPosted: Fri Mar 24, 2006 9:23 am   
 
Taz wrote:
#TRIGGER {Initial pattern:} {#NOOP start stuff}
#CONDITION {Loop pattern} {#NOOP store stuff and do stuff} {looppat}
#COND {^$} {#NOOP finish and display stuff}

Where should i place the #cond? in the value of the trigger?
Or make a new trigger with #cond as pattern?
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Mar 24, 2006 2:51 pm   
 
Matt and I are old school and use the command line rather than the gui - graphical user interface.

It sounds like you are using the gui in which case to the right of the "Pattern:" box you will notice that there is a box called "State:" which should contain a "0"-(zero) press on the drop down arrow and choose "-New-" this will allow you to enter a condition to the trigger. You can then swap between the initial pattern and the condtion by using the "State:" drop down and choosing "0" or "1". Be sure to check out the other tabs to the right of the "Pattern" tab particularly "Options" as you will need to change the "Type:" on "State:" "1" to "Loop Pattern" also use the "Test" tab to see if it matches as expected.
_________________
Taz :)
Reply with quote
Cykops
Beginner


Joined: 07 Apr 2003
Posts: 20
Location: Sweden

PostPosted: Fri Mar 24, 2006 3:19 pm   
 
Ahh, then i get it :) Now i think should be all ok then... But it dosent work...

What i want to achive is that when i do a command called Destruction it will blast out a force from my shield and if it dosent hit anyone there is a one min lockout. If it hit 1 target it get a 1min and 20sec lockout. With 2 targets its 1min and 40sec... it adds 20sec per target it hit.

As it work right now it only do the 60 sec as in it dosent count the #cond... This is the code how it looks when i exported it to a txt file and copying it in to here:

Code:
#TRIGGER {You hold forth your shield and unleash a ring of devastation} {#var shieldtimeout 60}
#COND {screams as * torn to shreds} {#math @shieldtimeout+20} {looppat}
#COND {^$} {#alarm +@shieldtimeout {#echo The lockout on destruction is over}}


And the output from the mud you can see on top of the thread :)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat Mar 25, 2006 12:42 am   
 
Change #math @shieldtimeout+20 to #math shieldtimeout @shieldtimeout+20
_________________
Taz :)
Reply with quote
Cykops
Beginner


Joined: 07 Apr 2003
Posts: 20
Location: Sweden

PostPosted: Sat Mar 25, 2006 3:41 pm   
 
Yeah i noticed that and fixed that right after i posted... but its not possible to edditate a post after it been posted... Even after that changes it did not work... had to change to Loop Lines instead... but now it works, thanks =)
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