I recently returned to using MUSHclient (version 4.37) and am now fiddling around to see how I can refit my system to take full advantage of all the goodies you stuffed it full of these last years. One problem I am having is with my visuals and text substitution. The test code I have set up is as follows.
It works like a charm! Except for the fact that every now and then, the DeleteLines() function leaves an empty line. It most often happens with the single line trigger (about seven out of ten times) but also sometimes with the multiline one (about two out of ten times).
Am I doing something wrong here or is there a bug with DeleteLines?
<script><![CDATA[
function substitute(name, line, wildcards, styles)
_, count = wildcards[0]:gsub('\n', '')
DeleteLines(count + 1)
if message then
Note(message)
message = nil
end
end
]]></script>
<triggers>
<trigger
enabled="y"
lines_to_match="2"
keep_evaluating="y"
match="^You are ranked (\d+)st in Imperian\.\nYou are ranked (\d+)st in Questing\.$"
multi_line="y"
regexp="y"
script="substitute"
send_to="12"
>
<send>message = 'Overall and Questing rank replaced'</send>
</trigger>
</triggers>
It works like a charm! Except for the fact that every now and then, the DeleteLines() function leaves an empty line. It most often happens with the single line trigger (about seven out of ten times) but also sometimes with the multiline one (about two out of ten times).
Am I doing something wrong here or is there a bug with DeleteLines?