New code, fixed bugs.

master
AardCrowley 2 years ago committed by GitHub
parent b987c5b04f
commit 8fe60eaaa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,17 +6,7 @@
<!-- Plugin "Note_Write_Helper" generated by Plugin Wizard --> <!-- Plugin "Note_Write_Helper" generated by Plugin Wizard -->
<muclient> <muclient>
<plugin <plugin name="Note_Write_Helper" author="Arcidayne" id="291e6a78b7457b70ebf24375" language="Lua" purpose="Preformats long lines to break at 79 characters with respect to full words." save_state="y" date_written="2015-08-16 08:56:28" requires="4.00" version="2.0">
name="Note_Write_Helper"
author="Arcidayne"
id="291e6a78b7457b70ebf24375"
language="Lua"
purpose="Preformats long lines to break at 79 characters with respect to full words."
save_state="y"
date_written="2015-08-16 08:56:28"
requires="4.00"
version="2.1"
>
<description trim="y"> <description trim="y">
<![CDATA[ <![CDATA[
Instead of using the note formatter tool, or figuring out how long your line of text is, this plugin will do it for you! Instead of using the note formatter tool, or figuring out how long your line of text is, this plugin will do it for you!
@ -41,8 +31,6 @@ returns
>This is a long line of text that would be formatted to break at 79 characters with >This is a long line of text that would be formatted to break at 79 characters with
>respect to the word boundaries. >respect to the word boundaries.
As a side note, in order to post blank lines, you will need to use @w for each blank line. I may or may not fix it in the future.
]]> ]]>
</description> </description>
@ -52,35 +40,14 @@ As a side note, in order to post blank lines, you will need to use @w for each b
<!-- Aliases --> <!-- Aliases -->
<aliases> <aliases>
<alias <alias match="^nw (.*)$" enabled="y" group="NoteHelper" regexp="y" send_to="12" sequence="100">
match="^nw (.*)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<send>Send(note_wrap("%1"))</send> <send>Send(note_wrap("%1"))</send>
</alias> </alias>
<alias <alias match="^nwi\s(.*?)\s(.*)$" enabled="y" group="NoteHelper" regexp="y" send_to="12" sequence="100">
match="^nwi\s(.*?)\s(.*)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<send>Send(note_wrap("%2", 79, "%1"))</send> <send>Send(note_wrap("%2", 79, "%1"))</send>
</alias> </alias>
<alias <alias match="^nnw (new|reply)$" enabled="y" group="NoteHelper" regexp="y" send_to="12" sequence="100">
match="^nnw (new|reply)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<send>noteeditor("%1")</send> <send>noteeditor("%1")</send>
</alias> </alias>
</aliases> </aliases>
@ -199,9 +166,13 @@ function noteeditor(str)
note = utils.editbox("Write your note.", "Note Writer Box") note = utils.editbox("Write your note.", "Note Writer Box")
if note then if note then
for line in note:gmatch("[^%c]+[%c+]?") do local lines = note:split("\n")
for _, line in ipairs(lines) do
if line:match("^%c") then
Send("@")
else
Send(note_wrap(line)) Send(note_wrap(line))
--Send(" ") end
end end
Send(".s") Send(".s")
else else
@ -216,11 +187,7 @@ end
<!-- Plugin help --> <!-- Plugin help -->
<aliases> <aliases>
<alias <alias script="OnHelp" match="nw:help" enabled="y">
script="OnHelp"
match="nw:help"
enabled="y"
>
</alias> </alias>
</aliases> </aliases>

Loading…
Cancel
Save