This commit is contained in:
OTCv8
2020-07-12 01:24:25 +02:00
parent 1729e7d635
commit f17ac1ec71
36 changed files with 1082 additions and 416 deletions

View File

@@ -335,7 +335,7 @@ function check()
return
end
checkEvent = scheduleEvent(check, 25)
checkEvent = scheduleEvent(check, 10)
local status, result = pcall(function()
return botExecutor.script()

View File

@@ -34,11 +34,16 @@ context.macro = function(timeout, name, hotkey, callback, parent)
hotkey = retranslateKeyComboDesc(hotkey)
end
-- min timeout is 50, to avoid lags
if timeout < 50 then
timeout = 50
end
table.insert(context._macros, {
enabled = false,
name = name,
timeout = timeout,
lastExecution = context.now,
lastExecution = context.now + math.random(0, 100),
hotkey = hotkey,
})
local macro = context._macros[#context._macros]

View File

@@ -5,11 +5,27 @@ context.getMapPanel = context.getMapView
context.zoomIn = function() modules.game_interface.getMapPanel():zoomIn() end
context.zoomOut = function() modules.game_interface.getMapPanel():zoomOut() end
context.getSpectators = function(multifloor)
if multifloor ~= true then
multifloor = false
context.getSpectators = function(param1, param2)
--[[
if param1 is table (position) then it's used for central position, then param2 is used as param1
if param1 is true/false then it's used for multifloor, example: getSpectators(true)
if param1 is string then it's used for getSpectatorsByPattern
]]--
local pos = context.player:getPosition()
if type(param1) == 'table' then
pos = param1
param1 = param2
end
return g_map.getSpectators(context.player:getPosition(), multifloor)
if type(param1) == 'string' then
return g_map.getSpectatorsByPattern(pos, param1)
end
local multifloor = false
if type(param1) == 'boolean' and param1 == true then
multifloor = true
end
return g_map.getSpectators(pos, multifloor)
end
context.getCreatureById = function(id, multifloor)

View File

@@ -161,3 +161,6 @@ context.cancelAttackAndFollow = g_game.cancelAttackAndFollow
context.logout = g_game.forceLogout
context.ping = g_game.getPing
modules.game_cooldown.isGroupCooldownIconActive(id)
modules.game_cooldown.isCooldownIconActive(id)

View File

@@ -32,6 +32,9 @@ context.getContainers = function() return g_game.getContainers() end
context.getContainer = function(index) return g_game.getContainer(index) end
context.moveToSlot = function(item, slot, count)
if type(item) == 'number' then
item = context.findItem(item)
end
if not item then
return
end