diff --git a/data/styles/40-gamebuttons.otui b/data/styles/40-gamebuttons.otui index 4afbeec..72b3c7a 100644 --- a/data/styles/40-gamebuttons.otui +++ b/data/styles/40-gamebuttons.otui @@ -1,2 +1,2 @@ GameButtonsWindow < MiniWindow - height: 40 + height: 26 diff --git a/layouts/retro/styles/40-gamebuttons.otui b/layouts/retro/styles/40-gamebuttons.otui index d65b140..a67c5e4 100644 --- a/layouts/retro/styles/40-gamebuttons.otui +++ b/layouts/retro/styles/40-gamebuttons.otui @@ -1,5 +1,5 @@ GameButtonsWindow < HeadlessMiniWindow - height: 52 + height: 26 &forceOpen: true &autoOpen: 4 diff --git a/modules/corelib/ui/uicombobox.lua b/modules/corelib/ui/uicombobox.lua index b1c0992..08fd9a2 100644 --- a/modules/corelib/ui/uicombobox.lua +++ b/modules/corelib/ui/uicombobox.lua @@ -135,7 +135,7 @@ function UIComboBox:onMousePress(mousePos, mouseButton) end function UIComboBox:onMouseWheel(mousePos, direction) - if not self.mouseScroll then + if not self.mouseScroll or self.disableScroll then return false end if direction == MouseWheelUp and self.currentIndex > 1 then diff --git a/modules/corelib/ui/uiscrollbar.lua b/modules/corelib/ui/uiscrollbar.lua index 76c2d07..b120dd7 100644 --- a/modules/corelib/ui/uiscrollbar.lua +++ b/modules/corelib/ui/uiscrollbar.lua @@ -254,7 +254,7 @@ function UIScrollBar:onGeometryChange() end function UIScrollBar:onMouseWheel(mousePos, mouseWheel) - if not self.mouseScroll or not self:isOn() then + if not self.mouseScroll or not self:isOn() or self.disableScroll then return false end if mouseWheel == MouseWheelUp then diff --git a/modules/corelib/ui/uispinbox.lua b/modules/corelib/ui/uispinbox.lua index 62b6b79..a644db4 100644 --- a/modules/corelib/ui/uispinbox.lua +++ b/modules/corelib/ui/uispinbox.lua @@ -23,7 +23,7 @@ function UISpinBox:onSetup() end function UISpinBox:onMouseWheel(mousePos, direction) - if not self.mouseScroll then + if not self.mouseScroll or self.disableScroll then return false end if direction == MouseWheelUp then diff --git a/modules/game_actionbar/actionbar.lua b/modules/game_actionbar/actionbar.lua index c1b4e4c..43b88a2 100644 --- a/modules/game_actionbar/actionbar.lua +++ b/modules/game_actionbar/actionbar.lua @@ -299,7 +299,7 @@ function actionOnMouseRelease(action, mousePosition, mouseButton) end function actionOnItemChange(widget) - updateAction(widget:getParent(), {text="", item=widget:getItemId(), count=widget:getItemCount()}) + updateAction(widget:getParent(), {text="", item=widget:getItemId(), count=widget:getItemCountOrSubType()}) end function onSpellCooldown(iconId, duration) @@ -366,8 +366,8 @@ function executeAction(action, ticks) action.actionDelayTo = g_clock.millis() + actionDelay elseif action.item:getItemId() > 0 then if actionType == ActionTypes.USE then - if g_game.getClientVersion() < 740 then - local item = g_game.findPlayerItem(action.item:getItemId(), hotKey.subType or -1) + if g_game.getClientVersion() < 780 then + local item = g_game.findPlayerItem(action.item:getItemId(), action.item:getItemSubType() or -1) if item then g_game.use(item) end @@ -376,8 +376,8 @@ function executeAction(action, ticks) end action.actionDelayTo = g_clock.millis() + actionDelay elseif actionType == ActionTypes.USE_SELF then - if g_game.getClientVersion() < 740 then - local item = g_game.findPlayerItem(action.item:getItemId(), hotKey.subType or -1) + if g_game.getClientVersion() < 780 then + local item = g_game.findPlayerItem(action.item:getItemId(), action.item:getItemSubType() or -1) if item then g_game.useWith(item, g_game.getLocalPlayer()) end @@ -389,7 +389,7 @@ function executeAction(action, ticks) local attackingCreature = g_game.getAttackingCreature() if not attackingCreature then local item = Item.create(action.item:getItemId()) - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local tmpItem = g_game.findPlayerItem(action.item:getItemId(), action.item:getItemSubType() or -1) if not tmpItem then return end item = tmpItem @@ -400,7 +400,7 @@ function executeAction(action, ticks) end if not attackingCreature:getTile() then return end - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local item = g_game.findPlayerItem(action.item:getItemId(), action.item:getItemSubType() or -1) if item then g_game.useWith(item, attackingCreature, action.item:getItemSubType() or -1) @@ -411,7 +411,7 @@ function executeAction(action, ticks) action.actionDelayTo = g_clock.millis() + actionDelay elseif actionType == ActionTypes.USE_WITH then local item = Item.create(action.item:getItemId()) - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local tmpItem = g_game.findPlayerItem(action.item:getItemId(), action.item:getItemSubType() or -1) if not tmpItem then return true end item = tmpItem diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot.lua diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/actions.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/actions.lua similarity index 99% rename from modules/game_bot/default_configs/new_cavebot/cavebot/actions.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/actions.lua index d4a86aa..ae42fa3 100644 --- a/modules/game_bot/default_configs/new_cavebot/cavebot/actions.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/cavebot/actions.lua @@ -7,6 +7,9 @@ CaveBot.addAction = function(action, value, focus) if not raction then return error("Invalid cavebot action: " .. action) end + if type(value) == 'number' then + value = tostring(value) + end local widget = UI.createWidget("CaveBotAction", CaveBot.actionList) widget:setText(action .. ":" .. value:split("\n")[1]) widget.action = action diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/cavebot.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/cavebot.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/cavebot.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/cavebot.lua diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/cavebot.otui b/modules/game_bot/default_configs/cavebot_1.1/cavebot/cavebot.otui similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/cavebot.otui rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/cavebot.otui diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/depositer.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/depositer.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/depositer.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/depositer.lua diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/editor.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/editor.lua similarity index 99% rename from modules/game_bot/default_configs/new_cavebot/cavebot/editor.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/editor.lua index e27b6cb..1fb4e76 100644 --- a/modules/game_bot/default_configs/new_cavebot/cavebot/editor.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/cavebot/editor.lua @@ -38,6 +38,7 @@ CaveBot.Editor.registerAction = function(action, text, params) end local widget = CaveBot.addAction(action, value) CaveBot.actionList:moveChildToIndex(widget, index + 1) + CaveBot.actionList:focusChild(widget) CaveBot.save() end) end @@ -58,6 +59,11 @@ CaveBot.Editor.setup = function() CaveBot.actionList:ensureChildVisible(action) CaveBot.save() end) + registerAction("edit", function() + local action = CaveBot.actionList:getFocusedChild() + if not action or not action.onDoubleClick then return end + action.onDoubleClick(action) + end) registerAction("move down", function() local action = CaveBot.actionList:getFocusedChild() if not action then return end @@ -67,11 +73,6 @@ CaveBot.Editor.setup = function() CaveBot.actionList:ensureChildVisible(action) CaveBot.save() end) - registerAction("edit", function() - local action = CaveBot.actionList:getFocusedChild() - if not action or not action.onDoubleClick then return end - action.onDoubleClick(action) - end) registerAction("remove", function() local action = CaveBot.actionList:getFocusedChild() if not action then return end diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/editor.otui b/modules/game_bot/default_configs/cavebot_1.1/cavebot/editor.otui similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/editor.otui rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/editor.otui diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/example_functions.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/example_functions.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/example_functions.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/example_functions.lua diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/extension_template.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/extension_template.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/extension_template.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/extension_template.lua diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/recorder.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/recorder.lua similarity index 94% rename from modules/game_bot/default_configs/new_cavebot/cavebot/recorder.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/recorder.lua index f0fffc1..1e67150 100644 --- a/modules/game_bot/default_configs/new_cavebot/cavebot/recorder.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/cavebot/recorder.lua @@ -26,10 +26,7 @@ local function setup() onUse(function(pos, itemId, stackPos, subType) if CaveBot.isOn() or not isEnabled then return end - if pos.x == 0xFFFF then - lastPos = pos - CaveBot.addAction("use", itemId, true) - else + if pos.x ~= 0xFFFF then lastPos = pos CaveBot.addAction("use", pos.x .. "," .. pos.y .. "," .. pos.z, true) end diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/supply.lua b/modules/game_bot/default_configs/cavebot_1.1/cavebot/supply.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/supply.lua rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/supply.lua diff --git a/modules/game_bot/default_configs/new_cavebot/cavebot/supply.otui b/modules/game_bot/default_configs/cavebot_1.1/cavebot/supply.otui similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/cavebot/supply.otui rename to modules/game_bot/default_configs/cavebot_1.1/cavebot/supply.otui diff --git a/modules/game_bot/default_configs/new_cavebot/hp.lua b/modules/game_bot/default_configs/cavebot_1.1/hp.lua similarity index 88% rename from modules/game_bot/default_configs/new_cavebot/hp.lua rename to modules/game_bot/default_configs/cavebot_1.1/hp.lua index 1ae7027..43a001d 100644 --- a/modules/game_bot/default_configs/new_cavebot/hp.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/hp.lua @@ -58,9 +58,14 @@ for i, healingInfo in ipairs({storage.hpitem1, storage.hpitem2, storage.manaitem local hp = i <= 2 and player:getHealthPercent() or math.min(100, math.floor(100 * (player:getMana() / player:getMaxMana()))) if healingInfo.max >= hp and hp >= healingInfo.min then if TargetBot then - TargetBot.useItem(healingInfo.item, player) -- sync spell with targetbot if available + TargetBot.useItem(healingInfo.item, healingInfo.subType, player) -- sync spell with targetbot if available else - useWith(healingInfo.item, player) + local thing = g_things.getThingType(healingInfo.item) + local subType = g_game.getClientVersion() >= 860 and 0 or 1 + if thing and thing:isFluidContainer() then + subType = healingInfo.subType + end + g_game.useInventoryItemWith(healingInfo.item, player, subType) end end end) @@ -68,10 +73,14 @@ for i, healingInfo in ipairs({storage.hpitem1, storage.hpitem2, storage.manaitem UI.DualScrollItemPanel(healingInfo, function(widget, newParams) healingInfo = newParams - healingmacro.setOn(healingInfo.on) + healingmacro.setOn(healingInfo.on and healingInfo.item > 100) end) end +if g_game.getClientVersion() < 780 then + UI.Label("In old tibia potions & runes work only when you have backpack with them opened") +end + UI.Separator() UI.Label("Mana shield spell:") @@ -143,6 +152,7 @@ macro(10000, "eat food", function() end end -- can't find any food, try to eat random item using hotkey + if g_game.getClientVersion() < 780 then return end -- hotkey's dont work on old tibia local toEat = storage.foodItems[math.random(1, #storage.foodItems)] if toEat then g_game.useInventoryItem(toEat.id) end end) diff --git a/modules/game_bot/default_configs/new_cavebot/main.lua b/modules/game_bot/default_configs/cavebot_1.1/main.lua similarity index 95% rename from modules/game_bot/default_configs/new_cavebot/main.lua rename to modules/game_bot/default_configs/cavebot_1.1/main.lua index 9f6b6e9..cd976c2 100644 --- a/modules/game_bot/default_configs/new_cavebot/main.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/main.lua @@ -1,5 +1,5 @@ -- main tab -VERSION = "1.0" +VERSION = "1.1" UI.Label("Config version: " .. VERSION) diff --git a/modules/game_bot/default_configs/new_cavebot/mwall_timer.lua b/modules/game_bot/default_configs/cavebot_1.1/mwall_timer.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/mwall_timer.lua rename to modules/game_bot/default_configs/cavebot_1.1/mwall_timer.lua diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/creature.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/targetbot/creature.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/creature.lua diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/creature_attack.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_attack.lua similarity index 96% rename from modules/game_bot/default_configs/new_cavebot/targetbot/creature_attack.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_attack.lua index e01b9e8..ef2b6b8 100644 --- a/modules/game_bot/default_configs/new_cavebot/targetbot/creature_attack.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_attack.lua @@ -39,7 +39,7 @@ TargetBot.Creature.attack = function(params, targets, isLooting) -- params {conf end end if config.useRuneAttack and config.attackRune > 100 then - if TargetBot.useAttackItem(config.attackRune, creature, config.attackRuneDelay) then + if TargetBot.useAttackItem(config.attackRune, 0, creature, config.attackRuneDelay) then return end end diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/creature_editor.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_editor.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/targetbot/creature_editor.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_editor.lua diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/creature_editor.otui b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_editor.otui similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/targetbot/creature_editor.otui rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_editor.otui diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/creature_priority.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_priority.lua similarity index 91% rename from modules/game_bot/default_configs/new_cavebot/targetbot/creature_priority.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_priority.lua index 7a72c69..dcc2f81 100644 --- a/modules/game_bot/default_configs/new_cavebot/targetbot/creature_priority.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/targetbot/creature_priority.lua @@ -1,6 +1,6 @@ TargetBot.Creature.calculatePriority = function(creature, config, path) -- config is based on creature_editor - local priority = config.priority + local priority = 0 -- extra priority if it's current target if g_game.getAttackingCreature() == creature then @@ -11,6 +11,9 @@ TargetBot.Creature.calculatePriority = function(creature, config, path) if #path > config.maxDistance then return priority end + + -- add config priority + priority = priority + config.priority -- extra priority for close distance local path_length = #path diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/looting.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/looting.lua similarity index 99% rename from modules/game_bot/default_configs/new_cavebot/targetbot/looting.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/looting.lua index b855aa6..a763b08 100644 --- a/modules/game_bot/default_configs/new_cavebot/targetbot/looting.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/targetbot/looting.lua @@ -237,7 +237,7 @@ TargetBot.Looting.lootContainer = function(lootContainers, container) if nextContainer.lootTries < 2 then -- max 0.6s to open it g_game.open(nextContainer, container) waitTill = now + 300 -- give it 0.3s to open - waitingForContainer = loot.container + waitingForContainer = nextContainer:getId() return end end diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/looting.otui b/modules/game_bot/default_configs/cavebot_1.1/targetbot/looting.otui similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/targetbot/looting.otui rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/looting.otui diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/target.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/target.lua similarity index 83% rename from modules/game_bot/default_configs/new_cavebot/targetbot/target.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/target.lua index 495d9ec..639c319 100644 --- a/modules/game_bot/default_configs/new_cavebot/targetbot/target.lua +++ b/modules/game_bot/default_configs/cavebot_1.1/targetbot/target.lua @@ -216,16 +216,41 @@ TargetBot.sayAttackSpell = function(text, delay) return false end +local lastItemUse = 0 local lastRuneAttack = 0 -TargetBot.useItem = function(item, target, delay) - useWith(item, target) +TargetBot.useItem = function(item, subType, target, delay) + if not delay then delay = 200 end + if lastItemUse + delay < now then + local thing = g_things.getThingType(item) + if not thing or not thing:isFluidContainer() then + subType = g_game.getClientVersion() >= 860 and 0 or 1 + end + if g_game.getClientVersion() < 780 then + local tmpItem = g_game.findPlayerItem(item, subType) + if not tmpItem then return end + g_game.useWith(tmpItem, target, subType) -- using item from bp + else + g_game.useInventoryItemWith(item, target, subType) -- hotkey + end + lastItemUse = now + end end -TargetBot.useAttackItem = function(item, target, delay) +TargetBot.useAttackItem = function(item, subType, target, delay) if not delay then delay = 2000 end if lastRuneAttack + delay < now then - useWith(item, target) + local thing = g_things.getThingType(item) + if not thing or not thing:isFluidContainer() then + subType = g_game.getClientVersion() >= 860 and 0 or 1 + end + if g_game.getClientVersion() < 780 then + local tmpItem = g_game.findPlayerItem(item, subType) + if not tmpItem then return end + g_game.useWith(tmpItem, target, subType) -- using item from bp + else + g_game.useInventoryItemWith(healingInfo.item, target, subType) -- hotkey + end lastRuneAttack = now end end diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/target.otui b/modules/game_bot/default_configs/cavebot_1.1/targetbot/target.otui similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/targetbot/target.otui rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/target.otui diff --git a/modules/game_bot/default_configs/new_cavebot/targetbot/walking.lua b/modules/game_bot/default_configs/cavebot_1.1/targetbot/walking.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/targetbot/walking.lua rename to modules/game_bot/default_configs/cavebot_1.1/targetbot/walking.lua diff --git a/modules/game_bot/default_configs/new_cavebot/tools.lua b/modules/game_bot/default_configs/cavebot_1.1/tools.lua similarity index 100% rename from modules/game_bot/default_configs/new_cavebot/tools.lua rename to modules/game_bot/default_configs/cavebot_1.1/tools.lua diff --git a/modules/game_bot/default_configs/new_cavebot/README.md b/modules/game_bot/default_configs/new_cavebot/README.md deleted file mode 100644 index 5f3946e..0000000 --- a/modules/game_bot/default_configs/new_cavebot/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Default config for OTClientV8 bot (min. otcv8 version 2.2.3) - -### Website: http://bot.otclient.ovh/ -### Forum: https://otland.net/forums/otclient.494/ -### Discord: https://discord.gg/t4ntS5p diff --git a/modules/game_bot/executor.lua b/modules/game_bot/executor.lua index 7492f14..d663dab 100644 --- a/modules/game_bot/executor.lua +++ b/modules/game_bot/executor.lua @@ -95,6 +95,7 @@ function executeBot(config, storage, tabs, msgCallback, saveConfigCallback, relo context.g_sounds = g_sounds context.g_window = g_window context.g_mouse = g_mouse + context.g_things = g_things context.Item = Item context.Creature = Creature diff --git a/modules/game_bot/functions/ui_elements.lua b/modules/game_bot/functions/ui_elements.lua index 5065feb..af34bfa 100644 --- a/modules/game_bot/functions/ui_elements.lua +++ b/modules/game_bot/functions/ui_elements.lua @@ -150,12 +150,14 @@ UI.DualScrollItemPanel = function(params, callback, parent) -- callback = functi --[[ params: on - bool, item - number, + subType - number, title - string, min - number, max - number, ]] params.title = params.title or "title" params.item = params.item or 0 + params.subType = params.subType or 0 params.min = params.min or 20 params.max = params.max or 80 @@ -170,9 +172,10 @@ UI.DualScrollItemPanel = function(params, callback, parent) -- callback = functi end end - widget.item:setItemId(params.item) + widget.item:setItem(Item.create(params.item, params.subType)) widget.item.onItemChange = function() params.item = widget.item:getItemId() + params.subType = widget.item:getItemSubType() if callback then callback(widget, params) end diff --git a/modules/game_bot/ui/panels.otui b/modules/game_bot/ui/panels.otui index e113947..82115e6 100644 --- a/modules/game_bot/ui/panels.otui +++ b/modules/game_bot/ui/panels.otui @@ -19,6 +19,7 @@ DualScrollPanel < Panel minimum: 0 maximum: 100 step: 1 + &disableScroll: true HorizontalScrollBar id: scroll2 @@ -29,6 +30,7 @@ DualScrollPanel < Panel minimum: 0 maximum: 100 step: 1 + &disableScroll: true BotTextEdit id: text @@ -66,6 +68,7 @@ SingleScrollItemPanel < Panel minimum: 0 maximum: 100 step: 1 + &disableScroll: true DualScrollItemPanel < Panel height: 33 @@ -95,6 +98,7 @@ DualScrollItemPanel < Panel minimum: 0 maximum: 100 step: 1 + &disableScroll: true HorizontalScrollBar id: scroll2 @@ -105,6 +109,7 @@ DualScrollItemPanel < Panel minimum: 0 maximum: 100 step: 1 + &disableScroll: true ItemsRow < Panel height: 33 @@ -197,6 +202,7 @@ ItemAndSlotPanel < Panel anchors.top: prev.bottom margin-top: 2 height: 20 + &disableScroll: true TwoItemsAndSlotPanel < Panel height: 35 @@ -230,4 +236,5 @@ TwoItemsAndSlotPanel < Panel anchors.top: prev.bottom margin-top: 2 height: 20 + &disableScroll: true \ No newline at end of file diff --git a/modules/game_buttons/buttons.lua b/modules/game_buttons/buttons.lua index 57af9ab..49a1385 100644 --- a/modules/game_buttons/buttons.lua +++ b/modules/game_buttons/buttons.lua @@ -36,5 +36,14 @@ function updateOrder() table.sort(children, function(a, b) return (a.index or 1000) < (b.index or 1000) end) - contentsPanel.buttons:reorderChildren(children) + contentsPanel.buttons:reorderChildren(children) + local visibleCount = 0 + for _, child in ipairs(children) do + if child:isVisible() then + visibleCount = visibleCount + 1 + end + end + if visibleCount > 6 and buttonsWindow:getHeight() < 30 then + buttonsWindow:setHeight(buttonsWindow:getHeight() + 22) + end end \ No newline at end of file diff --git a/modules/game_hotkeys/hotkeys_manager.lua b/modules/game_hotkeys/hotkeys_manager.lua index e85c388..9060ec8 100644 --- a/modules/game_hotkeys/hotkeys_manager.lua +++ b/modules/game_hotkeys/hotkeys_manager.lua @@ -459,7 +459,7 @@ function doKeyCombo(keyCombo, repeated) end hotKey.hotkeyDelayTo = g_clock.millis() + hotkeyDelay elseif hotKey.useType == HOTKEY_MANAGER_USE then - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1) if item then g_game.use(item) @@ -469,7 +469,7 @@ function doKeyCombo(keyCombo, repeated) end hotKey.hotkeyDelayTo = g_clock.millis() + hotkeyDelay elseif hotKey.useType == HOTKEY_MANAGER_USEONSELF then - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1) if item then g_game.useWith(item, g_game.getLocalPlayer()) @@ -482,7 +482,7 @@ function doKeyCombo(keyCombo, repeated) local attackingCreature = g_game.getAttackingCreature() if not attackingCreature then local item = Item.create(hotKey.itemId) - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local tmpItem = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1) if not tmpItem then return end item = tmpItem @@ -493,7 +493,7 @@ function doKeyCombo(keyCombo, repeated) end if not attackingCreature:getTile() then return end - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1) if item then g_game.useWith(item, attackingCreature, hotKey.subType or -1) @@ -504,7 +504,7 @@ function doKeyCombo(keyCombo, repeated) hotKey.hotkeyDelayTo = g_clock.millis() + hotkeyDelay elseif hotKey.useType == HOTKEY_MANAGER_USEWITH then local item = Item.create(hotKey.itemId) - if g_game.getClientVersion() < 740 then + if g_game.getClientVersion() < 780 then local tmpItem = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1) if not tmpItem then return true end item = tmpItem diff --git a/modules/game_walking/walking.lua b/modules/game_walking/walking.lua index eabd547..63f756b 100644 --- a/modules/game_walking/walking.lua +++ b/modules/game_walking/walking.lua @@ -376,7 +376,7 @@ function walk(dir, ticks) g_game.stop() return else - return + player:lockWalk(200) end end diff --git a/modules/gamelib/ui/uiitem.lua b/modules/gamelib/ui/uiitem.lua index 6cbcf57..089a81b 100644 --- a/modules/gamelib/ui/uiitem.lua +++ b/modules/gamelib/ui/uiitem.lua @@ -26,7 +26,7 @@ function UIItem:onDrop(widget, mousePos, forced) if not item or not item:isItem() then return false end if self.selectable then - self:setItem(Item.create(item:getId(), item:getCount())) + self:setItem(Item.create(item:getId(), item:getCountOrSubType())) return end diff --git a/otclient_dx.exe b/otclient_dx.exe index ed312f2..1cace49 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index 280c5b2..8ed210b 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/otclient_linux b/otclient_linux index dcb0c0c..9347d3f 100644 Binary files a/otclient_linux and b/otclient_linux differ diff --git a/pdb/pdb.7z b/pdb/pdb.7z index f2fac5b..439c5c0 100644 Binary files a/pdb/pdb.7z and b/pdb/pdb.7z differ