diff --git a/modules/game_bot/bot.lua b/modules/game_bot/bot.lua index e8d22fa..9b01b6a 100644 --- a/modules/game_bot/bot.lua +++ b/modules/game_bot/bot.lua @@ -8,7 +8,6 @@ configEditorText = nil configList = nil botPanel = nil local botMessages = nil -local showingDocumentation = false local configCopy = "" local enableButton = nil local executeEvent = nil @@ -144,6 +143,16 @@ function online() end end +function offline() + botButton:hide() + configWindow:hide() + clearConfig() + removeEvent(executeEvent) + removeEvent(checkMsgsEvent) + executeEvent = nil + checkMsgsEvent = nil +end + function toggleBot() botConfig.enabled = not botConfig.enabled if botConfig.enabled then @@ -176,7 +185,6 @@ function editConfig() configEditorText:setEditable(true) activeTab = mainTab configTab:selectTab(mainTab) - showingDocumentation = false end local function split2(str, delimiter) diff --git a/modules/game_bot/config.otui b/modules/game_bot/config.otui index c165c2a..f2bccd6 100644 --- a/modules/game_bot/config.otui +++ b/modules/game_bot/config.otui @@ -9,7 +9,7 @@ ConfigTabBarPanel < MoveableTabBarPanel MainWindow id: configWindow - size: 650 500 + size: 650 497 !text: tr("Config editor") Label diff --git a/modules/game_bot/defaultconfig.lua b/modules/game_bot/defaultconfig.lua index e4a8017..ae10d1b 100644 --- a/modules/game_bot/defaultconfig.lua +++ b/modules/game_bot/defaultconfig.lua @@ -25,9 +25,6 @@ macro(5000, "macro send link", "f5", function() end) macro(1000, "flag tiles", function() - local staticText = StaticText.create() - staticText:addMessage("t", 9, "xDDD") - local tile = player:getTile() tile:setText("Hello =)", "red") end) diff --git a/modules/game_bot/executor.lua b/modules/game_bot/executor.lua index 856073a..588fee7 100644 --- a/modules/game_bot/executor.lua +++ b/modules/game_bot/executor.lua @@ -155,6 +155,7 @@ function executeBot(config, storage, panel, msgCallback) hotkey = hotkey, switch = switch }) + return context._macros[#context._macros] end -- hotkey(keys, callback) @@ -184,6 +185,7 @@ function executeBot(config, storage, panel, msgCallback) switch = switch, single = false } + return context._hotkeys[keys] end -- singlehotkey(keys, callback) @@ -213,6 +215,7 @@ function executeBot(config, storage, panel, msgCallback) switch = switch, single = true } + return context._hotkeys[keys] end -- schedule(timeout, callback) @@ -283,7 +286,7 @@ function executeBot(config, storage, panel, msgCallback) end) end - -- delay(duration) + -- delay(duration) -- block execution of current macro/hotkey/callback for x milliseconds context.delay = function(duration) if not context._currentExecution then return context.error("Invalid usage of delay function, it should be used inside callbacks") diff --git a/modules/game_features/features.lua b/modules/game_features/features.lua index b23f809..aa6c0c2 100644 --- a/modules/game_features/features.lua +++ b/modules/game_features/features.lua @@ -10,7 +10,8 @@ function updateFeatures(version) g_game.resetFeatures() -- you can add custom features here, list of them in modules\gamelib\const.lua - g_game.getFeature(GameBot) + g_game.enableFeature(GameBot) + --g_game.enableFeature(GameMinimapLimitedToSingleFloor) if(version >= 770) then g_game.enableFeature(GameLooktypeU16); diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index c1cab29..e6fb0dd 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -279,10 +279,11 @@ end function onUseWith(clickedWidget, mousePosition) if clickedWidget:getClassName() == 'UIGameMap' then local tile = clickedWidget:getTile(mousePosition) - if tile then - if selectedThing:isFluidContainer() then + if tile then + if selectedThing:isFluidContainer() or selectedThing:isMultiUse() then g_game.useWith(selectedThing, tile:getTopMultiUseThing(), selectedSubtype) else + print("normal") g_game.useWith(selectedThing, tile:getTopUseThing(), selectedSubtype) end end diff --git a/modules/gamelib/const.lua b/modules/gamelib/const.lua index 145489a..bc7863c 100644 --- a/modules/gamelib/const.lua +++ b/modules/gamelib/const.lua @@ -159,6 +159,7 @@ GameAdditionalSkills = 76 GameDistanceEffectU16 = 77 GameExtendedOpcode = 80 +GameMinimapLimitedToSingleFloor = 81 GameNewWalking = 90 GameSlowerManualWalking = 91 diff --git a/otclient_dx.exe b/otclient_dx.exe index 92e6e5d..db659b6 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index ef00001..d9466ec 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/pdb/otclient_dx.pdb b/pdb/otclient_dx.pdb index 9e68c12..c46d20d 100644 Binary files a/pdb/otclient_dx.pdb and b/pdb/otclient_dx.pdb differ diff --git a/pdb/otclient_gl.pdb b/pdb/otclient_gl.pdb index 7aacbad..b3b09e1 100644 Binary files a/pdb/otclient_gl.pdb and b/pdb/otclient_gl.pdb differ