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.
141 lines
3.1 KiB
141 lines
3.1 KiB
<?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" enabled="y"
|
|
match="{scan}" name="scanOpen"
|
|
omit_from_output="y" send_to="12" sequence="10" keep_evaluating="y">
|
|
<send>
|
|
if startScan then
|
|
TSROutput = {}
|
|
dirTemp = {}
|
|
EnableTrigger("scanDir")
|
|
EnableTrigger("scanLine")
|
|
EnableTrigger("scanClose")
|
|
end</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>
|
|
print(scanned)
|
|
local scanned = "%1"
|
|
scanned = scanned:upper()
|
|
|
|
for _,v in ipairs(checkNames) do
|
|
local vStr = "%f[%S]" .. v:upper() .. "%f[%A]"
|
|
|
|
if string.match(scanned, vStr) 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" enabled="y"
|
|
omit_from_output="y" script="scanClosed" sequence="10" keep_evaluating="y">
|
|
></trigger>
|
|
</triggers>
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
<script>
|
|
<![CDATA[
|
|
require 'gmcphelper'
|
|
checkNames = {}
|
|
TSROutput = {}
|
|
dirTemp = {}
|
|
|
|
function scanMobs(name, line, wildcards)
|
|
scanCmd = (gmcp("char.status.state") == "8" and "survey") or "scan"
|
|
|
|
startScan = false
|
|
|
|
if #wildcards[1] > 0 then
|
|
checkNames = {}
|
|
|
|
for word in wildcards[1]:gmatch("%w+") do
|
|
table.insert(checkNames, word)
|
|
end
|
|
end
|
|
|
|
if #checkNames > 0 then
|
|
startScan = true
|
|
else
|
|
ColourNote("white", "black", "No mobs to scan for, executing regular scan.")
|
|
end
|
|
|
|
Send(scanCmd)
|
|
end
|
|
|
|
function scanClosed()
|
|
if startScan then
|
|
EnableTrigger("scanDir", false)
|
|
EnableTrigger("scanLine", 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
|
|
startScan = false
|
|
end
|
|
]]>
|
|
</script>
|
|
|
|
|
|
</muclient>
|