Hi,
I've read all the previous posts regarding solutions for adding a newline after the prompt but I'm still unable to find a successful fix for my problem. Hopefully someone can point me in the right direction.
I want to trigger a newline on a prompt for filtering purposes. The prompt is very simple...
I took the Plugin (below) from an old post and modified the string.gsub to read
However this is unsuccessful. Am I correct in thinking % is the correct escape character here rather than backslash? I did also try without escape characters but it won't trigger.
The packet debug for the line looks as follows:
Code tags added. - Moderator
I've read all the previous posts regarding solutions for adding a newline after the prompt but I'm still unable to find a successful fix for my problem. Hopefully someone can point me in the right direction.
I want to trigger a newline on a prompt for filtering purposes. The prompt is very simple...
|1|*
I took the Plugin (below) from an old post and modified the string.gsub to read
return (string.gsub (s, "\n%|1%|%*", "%1\n"))
However this is unsuccessful. Am I correct in thinking % is the correct escape character here rather than backslash? I did also try without escape characters but it won't trigger.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, March 21, 2009, 11:42 PM -->
<!-- MuClient version 4.37 -->
<!-- Plugin "Add_NewLine_To_Prompt" generated by Plugin Wizard -->
<muclient>
<plugin
name="Add_NewLine_To_Prompt"
author="Nick Gammon"
id="3862dd7f2ba50abfe50d4844"
language="Lua"
purpose="Forces a newline after a prompt line"
date_written="2009-03-21 23:38:18"
requires="4.37"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
function OnPluginPacketReceived (s)
return (string.gsub (s, "%|1%|%*", "%1\n"))
end -- function OnPluginPacketReceived
]]>
</script>
</muclient>
The packet debug for the line looks as follows:
...[0;30;44m|1|. 0d 0a 1b 5b 30 3b 33 30 3b 34 34 6d 7c 31 7c 1b
[1;37;40m.[0;34; 5b 31 3b 33 37 3b 34 30 6d 1b 5b 30 3b 33 34 3b
40m.[1;34;40m*.[ 34 30 6d 1b 5b 31 3b 33 34 3b 34 30 6d 2a 1b 5b
0;34;40m.[1;37;4 30 3b 33 34 3b 34 30 6d 1b 5b 31 3b 33 37 3b 34
0m 30 6d
Code tags added. - Moderator