 |
digitalkrieg Newbie
Joined: 20 Aug 2006 Posts: 2
|
Posted: 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. |
|
|
 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
 |
digitalkrieg Newbie
Joined: 20 Aug 2006 Posts: 2
|
Posted: Sun Aug 20, 2006 9:22 pm |
thank you so much works like a charm
|
|
|
 |
|
|