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,23 +6,13 @@
<!-- 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"
>
<description trim="y">
<![CDATA[
<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!
nw <text> No indent character; takes a long line and formats linewraps it.
nwi <char> <text> Same as above, except it takes an indent character.
nwi <char><text> Same as above, except it takes an indent character.
nnw <reply|new> Opens up an editor box so you can just type the whole note at once.
##Examples##
@ -41,55 +31,32 @@ 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>
</description>
</plugin>
</plugin>
<!-- Aliases -->
<!-- Aliases -->
<aliases>
<alias
match="^nw (.*)$"
enabled="y"
group="NoteHelper"
regexp="y"
send_to="12"
sequence="100"
>
<aliases>
<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>
</aliases>
<!-- Script -->
<!-- Script -->
<script>
<![CDATA[
<script>
<![CDATA[
function note_wrap(str, limit, indent, indent1)
indent = indent or ""
indent1 = indent1 or indent
@ -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
@ -210,26 +181,22 @@ function noteeditor(str)
end
end
]]>
</script>
</script>
<!-- Plugin help -->
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="nw:help"
enabled="y"
>
<aliases>
<alias script="OnHelp" match="nw:help" enabled="y">
</alias>
</aliases>
</aliases>
<script>
<![CDATA[
<script>
<![CDATA[
function OnHelp ()
world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script>
</script>
</muclient>

Loading…
Cancel
Save