diff --git a/ScanMobs/ScanMobs.xml b/ScanMobs/ScanMobs.xml index 8fbd280..685edd3 100644 --- a/ScanMobs/ScanMobs.xml +++ b/ScanMobs/ScanMobs.xml @@ -32,16 +32,17 @@ - + if startScan then TSROutput = {} dirTemp = {} EnableTrigger("scanDir") EnableTrigger("scanLine") EnableTrigger("scanClose") - EnableTrigger("scanOpen", false) + end > > @@ -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,22 +128,24 @@ function scanCheck(name, line, wildcards) 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("") + 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 - else - ColourNote("white", "blue", "Nothing found!") end + startScan = false end ]]>