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.

155 lines
3.4 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>
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" 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("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()
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>