so...
i tried your mod, and it stopped the looping ty!
a player said to use Execute ...to send an alias, instead of send, and it works good :)
here is the hp prompt trigger
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="PROMPT"
keep_evaluating="y"
match="^H\: (.*?)\/(.*?) S\: (.*?)\/(.*?) Favors\: (.*?)\/(.*?)$"
name="HPmon2"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send> hp = %1
maxhp=%2
stm=%3
maxstm=%4
favor=%5
maxfavor=%6
-- Step #2: Info bar.
-- Step #2A: Basic setup + HP monitor.
ShowInfoBar (Visible)
InfoClear ()
InfoBackground ("black")
InfoFont ("FixedSys", 9, 0)
InfoColour ("lime")
if (hp < (maxhp / 2) ) then
InfoColour ("red")
end
Info ("HP: ", hp, "/", maxhp)
-- Step 2B: FTG monitor.
InfoColour ("lime")
if (stm < (maxstm / 2) ) then
InfoColour ("red")
end
Info (" Stm: ", stm, "/", maxstm)
-- Step 2C: Favor monitor
InfoColour ("lime")
if (favor < (maxfavor / 2) ) then
InfoColour ("red")
end
Info (" Favor: ", favor, "/", maxfavor)
if (hp < (maxhp / 2) ) then
if (last_time_sent == nil or os.time () - last_time_sent > 20) then
last_time_sent = os.time () -- remember when we sent
Execute ("lowHP") -- send the command
ColourNote ("white", "blue", "LOW FeCKING HP!")
end -- if 20 seconds have passed
end -- if low HP
</send>
</trigger>
</triggers>
also, as a side note...
i tried to use a toggle instead of checking the time, but
couldn't get it to work... if a variable is not there, it should be auto created?
if (hp < (maxhp / 2) and tonumber(GetVariable("hpTOG")) == 0 ) then
Execute ("lowHP")
SetVariable ("hpTOG", 1)
ColourNote ("white", "blue", "LOW FeCKING HP!")
end
if (hp == maxhp and tonumber(GetVariable("hpTOG")) == 1 ) then
SetVariable ("hpTOG", 0)
ColourNote ("white", "blue", "Healed!")
end
|