Follow up question, how would i convert this so that the first */*hp goes into a trigger that gets the health, and divides it. -- This is what I tried to do, but failed miserably.
<triggers>
<trigger
enabled="y"
expand_variables="y"
keep_evaluating="y"
match="^\<(?<health1>\d+)\/(<?<health2>\d+)hp\, (.*?)m\, (.*?)mv\, (.*?)tnl\> You have (.*?)qp\. It is (?<hour>\d+)\:(?<minute>\d+)(am|pm)\.(.*)?"
regexp="y"
send_to="12"
sequence="100"
variable="health"
>
<send>Note "Caught trigger"
if %<hour> ~= old_hour or
%<minute> ~= old_minute then
old_hour = %<hour>
old_minute = %<minute>
DoAfterNote (36, "TICK IN 5 SECONDS!") -- 5 seconds warning
end -- if
percent = math.floor (%<health1>/%<health2> * 100)
if(percent == 100) then
Note "You are in excellent condition."
end -- if
if(percent < 100 and percent >= 90) then
Note "You have a few scratches."
end -- if
if(percent < 90 and percent >= 75) then
Note "You have some small wounds and bruises"
end -- if
if(percent < 75 and percent >= 50) then
Note "You have quite a few wounds"
end -- if
if(percent < 50 and percent >= 30) then
Note "You have some big & nasty wounds"
end -- if
if(percent < 30 and percent >= 15) then
Note "You are pretty hurt"
end -- if
if(percent < 15 and percent > 0) then
Note "You are in awful condition"
end -- if
if(percent == 0) then
Note "You are dead!"
end -- if</send>
</trigger>
</triggers>
------------------------
Well, i tested it some more, and it seems to work when i actively send commands to the game, but not when i sit quietly (regening, for example)
Is there any way to bypass this?
Also, on a side note, every time i enter a command, my prompt shows, followed by what i did.
eg:
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 4:30am.
You are in excellent condition.
Ogmin clan gossips 'dae'ni come get sword'
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 4:30am.
You are in excellent condition.
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 5:00am.
You are in excellent condition.
Ghurt clan gossips 'We wun hurt yer.'
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 5:00am.
You are in excellent condition.
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 5:30am.
You are in excellent condition.
i
You are carrying:
Nothing.
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 5:30am.
You are in excellent condition.
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 6:00am.
You are in excellent condition.
------------------------------------
Follow up! It seems that the tick is ONLY set if there is something that continues on after my prompt (eg)
<43/43hp, 102/102m, 106/106mv, 29127tnl> You have 0qp. It is 5:30am. You see a giant squid here
-------------------------------------
Added a space to the end of my prompt (invisible extra char) and it seems to catch the trigger every time now. Although I *would* like to know how to make it so i don't need that, this works well enough for now.
And thanks a ton nick, i've been using your client for damn near 8 years now (stopped mudding for a long while, but when i started again, your client was the very first thing i went to go download it =)
|