<!-- Saved on Wednesday, March 09, 2022, 11:04 AM -->
<!-- Saved on Wednesday, March 09, 2022, 11:04 AM -->
<!-- MuClient version 5.07-pre -->
<!-- MuClient version 5.07-pre -->
<!-- Plugin "RoomCharWindow" generated by Plugin Wizard -->
<muclient>
<muclient>
<plugin
<pluginname="NoteExtender"author="Crowley"id="c49e43d9dce931263263088b"language="Lua"purpose="Note output and hyperlinks"save_state="y"date_written="2022-03-09 11:02:09"requires="5.07"version="1.0"sequence="10">
while startIdx<= endIdx and not tbl[startIdx][1].text:find("~") and not tbl[strtIdx][1].text:find("No more new") do
NotesWin:set_scroll(1)
table.remove(tbl, startIdx)
NotesWin:show()
startIdx = startIdx + 1
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
function findBoundaries(lines)
table.remove(tbl, endIdx)
local first_index = nil
endIdx = endIdx -1
local last_index = nil
-- Find the first and last indices with ~ in the text field
for i, v in ipairs(lines) do
if (string.find(v[1].text, "~") or string.find(v[1].text, "No more new posts")) and not first_index then
first_index = i
end
if (string.find(v[1].text, "~") or string.find(v[1].text, "There are no new")) then
last_index = i
end
end
end
-- Remove all the entries before the first ~ and after the last ~
return tbl
if first_index and last_index then
for i = #lines, last_index + 1, -1 do
table.remove(lines, i)
end
for i = first_index - 1, 1, -1 do
table.remove(lines, i)
end
end
end
return lines
function addToWindow(lines)
local lines = findBoundaries(lines)
NotesWin:clear(false)
NotesWin:add_text(lines, false)
NotesWin:fit_contents(850, 500)
NotesWin:set_scroll(1)
NotesWin:show()
end
end
function hyperlinknotes(lines)
function hyperlinknotes(lines)
for i,v in ipairs(findBoundaries(lines)) do
for i,v in ipairs(lines) do
if i < 5ori ==#linesthen
if i < 5ori ==#linesthen
Simulate(stylesToANSI(v) .. "\n")
Simulate(stylesToANSI(v) .. "\n")
else
else
@ -174,26 +132,33 @@ function hyperlinknotes(lines)
end
end
function toggleNoteWin(name, line, wildcards)
function toggleNoteWin(name, line, wildcards)
if wildcards[1] == "on" or wildcards[1] == "show" then