Yes Ksilyan, you got the ^ and $ backwards. As for the "*" issue. Like Magnum said, this is intended to be an anti-trigger feature (not that it works), but I am 99.9% sure that using {} in zMud, instead of () means 'treat these as literal strings'. A wildcard in those places would be ineffective, since it would match on literally any line at all. In other words, using a wildcard in there, instead of a literal you net you a trigger equivalent to "***************" Any line 15 characters or more in length would cause it to trigger. This make is quite obvious that they intended the * in that trigger to be literals, not wildcards.
As for you autoheal:
<trigger
match="H/:/d+ M/:/d+ B/:/d+/% /[eb/]"
enabled="y"
regexp="y"
send_to="12">
<send>if %1 > LastHP then
LastHP = %1
else
if %1 / LastHP <= 0.5 then ' Check percentage of last highest HP.
send "heal" 'Send command hear.
end if
end if</send>
</trigger>
Your prompt doesn't provide the original maximum and you don't mention what command you use to heal, so the above is a best guess. You will need to replace "heal" with whatever you actually use to heal yourself. Also, the 0.5 means '50%', so if you want to heal at a different point, you need to also change that. One change you may want to make is to replace the 0.5 with getvariable("HealPercent"), then add an alias like:
<alias
match="setheal *"
enabled="y"
send_to="12">
<send>setvariable "HealPercent", %1
note "You will now auto-heal at: " & %1 * 100 & "%."
save ""</send>
<alias>
This will set a variable that is internal to the client and thus is saved 'in' the world file. Everything I have used so far are script variables, whose values vanish as soon as the script closes. A world variable, if the world is saved properly, will persist from one to session to the next. The 'save ""' line will save the entire worlds settings, including the variable you just changed.
In plugins, this is handled a bit differently. By setting the plugin's save_state setting to "y", Mushclient automatically updates a special file that stores variables, every time you change one. This works like an automatic version of 'save ""' for plugins, though the values are not stored in the plugin itself. The reason being that state files are files named with WorldID-PluginID.XML. This allows each character(world file) to use the same plugins, but completely different settings. Had you provided a complete list of things you needed, and it didn't immediately send me screaming away from the computer, I would have likely created such a plugin instead. However, had you dropped the whole mess in our laps I would probably not have touched it with a ten foot pole. I hate zMud's script engine with a passion. ;) lol |