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 -->
<muclient>
<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.1"
>
<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">
<description trim="y">
<![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!
@ -41,8 +31,6 @@ returns
>This is a long line of text that would be formatted to break at 79 characters with
>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>
@ -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>
<alias
match="^nw (.*)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<alias match="^nw (.*)$" enabled="y" group="NoteHelper" regexp="y" send_to="12" sequence="100">
<send>Send(note_wrap("%1"))</send>
</alias>
<alias
match="^nwi\s(.*?)\s(.*)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<alias match="^nwi\s(.*?)\s(.*)$" enabled="y" group="NoteHelper" regexp="y" send_to="12" sequence="100">
<send>Send(note_wrap("%2", 79, "%1"))</send>
</alias>
<alias
match="^nnw (new|reply)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<alias match="^nnw (new|reply)$" enabled="y" group="NoteHelper" regexp="y" send_to="12" sequence="100">
<send>noteeditor("%1")</send>
</alias>
</aliases>
@ -199,9 +166,13 @@ function noteeditor(str)
note = utils.editbox("Write your note.", "Note Writer Box")
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(" ")
end
end
Send(".s")
else
@ -216,11 +187,7 @@ end
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="nw:help"
enabled="y"
>
<alias script="OnHelp" match="nw:help" enabled="y">
</alias>
</aliases>

Loading…
Cancel
Save