Please don't say "DUH!".. :p
I effectively want to re-write lines as they come in from the mud.
With "Omit from output", using Send-to-output (ie.
) works nicely, but using send-to-script (ie.
(note that the only important line in that is the "Note (ss)" bit)) produces no output.
Bug, or am I missing something?
I effectively want to re-write lines as they come in from the mud.
With "Omit from output", using Send-to-output (ie.
<triggers>
<trigger
enabled="y"
match="^([A-Za-z]+ wisps.*)$"
omit_from_output="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>(One) %1</send>
</trigger>
</triggers>
) works nicely, but using send-to-script (ie.
<triggers>
<trigger
enabled="y"
omit_from_output="y"
match="^Hp: ([-0-9]+)\(([-0-9]+)\) Gp: ([-0-9]+)\(([-0-9]+)\) Xp: ([-0-9]+)"
regexp="y"
send_to="12"
sequence="96"
>
<send>
function numtobar(p,w)
p=string.format("%i",p/10)
r=string.rep("#",p)
r=r..string.rep("-",w-p)
return r
end
a=GetVariable("nextlev")
ss = "Hp: [" .. numtobar((%1/%2)*100,10) .. "] Gp: [" .. numtobar((%3/%4)*100,10) .. "] "
if (a ~= nil) then
ss=ss .. "Xp: [" .. numtobar((%5/GetVariable("nextlev"))*100,20) .. "]"
else
ss=ss .. "Xp: %5"
end
Note(ss)</send>
</trigger>
</triggers>
Bug, or am I missing something?