Update ScanMobs.xml

master
AardCrowley 2 years ago committed by GitHub
parent 0cf0c06936
commit 5d94b81975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,16 +32,17 @@
<!-- Triggers -->
<triggers>
<trigger group="scans"
<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")
EnableTrigger("scanOpen", false)</send>
end</send>
></trigger>
<trigger group="scans"
@ -71,7 +72,7 @@
</trigger>
<trigger group="scans"
match="{/scan}" name="scanClose"
match="{/scan}" name="scanClose" enabled="y"
omit_from_output="y" script="scanClosed" sequence="10" keep_evaluating="y">
></trigger>
</triggers>
@ -87,8 +88,11 @@ 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
@ -97,12 +101,12 @@ function scanMobs(name, line, wildcards)
end
if #checkNames > 0 then
EnableTrigger("scanOpen")
startScan = true
else
ColourNote("white", "black", "No mobs to scan for, executing regular scan.")
end
Send(scanCmd)
Send("scan")
end
function scannedDir(name, line, wildcards)
@ -124,9 +128,9 @@ function scanCheck(name, line, wildcards)
end
function scanClosed()
if startScan then
EnableTrigger("scanDir", false)
EnableTrigger("scanLine", false)
EnableTrigger("scanClose", false)
if #TSROutput > 0 then
for i,j in pairs(TSROutput) do
@ -140,6 +144,8 @@ function scanClosed()
else
ColourNote("white", "blue", "Nothing found!")
end
end
startScan = false
end
]]>
</script>

Loading…
Cancel
Save