Update NoteExtender.xml

master
AardCrowley 2 years ago committed by GitHub
parent 8164b67cac
commit 776f922657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,23 +10,22 @@
<!-- Aliases --> <!-- Aliases -->
<aliases> <aliases>
<alias match="^(note(?: read(?: \d+| last| again)?)?)$" enabled="y" regexp="y" script="startNoteRead" sequence="100"> <alias match="^(note?(?: read(?: \d+| last| again)?)?)$" enabled="y" regexp="y" script="startNoteRead" sequence="100">
</alias> </alias>
<alias match="^notewin (on|off|show|hide|clear|help)$" enabled="y" regexp="y" ignore_case="y" script="toggleNoteWin" sequence="100"> <alias match="^notewin (on|off|show|hide|clear|help)$" enabled="y" regexp="y" ignore_case="y" script="toggleNoteWin" sequence="100">
</alias> </alias>
<alias match="^(note\s?(?:list(?:\s\d+)?|unread|to\s\w+|from\s\w+|subj\s.+)?)$" enabled="y" regexp="y" script="startNoteList" sequence="100"> <alias match="^(note?\s?(?:list(?:\s\d+)?|unread|to\s\w+|from\s\w+|subj\s.+)?)$" enabled="y" regexp="y" script="startNoteList" sequence="100">
</alias> </alias>
</aliases> </aliases>
<script> <script>
<![CDATA[ <![CDATA[
require "gmcphelper"
local extras = require "aard_lua_extras" local extras = require "aard_lua_extras"
require "gmcphelper"
local snapshotV = tonumber(extras.PackageVersion()) local snapshotV = tonumber(extras.PackageVersion())
require 'tprint'
dofile(GetInfo(60) .. "aardwolf_colors.lua")
local prefix = GetAlphaOption("script_prefix") local prefix = GetAlphaOption("script_prefix")
@ -89,17 +88,27 @@ function startNoteList(name, line, wildcards)
end end
function findBoundaries(tbl) function findBoundaries(tbl)
local startIdx = 1 local foundStart = false
local endIdx = #tbl local tildeStr = string.rep("~", 79)
while startIdx<= endIdx and not tbl[startIdx][1].text:find("~") and not tbl[strtIdx][1].text:find("No more new") do for i,v in ipairs(tbl) do
table.remove(tbl, startIdx)
startIdx = startIdx + 1 if v[1].text == tildeStr or v[1].text:find("No more new") then
foundStart = true
break
else
table.remove(tbl, i)
end
end end
while endIdx >= 1 and not tbl[endIdx][1].text:find("~") and not tbl[endIdx][1].text:find("There are no") and not tbl[endIdx][1].text:find("Changed to") do if foundStart then
table.remove(tbl, endIdx) for i = #tbl, 1, -1 do
endIdx = endIdx -1 if tbl[i][1].text == tildeStr or tbl[i][1].text:find("There are no") or tbl[i][1].text:find("Changed") then
break
else
table.remove(tbl, i)
end
end
end end
return tbl return tbl

Loading…
Cancel
Save