MUSHclient v4.99
Trigger
LUA
TEST:
What's happening:
If the value is 4 digits and above, the if statement always fail. The maximum I can do in this case, is 999.
So, in the example above:
* if ahp < "200" works fine because ahp = 120
* if axp < "500" fails because axp = 2847, so ColourNote gets printed when it should not.
Is there something I'm missing re: LUA?
Thank you for the assistance.
Trigger
<triggers>
<trigger
enabled="y"
group="warning"
ignore_case="y"
match="^[(?P<ahp>\d+)\/(?P<fhp>\d+) (?P<amana>\d+)\/(?P<fmana>\d+) (?P<amove>\d+)\/(?P<fmove>\d+) (?P<axp>\d+) \|(.*?)$"
name="status_warning"
regexp="y"
script="status_warning"
sequence="100"
>
</trigger>
</triggers>
LUA
function status_warning (name, line, wildcards)
local ahp = wildcards.ahp
local axp = wildcards.axp
if ahp < "200" then
ColourNote ("white", "red", "WARNING - HEALTH IS LOW!")
end
if axp < "500" then
ColourNote ("white", "red", "CHANGE TO LEVELING EQUIPMENT NOW!!")
end
end
TEST:
Actual: [120/1500 100/800 100/800 2847 | PET: 100/800hp | Q SU]
wildcards: [ahp/fhp amana/fmana amove/fmove axp | *
What's happening:
If the value is 4 digits and above, the if statement always fail. The maximum I can do in this case, is 999.
So, in the example above:
* if ahp < "200" works fine because ahp = 120
* if axp < "500" fails because axp = 2847, so ColourNote gets printed when it should not.
Is there something I'm missing re: LUA?
Thank you for the assistance.