Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Soujirou
Newbie


Joined: 26 Oct 2009
Posts: 7

PostPosted: Thu Nov 05, 2009 8:01 pm   

Achaea Auto-Sipper
 
I'm developing an Achaean Auto-sipper; but having a bit of trouble...

The Trigger pattern looks something like this: ^(%d)h, (%d)m?(*)~-$
The Script like this:
#VA health %1
#VA mana %2

So basically I'm setting @health to the first digit, and @mana to the second. Checking that it's the beginning of the line. I'm then putting something along the lines of:
#IF @health < (@maxhealth * .8) {sip health} {#NOOP}

I'm setting the @maxhealth and @maxmana variables by using this Trigger pattern: ^Health: 2340/(%d) Mana: 2320/(%d)
And this Script:
#VA maxhealth %1
#VA maxmana %2

Which triggers every time you enter Achaea and check your score. However, as far as I've come; all the variables set, but it returns "(said trigger) fired but failed to compile." Does anyone have any insight to this?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Nov 06, 2009 12:23 am   
 
That message means that you have an errror in your script. Please copy the exact script and paste it into the forum, within [code] and [/code] marks, so we can see what the problem is.
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Fri Nov 06, 2009 12:44 pm   
 
You need to use brackets around an expression to make it work:
Code:
#TRIGGER {^(%d)h, (%d)m(*)~-$} {#var health %1;#var mana %2;#IF (@health < {@maxhealth*.8}) {sip @health}}


Also, you don't need to use #NOOP inside the 'false' section of your #IF statement. If it is omitted, it is assumed that nothing will happen.
Additionally, you need to use @health instead of just 'health' if you're going to be using the value of a variable somewhere. (As in your previous IF-True scenario)
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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