You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
3.4 KiB
128 lines
3.4 KiB
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE muclient>
|
|
<!-- Saved on Friday, July 05, 2024, 1:36 PM -->
|
|
<!-- MuClient version 5.07-pre -->
|
|
|
|
<!-- Plugin "EqSearch_Window" generated by Plugin Wizard -->
|
|
|
|
<muclient>
|
|
<plugin
|
|
name="EqSearch_Window"
|
|
author="<aliases>"
|
|
id="23baaa250117a5fab975782c"
|
|
language="Lua"
|
|
purpose="Displays EqSearch results in windows"
|
|
save_state="y"
|
|
date_written="2024-07-05 13:34:56"
|
|
requires="5.07"
|
|
version="1.0"
|
|
>
|
|
|
|
</plugin>
|
|
|
|
|
|
<!-- Aliases -->
|
|
|
|
<aliases>
|
|
<alias
|
|
script="startSearch"
|
|
match="^(eqsearch .*$)"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
</alias>
|
|
</aliases>
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
<script>
|
|
<![CDATA[
|
|
local extras = require "aard_lua_extras"
|
|
local snapshotV = tonumber(extras.PackageVersion())
|
|
|
|
local prefix = GetAlphaOption("script_prefix")
|
|
|
|
if (snapshotV < 2245) or (snapshotV < 2252 and tonumber(gmcp("char.base.level")) > 201) then
|
|
ColourNote("white", "blue", "Sorry, your snapshot of the AardMUSH package is not compatible for your level and you will not be able to use this script. Please update your snapshot of the AardMUSH package to use this plugin. Unloading plugin to prevent issues.")
|
|
Execute(prefix .. 'DoAfterSpecial(1, "UnloadPlugin(\'' .. GetPluginID() .. '\')", sendto.script)')
|
|
else
|
|
require "wrapped_captures"
|
|
end
|
|
|
|
require 'themed_miniwindows'
|
|
|
|
local lines = {}
|
|
|
|
local fName, fSize = GetAlphaOption("output_font_name"), tonumber(GetOption("output_font_height")) -- Grabs your current output font name and size
|
|
|
|
function initWindow() -- initialize the window
|
|
myWin = ThemedTextWindow(
|
|
"eqsearch_window", -- Window id
|
|
0,0,0,0, -- Default left, top, right, bottom location
|
|
"Eqsearch Results", -- Window title, can be changed with myWin:dress_window("New Title")
|
|
"center", -- Window title alignment
|
|
true, -- is temporary
|
|
true, -- resizable
|
|
true, -- scrollable
|
|
true, -- selectable
|
|
false, -- copyable
|
|
false, -- hyperlinks
|
|
false, -- autowrap
|
|
fName, -- title font name
|
|
fSize, -- title font size
|
|
fName, -- text font name
|
|
fSize, -- text font size
|
|
100, -- max number of lines to display in the window; the earliest lines will be pushed out the window if over this amount
|
|
5, -- text padding, the distance between the text and the window frame
|
|
true, -- defer showing until all information is received
|
|
false -- body is transparent
|
|
)
|
|
end
|
|
|
|
function findBoundaries(tbl)
|
|
local filteredTable = {}
|
|
|
|
for index, sub_table in ipairs(tbl) do
|
|
local addEntry = true
|
|
|
|
for _, entry in ipairs(sub_table) do
|
|
if entry.text:find(cmd) or entry.text:find("End Capture") then
|
|
addEntry = false
|
|
break
|
|
end
|
|
end
|
|
|
|
if addEntry then
|
|
table.insert(filteredTable, sub_table)
|
|
end
|
|
end
|
|
|
|
return filteredTable
|
|
end
|
|
|
|
|
|
function processText(lines)
|
|
initWindow()
|
|
|
|
local lines = findBoundaries(lines)
|
|
|
|
myWin:add_text(lines, true)
|
|
|
|
myWin:fit_contents(myWin:text_width(lines) + 40, 850)
|
|
myWin:set_scroll(1)
|
|
myWin:show()
|
|
end
|
|
|
|
function startSearch(name, line, wildcards)
|
|
cmd = wildcards[1]
|
|
Capture.untagged_output(cmd, true, true, true, processText, false, timeout)
|
|
end
|
|
]]>
|
|
</script>
|
|
|
|
|
|
</muclient>
|