summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/await.lua12
-rw-r--r--script-beta/parser/guide.lua6
2 files changed, 17 insertions, 1 deletions
diff --git a/script-beta/await.lua b/script-beta/await.lua
index c00e27e0..a26adff8 100644
--- a/script-beta/await.lua
+++ b/script-beta/await.lua
@@ -9,6 +9,7 @@ m.coMap = setmetatable({}, { __mode = 'k' })
m.idMap = {}
m.delayQueue = {}
m.delayQueueIndex = 1
+m._enable = true
--- 设置错误处理器
---@param errHandle function {comment = '当有错误发生时,会以错误堆栈为参数调用该函数'}
@@ -127,6 +128,9 @@ end
--- 延迟
function m.delay()
+ if not m._enable then
+ return
+ end
if not coroutine.isyieldable() then
return
end
@@ -169,4 +173,12 @@ function m.setPriority(n)
m.coMap[coroutine.running()].priority = true
end
+function m.enable()
+ m._enable = true
+end
+
+function m.disable()
+ m._enable = false
+end
+
return m
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 2e06c7ee..7a4f643c 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1987,13 +1987,17 @@ function m.searchSameFields(status, simple, mode)
start = 1,
}
end
- for i = 1, 999 do
+ local i = 0
+ local see = 0
+ while see <= 999 do
+ i = i + 1
local data = queue[i]
if not data then
return
end
if not status.lock[data.obj] then
status.lock[data.obj] = true
+ see = see + 1
status.cache.count = status.cache.count + 1
m.checkSameSimple(status, simple, data, mode, status.results, queue)
end