Help with trigger

Posted by Talonthalas on Thu 28 Mar 2002 05:16 PM — 2 posts, 10,936 views.

#0
Ok, I want a trigger that will automatically drink a health elixer when my health level gets below a certain number.

The health/mana display looks like this:

2380h, 2380m ex-

It is normally green, with the ex- being kind of a whitish-gray color.

When your health starts to go down: 2380h-1950h-1523h... The color changes on only the health indicator to yellow. I want a trigger that will automatically "drink health" when it gets below a certain number, or when it turns yellow... it turns yellow about 1750h.

I really don't understand how to work the triggers so I'm asking here. Any help would be appreciated.

Thanks,
Talon
Australia Forum Administrator #1
Probably the simplest is to make a trigger that matches on the general format of the line, calls a script and the script checks the actual health amount. Something like matching on ...


*h, *m, ex-*


Then the first wildcard will be the health amount. The script that trigger would call would be something like this ...


sub OnHealth (strName, strLine, aryWildcards) 
dim health

  health = cint (aryWildcards (1))
  if health < 1500 then
     world.send "drink health"
  end if
end sub