Nick Gammon said:
See the help for that function:
Quote:
Warning - do NOT call DeleteLines from a trigger, alias or timer using send-to-script. For design reasons this will not work. In version 3.76 you will cause the client to crash if you do this. In version 3.77 upwards it will silently fail (ie. do nothing).
If you want to call DeleteLines from a trigger you must call a function in your script file (or plugin script), not directly from send-to-script.
In other words, make a script file, put a function into it, and put the name of the function in the trigger as the script to be called.
First, I apologize for my ignorance as I realize this seems brain-numbingly simple to you.
I created a script called deleteLines.lua which now contains the following:
function deleteTwoLines()
DeleteLines(2)
end
I assume I have to go to World Properties -> Scripting -> Scripts and include that script as an External Script File.
Then, I've gone to my Multi-line trigger and added the line deleteTwoLines() so that it will call the function I created.
I know the trigger is being, well, triggered, because I have a Note("Trigger is working") which I can see on the output. However, the 2 lines that I am trying to omit are not being omitted.
So there is still some part of this brain-numbingly simple problem that I am too ignorant to sort out. Apologies once again for my intellectual inferiority.
EDIT: I'm wondering if this would be better
http://www.gammon.com.au/forum/?id=10453 ... using CallPlugin instead of an external script? (Since there can apparently only be 1 external script, but you can have as many plugins as you want as far as I can tell.)
I'm trying to make this plugin:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, September 05, 2017, 7:37 PM -->
<!-- MuClient version 5.05 -->
<!-- Plugin "deleteTwoLines" generated by Plugin Wizard -->
<muclient>
<plugin
name="deleteTwoLines"
author="muclient"
id="6eb408421deaede0c6a61a36"
language="Lua"
purpose="Deletes the last 2 lines from the output display"
date_written="2017-09-05 19:36:11"
requires="5.00"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
function OnPluginPacketReceived (s)
end -- OnPluginPacketReceived
]]>
function deleteTwoLines ()
DeleteLines(2)
end -- deleteTwoLines
</script>
<!-- Get our standard constants -->
<include name="constants.lua"/>
</muclient>
And then I'm having my trigger call it with:
CallPlugin ("6eb408421deaede0c6a61a36", "deleteTwoLines")
It's not working ... but it seems like this would be the superior option if I can get it working.