Adding multiple lines to enable a trigger

Posted by TruckDriver22 on Fri 12 Jun 2009 03:08 PM — 4 posts, 17,395 views.

Denmark #0

Trigger 1
(.+) (damages|hurts|Blasts) John
Dam = (dam or 0) + 1

Trigger 2
^$

I want if Dam = more then 4 to send but can not find the command.

falcon damages john.
falcon damages john.
falcon damages john.

= nothen
but if

falcon damages john.
falcon blasts john hard.
falcon hurts john.
falcon damages john.

= c 'fast healing' john

can someone tell me the catch phrase that works for matching counters?
USA #1
First, make the capitalization the same for variable names.
dam = (dam or 0) + 1

Second, add this line after that one:

if dam == 4 then
  Send ("c 'fast healing' john")
  dam = 0
end

USA #2
To explain, to do something based on something else, the statement you want is an if statement. It looks like this:


if [statement] then
  [script]
end


And it will execute [script] if [statement] is true. Every value is true except false and nil.

To test equality, you use two equal signs. If they are the same, it is true. If they are not, it is false.
Denmark #3
Thanks this helps alot!