parent
47fdb1a70a
commit
8477b29c6e
@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- Saved on Wednesday, July 27, 2022, 3:17 PM -->
|
||||
<!-- MuClient version 5.07-pre -->
|
||||
|
||||
<!-- Plugin "ScanMobs" generated by Plugin Wizard -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="ScanMobs"
|
||||
author="Crowley"
|
||||
id="a2af6939b450ceecec3d30e6"
|
||||
language="Lua"
|
||||
purpose="Scan only for certain mobs."
|
||||
save_state="y"
|
||||
date_written="2022-07-27 15:16:06"
|
||||
requires="4.80"
|
||||
version="1.0"
|
||||
>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias group="scans"
|
||||
match="sscan(?: (.*))?$" enabled="y"
|
||||
script="scanMobs" sequence="100"
|
||||
regexp="y"
|
||||
></alias>
|
||||
</aliases>
|
||||
|
||||
<!-- Triggers -->
|
||||
<triggers>
|
||||
<trigger group="scans"
|
||||
match="{scan}" name="scanOpen"
|
||||
omit_from_output="y" send_to="12" sequence="10" keep_evaluating="y">
|
||||
<send>
|
||||
TSROutput = {}
|
||||
dirTemp = {}
|
||||
EnableTrigger("scanDir")
|
||||
EnableTrigger("scanLine")
|
||||
EnableTrigger("scanClose")
|
||||
EnableTrigger("scanOpen", false)</send>
|
||||
></trigger>
|
||||
|
||||
<trigger group="scans"
|
||||
match=".* here you see:" name="scanDir" regexp="y"
|
||||
omit_from_output="y" send_to="14" sequence="10"
|
||||
keep_evaluating="y">
|
||||
<send>dirTemp = TriggerStyleRuns</send>
|
||||
></trigger>
|
||||
|
||||
<trigger group="scans"
|
||||
regexp="y" match="^\s+ - (.*)$"
|
||||
name="scanLine" omit_from_output="y"
|
||||
send_to="14" keep_evaluating="y" sequence="10"
|
||||
><send>
|
||||
local scanned = "%1"
|
||||
|
||||
for _,v in ipairs(checkNames) do
|
||||
if scanned:upper():find(v:upper()) then
|
||||
if #dirTemp > 0 then
|
||||
TSROutput[(#TSROutput+1)] = dirTemp
|
||||
dirTemp = {}
|
||||
end
|
||||
TSROutput[(#TSROutput+1)] = TriggerStyleRuns
|
||||
end
|
||||
end</send>
|
||||
|
||||
</trigger>
|
||||
|
||||
<trigger group="scans"
|
||||
match="{/scan}" name="scanClose"
|
||||
omit_from_output="y" script="scanClosed" sequence="10" keep_evaluating="y">
|
||||
></trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
require 'tprint'
|
||||
checkNames = {}
|
||||
TSROutput = {}
|
||||
dirTemp = {}
|
||||
|
||||
function scanMobs(name, line, wildcards)
|
||||
if #wildcards[1] > 0 then
|
||||
checkNames = {}
|
||||
for word in wildcards[1]:gmatch("%w+") do
|
||||
table.insert(checkNames, word)
|
||||
end
|
||||
end
|
||||
|
||||
if #checkNames > 0 then
|
||||
EnableTrigger("scanOpen")
|
||||
else
|
||||
ColourNote("white", "black", "No mobs to scan for, executing regular scan.")
|
||||
end
|
||||
|
||||
Send("scan")
|
||||
end
|
||||
|
||||
function scannedDir(name, line, wildcards)
|
||||
dirTemp = TriggerStyleRuns
|
||||
end
|
||||
|
||||
function scanCheck(name, line, wildcards)
|
||||
local scanned = wildcards[1]
|
||||
|
||||
for _,v in ipairs(checkNames) do
|
||||
if scanned:upper():find(v:upper()) then
|
||||
if #dirTemp > 0 then
|
||||
TSROutput[(#TSROutput+1)] = dirTemp
|
||||
dirTemp = {}
|
||||
end
|
||||
table.insert(TSROutput, TriggerStyleRuns)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function scanClosed()
|
||||
EnableTrigger("scanDir", false)
|
||||
EnableTrigger("scanLine", false)
|
||||
EnableTrigger("scanClose", false)
|
||||
|
||||
if #TSROutput > 0 then
|
||||
for i,j in pairs(TSROutput) do
|
||||
for _,v in pairs(j) do
|
||||
ColourTell (RGBColourToName (v.textcolour),
|
||||
RGBColourToName (v.backcolour),
|
||||
v.text)
|
||||
end
|
||||
Note("")
|
||||
end
|
||||
else
|
||||
ColourNote("white", "blue", "Nothing found!")
|
||||
end
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
||||
</muclient>
|
Loading…
Reference in new issue