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
sammas
Newbie


Joined: 11 Oct 2004
Posts: 3

PostPosted: Mon Oct 11, 2004 12:32 pm   

send prob from if statment
 
Hi,

I need a little help with my triggers. I created a state trigger that works quite fine except one thing. I have the following if statemnt and the part in the true section is send to the mud as whole and not as 3 commands as it should do.

%if( %len( @nextdir) > 0,{@nextdir;#wait %random(1500,3500);sh}, %state)


nextdir : contains a direction e.g. e ( for east :) )
#wait %random(1500,3500);sh -> should wait for a little random time then start to sh ( search herbs )
%state -> resets the trigger states

when the state is reached I get as output : e;#wait 1786;sh
but it does not work. If I copy the exact string to my command line and send it to the mud, its seperated as intended.

Any idea what I have to do?

Regards

Sammas
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Oct 11, 2004 12:49 pm   
 
First you should know that #WAIT is not intended for triggers http://www.zuggsoft.com/zmud/timers.htm, second %if returns a value try #IF instead, third %state returns the VALUE of the CURENT trigger state it doesn't reset it. try #STATE 0

There are also alot of other minor things but without seeing the whole trigger who knows. like Why %len??

#IF (@nextdir) {#EXEC @nextdir;#ALARM "searchherbs" {+%random(1,3)} {sh}} {#STATE 0}

Another Option could be a wait trigger state PLEASE take the time to read all the topics in the help file and also the refrence sections for the commands and functions you want to use in your triggers.
_________________
Zmud Support Library
Zmud Knowledge Base
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