From c7e56c04bb0970e150dee5283ef69b0881c9d5cc Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:55:13 -0300 Subject: [PATCH 1/6] fix: drop item bot --- modules/game_interface/widgets/uiitem.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index 274cd733cb..67b98ad401 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -43,6 +43,14 @@ function UIItem:onDrop(widget, mousePos) if not(toPos) and self:getParent() and self:getParent().slotPosition then toPos = self:getParent().slotPosition end + + if not g_game.isEnabledBotProtection() and self.selectable then + if item:isPickupable() then + self:setItem(Item.create(item:getId(), item:getCountOrSubType())) + return true + end + return false + end if not itemPos or not toPos then local pressedWidget = g_ui.getPressedWidget() local rootWidget = g_ui.getRootWidget() @@ -170,8 +178,15 @@ function UIItem:onMouseRelease(mousePosition, mouseButton) end function UIItem:canAcceptDrop(widget, mousePos) - if self:isVirtual() or not self:isDraggable() then - return false + + if not g_game.isEnabledBotProtection() then + if not self.selectable and (self:isVirtual() or not self:isDraggable()) then + return false + end + else + if self:isVirtual() or not self:isDraggable() then + return false + end end if not widget or not widget.currentDragThing then return false From 91dbac559503bd966164e4edbc7677f9b587e14e Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 21 Sep 2024 16:35:07 -0300 Subject: [PATCH 2/6] fix: chat analyzer --- .../default_configs/vBot_4.8/vBot/analyzer.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua b/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua index 76c5d3df08..8a2eff1f66 100644 --- a/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua +++ b/mods/game_bot/default_configs/vBot_4.8/vBot/analyzer.lua @@ -723,11 +723,10 @@ local expPerHour = function(calculation) end local function add(t, text, color, last) - table.insert(t, text) - table.insert(t, color) + local coloredText = "{" .. text .. ", " .. color .. "}" + table.insert(t, coloredText) if not last then - table.insert(t, ", ") - table.insert(t, "#FFFFFF") + table.insert(t, "{, , #FFFFFF}") end end @@ -958,7 +957,8 @@ onTextMessage(function(mode, text) local panel = console.consoleTabBar:getTabPanel(tab) local consoleBuffer = panel:getChildById('consoleBuffer') local message = consoleBuffer:getLastChild() - message:setColoredText(t) + message:setColoredText(table.concat(t)) + end) local function niceFormat(v) From 3f6545c977898010bf1e59f63db78e662dfb1a7b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 21 Sep 2024 17:03:26 -0300 Subject: [PATCH 3/6] ups jaja --- src/client/uiitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/uiitem.cpp b/src/client/uiitem.cpp index 4a7b1a2654..cfd59f3b19 100644 --- a/src/client/uiitem.cpp +++ b/src/client/uiitem.cpp @@ -74,7 +74,7 @@ void UIItem::setItemId(int id) m_item->setId(id); else m_item = Item::create(id); -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } @@ -82,7 +82,7 @@ void UIItem::setItemId(int id) void UIItem::setItemCount(int count) { if (m_item) m_item->setCount(count); -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } @@ -90,7 +90,7 @@ void UIItem::setItemCount(int count) void UIItem::setItemSubType(int subType) { if (m_item) m_item->setSubType(subType); -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } @@ -99,7 +99,7 @@ void UIItem::setItem(const ItemPtr& item) { m_item = item; -#ifdef BOT_PROTECTION +#ifndef BOT_PROTECTION callLuaField("onItemChange"); #endif } From 2adf2cbe0ac824f1a0671a7660cb9cc64f8f42e8 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 21 Sep 2024 17:13:36 -0300 Subject: [PATCH 4/6] format --- modules/game_interface/widgets/uiitem.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index 67b98ad401..9833749234 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -50,7 +50,7 @@ function UIItem:onDrop(widget, mousePos) return true end return false - end + end if not itemPos or not toPos then local pressedWidget = g_ui.getPressedWidget() local rootWidget = g_ui.getRootWidget() From 6d88c9432baa49cfddff956bb421e0109b5c869c Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 21 Sep 2024 17:14:26 -0300 Subject: [PATCH 5/6] Update uiitem.lua --- modules/game_interface/widgets/uiitem.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index 9833749234..c24be4ad69 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -178,7 +178,6 @@ function UIItem:onMouseRelease(mousePosition, mouseButton) end function UIItem:canAcceptDrop(widget, mousePos) - if not g_game.isEnabledBotProtection() then if not self.selectable and (self:isVirtual() or not self:isDraggable()) then return false @@ -188,6 +187,7 @@ function UIItem:canAcceptDrop(widget, mousePos) return false end end + if not widget or not widget.currentDragThing then return false end From d03952e8f24affe4023cf5f3e82ad0f5646f256a Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 21 Sep 2024 17:14:52 -0300 Subject: [PATCH 6/6] Update uiitem.lua --- modules/game_interface/widgets/uiitem.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index c24be4ad69..253cab6496 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -187,7 +187,6 @@ function UIItem:canAcceptDrop(widget, mousePos) return false end end - if not widget or not widget.currentDragThing then return false end