making triggers

Posted by ChrisG on Thu 23 Aug 2001 11:29 PM — 2 posts, 12,194 views.

Canada #0
Hi this is such a newbie question but i'm going to ask it anyways since i don't know who else to ask. How do i make a tigger that will automatically make my character quaff a potion if he's been hit for 30 or more hp.

So it would work like this

Monsters hit mauls you [46] (where 46 is the number of hitpoints)

Now i want to make it so that if the HP hit taken is greater than 40 then the command to be issued would be to quaff potion.

Is this possible? am i crack talking?
Australia Forum Administrator #1
Yes, you can make a fancy regular expression that matches on 30 or more, something like this:


Match on: ^.* hit mauls you ([3-9][0-9]|[0-9]{3,})
Send: quaff potion
Enabled: checked
Regular expression: checked


This will match on 30 onwards. What it does is look for a digit in the range 3 to 9, followed by one in the range 0 to 9 (ie. 30 to 99), *or* any 3 digit number.

I have assumed that you don't know the monster's name, so the first ".*" represents some monster name.

I also assumed that the brackets in your question did not actually appear in the output. If they do you will need to put them in with a backslash in front of them, like this:


Match on: ^.* hit mauls you \[([3-9][0-9]|[0-9]{3,})\]


Your question mentioned you want to check > 30, and then later you said > 40. My answer is correct for > 30, if you want > 40, then change the first "3" in the regular expression to a "4".