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


Joined: 20 Aug 2006
Posts: 2

PostPosted: Sun Aug 20, 2006 8:33 pm   

Scripting help with #math and triggers
 
Can someone help me with this trigger script? I am new to zmud and scripting in general.

#TRIGGER {If (%1) cows jumped into Runaway River and (%2) } {#math answer %1-%2;say @answer}
#TRIGGER {If (%1) beavers and (%2) beavers got together with (%3)} {#math answer %1+%2+%3;say @answer}
#TRIGGER {If (%1) eggs were lain each by (%2) } {#math answer %1*%2;say @answer}
#TRIGGER {If (%1) nuts were saved for winter storage and (%2)} {#math answer %1/%2;say @answer}


everytime the trigger fires it gives the wrong answer, but there is no constant in the answers.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Sun Aug 20, 2006 8:50 pm   
 
You don't use %1 in the trigger patterns, you should use %d for numbers, %w for words, %a for alphanumerics
So the working ones would be
#TRIGGER {If (%d) cows jumped into Runaway River and (%d) } {#math answer %1-%2;say @answer}
#TRIGGER {If (%d) beavers and (%d) beavers got together with (%d)} {#math answer %1+%2+%3;say @answer}
#TRIGGER {If (%d) eggs were lain each by (%d) } {#math answer %1*%2;say @answer}
#TRIGGER {If (%d) nuts were saved for winter storage and (%d)} {#math answer %1/%2;say @answer}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
digitalkrieg
Newbie


Joined: 20 Aug 2006
Posts: 2

PostPosted: Sun Aug 20, 2006 9:22 pm   
 
thank you so much works like a charm
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