From 1fd4dc84de8bba6f86530135d19520128e4e4fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Ja=C5=82ocha?= Date: Mon, 13 Jan 2025 22:24:05 +0100 Subject: [PATCH 1/3] Remove bot protection macro --- README.md | 1 - init.lua | 4 - meta.lua | 13 +- modules/client_options/options.lua | 97 ++++++------ modules/client_options/styles/misc/misc.otui | 3 - modules/corelib/ui/uiminiwindow.lua | 22 +-- modules/corelib/ui/uiminiwindowcontainer.lua | 15 +- modules/game_interface/gameinterface.lua | 134 ++++++++--------- modules/game_interface/widgets/uiitem.lua | 27 ++-- src/CMakeLists.txt | 13 -- src/client/creature.cpp | 4 - src/client/creature.h | 4 - src/client/game.cpp | 18 +-- src/client/game.h | 8 - src/client/luafunctions.cpp | 7 - src/client/map.cpp | 4 +- src/client/map.h | 2 - src/client/mapview.cpp | 3 +- src/client/protocolgame.h | 1 - src/client/protocolgamesend.cpp | 9 -- src/client/tile.cpp | 10 +- src/client/tile.h | 5 +- src/client/uiitem.cpp | 11 +- src/framework/stdext/string.cpp | 8 - tools/make_snapshot.sh | 149 +++++++++---------- vc17/settings.props | 1 - 26 files changed, 215 insertions(+), 358 deletions(-) diff --git a/README.md b/README.md index 27a7425a18..586d3f7615 100644 --- a/README.md +++ b/README.md @@ -449,7 +449,6 @@ Beyond of it's flexibility with scripts, otclient comes with tons of other featu ##### 💸 Sponsored (Features) - Bot V8 ([@luanluciano93](https://github.com/luanluciano93), [@SkullzOTS](https://github.com/SkullzOTS), [@kokekanon](https://github.com/kokekanon), [@FranciskoKing](https://github.com/FranciskoKing), [@Kizuno18](https://github.com/Kizuno18)) - Is adapted in 85% - - To enable it, it is necessary to remove/off the BOT_PROTECTION flag. - [VS Solution](https://github.com/mehah/otclient/blob/68e4e1b94c2041bd235441244156e6477058250c/vc17/settings.props#L9) / [CMAKE](https://github.com/mehah/otclient/blob/68e4e1b94c2041bd235441244156e6477058250c/src/CMakeLists.txt#L13) - Shader with Framebuffer ([@SkullzOTS](https://github.com/SkullzOTS), [@Mryukiimaru](https://github.com/Mryukiimaru), [@JeanTheOne](https://github.com/JeanTheOne), [@KizaruHere](https://github.com/KizaruHere)) diff --git a/init.lua b/init.lua index 94464dd715..eef2100866 100644 --- a/init.lua +++ b/init.lua @@ -95,10 +95,6 @@ local function loadModules() g_modules.autoLoadModules(9999) g_modules.ensureModuleLoaded('client_mods') - if not g_game.isEnabledBotProtection() then - g_modules.ensureModuleLoaded('game_bot') - end - local script = '/' .. g_app.getCompactName() .. 'rc.lua' if g_resources.fileExists(script) then diff --git a/meta.lua b/meta.lua index 72c0f47ca6..965ebbe4ad 100644 --- a/meta.lua +++ b/meta.lua @@ -582,14 +582,12 @@ function g_map.getMinimapColor(pos) end ---@return boolean function g_map.isSightClear(fromPos, toPos) end ----* BOT_PROTECTION ---@param start Position | string ---@param maxDistance integer ---@param params table ---@return table function g_map.findEveryPath(start, maxDistance, params) end ----* BOT_PROTECTION ---@param centerPos Position | string ---@param pattern string ---@param direction integer @@ -700,7 +698,9 @@ g_game = {} ---@param characterName string ---@param authenticatorToken string ---@param sessionKey string -function g_game.loginWorld(account, password, worldName, worldHost, worldPort, characterName, authenticatorToken, sessionKey) end +function g_game.loginWorld(account, password, worldName, worldHost, worldPort, characterName, authenticatorToken, + sessionKey) +end function g_game.cancelLogin() end @@ -1158,9 +1158,6 @@ function g_game.enableTileThingLuaCallback(value) end ---@return boolean function g_game.isTileThingLuaCallbackEnabled() end ----@return boolean -function g_game.isEnabledBotProtection() end - ---@param itemId integer ---@param count number ---@param stackpos boolean @@ -1854,19 +1851,15 @@ function Creature:isFullHealth() end ---@return boolean function Creature:isCovered() end ----* !BOT_PROTECTION ---@param text string ---@param color Color | string function Creature:setText(text, color) end ----* !BOT_PROTECTION ---@return string function Creature:getText() end ----* !BOT_PROTECTION function Creature:clearText() end ----* !BOT_PROTECTION ---@param distance integer ---@return boolean function Creature:canShoot(distance) end diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index d89f726e7f..892994214f 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -12,34 +12,34 @@ panels = { keybindsPanel = nil } -- LuaFormatter off -local buttons = {{ +local buttons = { { text = "Controls", icon = "/images/icons/icon_controls", open = "generalPanel", - subCategories = {{ + subCategories = { { text = "General Hotkeys", open = "keybindsPanel" - }} + } } }, { text = "Interface", icon = "/images/icons/icon_interface", open = "interface", - subCategories = {{ + subCategories = { { text = "HUD", open = "interfaceHUD" }, { text = "Console", open = "interfaceConsole" - }} + } } }, { text = "Graphics", icon = "/images/icons/icon_graphics", open = "graphicsPanel", - subCategories = {{ + subCategories = { { text = "Effects", open = "graphicsEffectsPanel" - }} + } } }, { text = "Sound", icon = "/images/icons/icon_sound", @@ -64,8 +64,8 @@ local buttons = {{ }, ]] { text = "Help", open = "miscHelp" - }} -}} + } } +} } -- LuaFormatter on local extraWidgets = { @@ -137,16 +137,14 @@ local function setupComboBox() setOption('framesRarity', comboBox:getCurrentOption().data) end - if not g_game.isEnabledBotProtection() then - local profileCombobox = panels.misc:recursiveGetChildById('profile') + local profileCombobox = panels.misc:recursiveGetChildById('profile') - for i = 1, 10 do - profileCombobox:addOption(tostring(i), i) - end + for i = 1, 10 do + profileCombobox:addOption(tostring(i), i) + end - profileCombobox.onOptionChange = function(comboBox, option) - setOption('profile', comboBox:getCurrentOption().data) - end + profileCombobox.onOptionChange = function(comboBox, option) + setOption('profile', comboBox:getCurrentOption().data) end for _, preset in ipairs(Keybind.presets) do @@ -192,28 +190,28 @@ function controller:onInit() extraWidgets.audioButton = modules.client_topmenu.addTopRightToggleButton('audioButton', tr('Audio'), '/images/topbuttons/button_mute_up', function() toggleOption('enableAudio') end) - + extraWidgets.optionsButton = modules.client_topmenu.addTopRightToggleButton('optionsButton', tr('Options'), '/images/topbuttons/button_options', toggle) extraWidgets.logoutButton = modules.client_topmenu.addTopRightToggleButton('logoutButton', tr('Exit'), - '/images/topbuttons/logout', toggle) - - panels.generalPanel = g_ui.loadUI('styles/controls/general',controller.ui.optionsTabContent) - panels.keybindsPanel = g_ui.loadUI('styles/controls/keybinds',controller.ui.optionsTabContent) - - panels.graphicsPanel = g_ui.loadUI('styles/graphics/graphics',controller.ui.optionsTabContent) - panels.graphicsEffectsPanel = g_ui.loadUI('styles/graphics/effects',controller.ui.optionsTabContent) - - panels.interface = g_ui.loadUI('styles/interface/interface',controller.ui.optionsTabContent) - panels.interfaceConsole = g_ui.loadUI('styles/interface/console',controller.ui.optionsTabContent) - panels.interfaceHUD = g_ui.loadUI('styles/interface/HUD',controller.ui.optionsTabContent) - - panels.soundPanel = g_ui.loadUI('styles/sound/audio',controller.ui.optionsTabContent) - - panels.misc = g_ui.loadUI('styles/misc/misc',controller.ui.optionsTabContent) - panels.miscHelp = g_ui.loadUI('styles/misc/help',controller.ui.optionsTabContent) - + '/images/topbuttons/logout', toggle) + + panels.generalPanel = g_ui.loadUI('styles/controls/general', controller.ui.optionsTabContent) + panels.keybindsPanel = g_ui.loadUI('styles/controls/keybinds', controller.ui.optionsTabContent) + + panels.graphicsPanel = g_ui.loadUI('styles/graphics/graphics', controller.ui.optionsTabContent) + panels.graphicsEffectsPanel = g_ui.loadUI('styles/graphics/effects', controller.ui.optionsTabContent) + + panels.interface = g_ui.loadUI('styles/interface/interface', controller.ui.optionsTabContent) + panels.interfaceConsole = g_ui.loadUI('styles/interface/console', controller.ui.optionsTabContent) + panels.interfaceHUD = g_ui.loadUI('styles/interface/HUD', controller.ui.optionsTabContent) + + panels.soundPanel = g_ui.loadUI('styles/sound/audio', controller.ui.optionsTabContent) + + panels.misc = g_ui.loadUI('styles/misc/misc', controller.ui.optionsTabContent) + panels.miscHelp = g_ui.loadUI('styles/misc/help', controller.ui.optionsTabContent) + self.ui:hide() configureCharacterCategories() @@ -222,34 +220,34 @@ function controller:onInit() Keybind.new("UI", "Toggle Fullscreen", "Ctrl+Shift+F", "") Keybind.bind("UI", "Toggle Fullscreen", { - { - type = KEY_DOWN, - callback = function() toggleOption('fullscreen') end, - } + { + type = KEY_DOWN, + callback = function() toggleOption('fullscreen') end, + } }) Keybind.new("UI", "Show/hide FPS / lag indicator", "", "") - Keybind.bind("UI", "Show/hide FPS / lag indicator", {{ + Keybind.bind("UI", "Show/hide FPS / lag indicator", { { type = KEY_DOWN, callback = function() toggleOption('showPing') toggleOption('showFps') end - }}) + } }) Keybind.new("UI", "Show/hide Creature Names and Bars", "Ctrl+N", "") Keybind.bind("UI", "Show/hide Creature Names and Bars", { - { - type = KEY_DOWN, - callback = toggleDisplays, - } + { + type = KEY_DOWN, + callback = toggleDisplays, + } }) Keybind.new("Sound", "Mute/unmute", "", "") Keybind.bind("Sound", "Mute/unmute", { - { - type = KEY_DOWN, - callback = function() toggleOption('enableAudio') end, - } + { + type = KEY_DOWN, + callback = function() toggleOption('enableAudio') end, + } }) end @@ -485,7 +483,6 @@ function configureCharacterCategories() end close(oldOpen) - end if parent.subCategoriesSize then diff --git a/modules/client_options/styles/misc/misc.otui b/modules/client_options/styles/misc/misc.otui index 8e7ec87278..9347eb2b5a 100644 --- a/modules/client_options/styles/misc/misc.otui +++ b/modules/client_options/styles/misc/misc.otui @@ -25,6 +25,3 @@ UIWidget anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom - - @onSetup: | - self:getParent():setVisible(not g_game.isEnabledBotProtection()) diff --git a/modules/corelib/ui/uiminiwindow.lua b/modules/corelib/ui/uiminiwindow.lua index a6a8f0cfdf..9daee2a3bc 100644 --- a/modules/corelib/ui/uiminiwindow.lua +++ b/modules/corelib/ui/uiminiwindow.lua @@ -78,7 +78,6 @@ function UIMiniWindow:setup() end self:getChildById('minimizeButton').onClick = function() - if self:isOn() then self:maximize() else @@ -87,7 +86,6 @@ function UIMiniWindow:setup() end self:getChildById('lockButton').onClick = function() - if self:isDraggable() then self:lock() else @@ -118,7 +116,6 @@ function UIMiniWindow:setupOnStart() settings = { [char] = {} } - elseif not settings[char] then -- if there are no settings for this character, we'll copy the settings from -- another one, so we'll have something better than all the windows randomly positioned @@ -127,7 +124,6 @@ function UIMiniWindow:setupOnStart() g_settings.setNode('CharMiniWindows', settings) break end - end local selfSettings = settings[char][self:getId()] @@ -143,7 +139,6 @@ function UIMiniWindow:setupOnStart() self:setParent(parent, true) self:setPosition(topoint(selfSettings.position)) newParentSet = true - end end end @@ -190,13 +185,13 @@ function UIMiniWindow:setupOnStart() end self:fitOnParent() - if not g_game.isEnabledBotProtection() and self:getId() == "botWindow" then + if self:getId() == "botWindow" then local parent = self:getParent() local parentId = parent:getId() - - if parentId == "gameLeftPanel" or - parentId == "gameLeftExtraPanel" or - parentId == "gameRightExtraPanel" then + + if parentId == "gameLeftPanel" or + parentId == "gameLeftExtraPanel" or + parentId == "gameRightExtraPanel" then if parent:isVisible() then parent:setWidth(190) end @@ -420,7 +415,6 @@ function UIMiniWindow:saveParent(parent) self:saveParentPosition(parent:getId(), self:getPosition()) end end - end function UIMiniWindow:saveParentPosition(parentId, position) @@ -469,7 +463,7 @@ end function UIMiniWindow:setContentHeight(height) local contentsPanel = self:getChildById('contentsPanel') local minHeight = contentsPanel:getMarginTop() + contentsPanel:getMarginBottom() + contentsPanel:getPaddingTop() + - contentsPanel:getPaddingBottom() + contentsPanel:getPaddingBottom() local resizeBorder = self:getChildById('bottomResizeBorder') resizeBorder:setParentSize(minHeight + height) @@ -478,7 +472,7 @@ end function UIMiniWindow:setContentMinimumHeight(height) local contentsPanel = self:getChildById('contentsPanel') local minHeight = contentsPanel:getMarginTop() + contentsPanel:getMarginBottom() + contentsPanel:getPaddingTop() + - contentsPanel:getPaddingBottom() + contentsPanel:getPaddingBottom() local resizeBorder = self:getChildById('bottomResizeBorder') resizeBorder:setMinimum(minHeight + height) @@ -487,7 +481,7 @@ end function UIMiniWindow:setContentMaximumHeight(height) local contentsPanel = self:getChildById('contentsPanel') local minHeight = contentsPanel:getMarginTop() + contentsPanel:getMarginBottom() + contentsPanel:getPaddingTop() + - contentsPanel:getPaddingBottom() + contentsPanel:getPaddingBottom() local resizeBorder = self:getChildById('bottomResizeBorder') resizeBorder:setMaximum(minHeight + height) diff --git a/modules/corelib/ui/uiminiwindowcontainer.lua b/modules/corelib/ui/uiminiwindowcontainer.lua index 54ffa5902e..cc0144e9ee 100644 --- a/modules/corelib/ui/uiminiwindowcontainer.lua +++ b/modules/corelib/ui/uiminiwindowcontainer.lua @@ -95,7 +95,7 @@ function UIMiniWindowContainer:fits(child, minContentHeight, maxContentHeight) local containerPanel = child:getChildById('contentsPanel') local indispensableHeight = containerPanel:getMarginTop() + containerPanel:getMarginBottom() + - containerPanel:getPaddingTop() + containerPanel:getPaddingBottom() + containerPanel:getPaddingTop() + containerPanel:getPaddingBottom() local totalHeight = 0 local children = self:getChildren() @@ -117,7 +117,7 @@ function UIMiniWindowContainer:fits(child, minContentHeight, maxContentHeight) end function UIMiniWindowContainer:onDrop(widget, mousePos) - if (self.onlyPhantomDrop and not(widget.moveOnlyToMain)) or (widget.moveOnlyToMain and not(self.onlyPhantomDrop)) then + if (self.onlyPhantomDrop and not (widget.moveOnlyToMain)) or (widget.moveOnlyToMain and not (self.onlyPhantomDrop)) then return true end @@ -138,12 +138,10 @@ function UIMiniWindowContainer:onDrop(widget, mousePos) self:addChild(widget) end - if not g_game.isEnabledBotProtection() then - if widget:getId() == "botWindow" and - (widget:getParent():getId() == "gameLeftPanel" or widget:getParent():getId() == "gameLeftExtraPanel" or - widget:getParent():getId() == "gameRightExtraPanel") then - widget:getParent():setWidth(190) - end + if widget:getId() == "botWindow" and + (widget:getParent():getId() == "gameLeftPanel" or widget:getParent():getId() == "gameLeftExtraPanel" or + widget:getParent():getId() == "gameRightExtraPanel") then + widget:getParent():setWidth(190) end self:fitAll(widget) return true @@ -193,7 +191,6 @@ function UIMiniWindowContainer:scheduleInsert(widget, index) break end end - end end end diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 77f50ea350..5d7bf600ab 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -145,31 +145,31 @@ function bindKeys() Keybind.new("Movement", "Stop All Actions", "Esc", "", true) Keybind.bind("Movement", "Stop All Actions", { { - type = KEY_PRESS, - callback = function() - g_game.cancelAttackAndFollow() - end, + type = KEY_PRESS, + callback = function() + g_game.cancelAttackAndFollow() + end, } - }, gameRootPanel) - + }, gameRootPanel) + Keybind.new("Misc", "Logout", "Ctrl+L", "Ctrl+Q") Keybind.bind("Misc", "Logout", { { - type = KEY_PRESS, - callback = function() tryLogout(false) end, + type = KEY_PRESS, + callback = function() tryLogout(false) end, } - }, gameRootPanel) + }, gameRootPanel) Keybind.new("UI", "Clear All Texts", "Ctrl+W", "") Keybind.bind("UI", "Clear All Texts", { { - type = KEY_DOWN, - callback = function() - g_map.cleanTexts() - modules.game_textmessage.clearMessages() - end, + type = KEY_DOWN, + callback = function() + g_map.cleanTexts() + modules.game_textmessage.clearMessages() + end, } - }, gameRootPanel) + }, gameRootPanel) g_keyboard.bindKeyDown('Ctrl+.', nextViewMode, gameRootPanel) end @@ -803,16 +803,6 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing) end end - if not g_game.isEnabledBotProtection() and useThing and useThing:isItem() then - menu:addSeparator() - local useThingId = useThing:getId() - if useThing:getSubType() > 1 then - menu:addOption("ID: " .. useThingId .. " SubType: " .. g_window.getClipboardText(), function() end) - else - menu:addOption("ID: " .. useThingId, function() g_window.setClipboardText(useThingId) end) - end - end - if g_game.getFeature(GameThingQuickLoot) and modules.game_quickloot and lookThing and not lookThing:isCreature() and lookThing:isPickupable() then local quickLoot = modules.game_quickloot.QuickLoot menu.addSeparator(menu) @@ -841,59 +831,59 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u if g_platform.isMobile() then if mouseButton == MouseRightButton then createThingMenu(menuPosition, lookThing, useThing, creatureThing) - return true + return true end local shortcut = modules.game_shortcuts.getShortcut() if shortcut == "look" then - if lookThing then - modules.game_shortcuts.resetShortcuts() - g_game.look(lookThing) - return true - end - return true + if lookThing then + modules.game_shortcuts.resetShortcuts() + g_game.look(lookThing) + return true + end + return true elseif shortcut == "use" then - if useThing then - modules.game_shortcuts.resetShortcuts() - if useThing:isContainer() then - if useThing:getParentContainer() then - g_game.open(useThing, useThing:getParentContainer()) - else - g_game.open(useThing) - end - return true - elseif useThing:isMultiUse() then - startUseWith(useThing) - return true - else - g_game.use(useThing) - return true + if useThing then + modules.game_shortcuts.resetShortcuts() + if useThing:isContainer() then + if useThing:getParentContainer() then + g_game.open(useThing, useThing:getParentContainer()) + else + g_game.open(useThing) + end + return true + elseif useThing:isMultiUse() then + startUseWith(useThing) + return true + else + g_game.use(useThing) + return true + end end - end - return true - elseif shortcut == "attack" then - if attackCreature and attackCreature ~= player then - modules.game_shortcuts.resetShortcuts() - g_game.attack(attackCreature) return true - elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then - modules.game_shortcuts.resetShortcuts() - g_game.attack(creatureThing) + elseif shortcut == "attack" then + if attackCreature and attackCreature ~= player then + modules.game_shortcuts.resetShortcuts() + g_game.attack(attackCreature) + return true + elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then + modules.game_shortcuts.resetShortcuts() + g_game.attack(creatureThing) + return true + end return true - end - return true elseif shortcut == "follow" then - if attackCreature and attackCreature ~= player then - modules.game_shortcuts.resetShortcuts() - g_game.follow(attackCreature) - return true - elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then - modules.game_shortcuts.resetShortcuts() - g_game.follow(creatureThing) + if attackCreature and attackCreature ~= player then + modules.game_shortcuts.resetShortcuts() + g_game.follow(attackCreature) + return true + elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then + modules.game_shortcuts.resetShortcuts() + g_game.follow(creatureThing) + return true + end return true - end - return true elseif not autoWalkPos and useThing then - createThingMenu(menuPosition, lookThing, useThing, creatureThing) + createThingMenu(menuPosition, lookThing, useThing, creatureThing) return true end elseif not modules.client_options.getOption('classicControl') then @@ -1329,9 +1319,9 @@ function onDecreaseLeftPanels() if modules.client_options.getOption('showLeftExtraPanel') then modules.client_options.setOption('showLeftExtraPanel', false) movePanel(gameLeftExtraPanel) - if g_platform.isMobile() then - leftDecreaseSidePanels:setEnabled(false) - end + if g_platform.isMobile() then + leftDecreaseSidePanels:setEnabled(false) + end return end @@ -1374,4 +1364,4 @@ function checkAndOpenLeftPanel() modules.client_options.setOption('showLeftPanel', true) return end -end \ No newline at end of file +end diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index 253cab6496..8e6014f3ad 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -40,17 +40,18 @@ function UIItem:onDrop(widget, mousePos) local itemPos = item:getPosition() local itemTile = item:getTile() local toPos = self.position - if not(toPos) and self:getParent() and self:getParent().slotPosition then + 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 self.selectable then if item:isPickupable() then - self:setItem(Item.create(item:getId(), item:getCountOrSubType())) - return true + 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() @@ -124,7 +125,7 @@ function UIItem:onHoverChange(hovered) for word in text:gmatch("%S+") do table.insert(words, word) end - + local lines = {} local currentLine = words[1] for i = 2, #words do @@ -136,18 +137,17 @@ function UIItem:onHoverChange(hovered) end end table.insert(lines, currentLine) - + return table.concat(lines, "\n") end if self:getItem() and self:getItem():getTooltip():len() > 0 then - tooltip = splitTextIntoLines(self:getItem():getTooltip(), 80) + tooltip = splitTextIntoLines(self:getItem():getTooltip(), 80) if tooltip then self:setTooltip(tooltip) end end end - end function UIItem:onMouseRelease(mousePosition, mouseButton) @@ -178,15 +178,10 @@ 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 - end - else - if self:isVirtual() or not self:isDraggable() then - return false - end + if not self.selectable and (self:isVirtual() or not self:isDraggable()) then + return false end + if not widget or not widget.currentDragThing then return false end diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 783b3f9dcd..5423b7db04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,6 @@ option(TOGGLE_FRAMEWORK_NET "Use NET " ON) option(TOGGLE_FRAMEWORK_EDITOR "Use Editor " OFF) option(TOGGLE_DIRECTX "Use DX9 support" OFF) option(TOGGLE_BIN_FOLDER "Use build/bin folder for generate compilation files" OFF) -option(TOGGLE_BOT_PROTECTION "Use bot protection" ON) option(DEBUG_LOG "Enable Debug Log" OFF) option(ASAN_ENABLED "Build this target with AddressSanitizer" OFF) option(BUILD_STATIC_LIBRARY "Build using static libraries" OFF) @@ -76,14 +75,6 @@ if (ANDROID OR WASM) set(FRAMEWORK_DEFINITIONS ${FRAMEWORK_DEFINITIONS} -DOPENGL_ES=2) endif() -# Set for use bot protection -if(TOGGLE_BOT_PROTECTION) - message(STATUS "Bot protection: ON") -else(TOGGLE_BOT_PROTECTION) - message(STATUS "Bot protection: OFF") -endif(TOGGLE_BOT_PROTECTION) - - # Set for use precompiled header if(TOGGLE_PRE_COMPILED_HEADER) # === PRECOMPILED HEADER === @@ -173,10 +164,6 @@ endif() # Client options add_definitions(-DCLIENT) -# Set bot protection -if(TOGGLE_BOT_PROTECTION) - add_definitions(-DBOT_PROTECTION) -endif(TOGGLE_BOT_PROTECTION) add_definitions(-D_WIN32_WINNT=0x0501) add_definitions(${FRAMEWORK_DEFINITIONS}) add_definitions(-D"VERSION=${VERSION}") diff --git a/src/client/creature.cpp b/src/client/creature.cpp index 1d7d49f368..b50f419709 100644 --- a/src/client/creature.cpp +++ b/src/client/creature.cpp @@ -218,13 +218,11 @@ void Creature::drawInformation(const MapPosInfo& mapRect, const Point& dest, con if (drawFlags & Otc::DrawNames) { m_name.draw(textRect, fillColor); -#ifndef BOT_PROTECTION if (m_text) { auto extraTextSize = m_text->getTextSize(); Rect extraTextRect = Rect(p.x - extraTextSize.width() / 2.0, p.y + 15, extraTextSize); m_text->drawText(extraTextRect.center(), extraTextRect); } -#endif } if (m_skull != Otc::SkullNone && m_skullTexture) @@ -1168,7 +1166,6 @@ void Creature::setCovered(bool covered) { }); } -#ifndef BOT_PROTECTION void Creature::setText(const std::string& text, const Color& color) { if (!m_text) { @@ -1190,4 +1187,3 @@ bool Creature::canShoot(int distance) { return getTile() ? getTile()->canShoot(distance) : false; } -#endif \ No newline at end of file diff --git a/src/client/creature.h b/src/client/creature.h index c1feb01661..84b314899a 100644 --- a/src/client/creature.h +++ b/src/client/creature.h @@ -180,12 +180,10 @@ minHeight, void setWidgetInformation(const UIWidgetPtr& info); UIWidgetPtr getWidgetInformation() { return m_widgetInformation; } -#ifndef BOT_PROTECTION void setText(const std::string& text, const Color& color); std::string getText(); void clearText() { setText("", Color::white); } bool canShoot(int distance); -#endif protected: virtual void updateWalkOffset(uint8_t totalPixelsWalked); @@ -314,9 +312,7 @@ minHeight, bool m_typing{ false }; bool m_isCovered{ false }; -#ifndef BOT_PROTECTION StaticTextPtr m_text; -#endif }; // @bindclass diff --git a/src/client/game.cpp b/src/client/game.cpp index f48776f170..607256542b 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1592,21 +1592,6 @@ void Game::changeMapAwareRange(const uint8_t xrange, const uint8_t yrange) m_protocolGame->sendChangeMapAwareRange(xrange, yrange); } -bool Game::checkBotProtection() const -{ -#ifdef BOT_PROTECTION -#ifndef ANDROID - // accepts calls comming from a stacktrace containing only C++ functions, - // if the stacktrace contains a lua function, then only accept if the engine is processing an input event - if (m_denyBotCall && g_lua.isInCppCallback() && !g_app.isOnInputEvent()) { - g_logger.error(g_lua.traceback("caught a lua call to a bot protected game function, the call was cancelled")); - return false; - } -#endif -#endif - return true; -} - bool Game::canPerformGameAction() const { // we can only perform game actions if we meet these conditions: @@ -1615,8 +1600,7 @@ bool Game::canPerformGameAction() const // - the local player is not dead // - we have a game protocol // - the game protocol is connected - // - its not a bot action - return m_online && m_localPlayer && !m_dead && m_protocolGame && m_protocolGame->isConnected() && checkBotProtection(); + return m_online && m_localPlayer && !m_dead && m_protocolGame && m_protocolGame->isConnected(); } void Game::setProtocolVersion(const uint16_t version) diff --git a/src/client/game.h b/src/client/game.h index 9df762b91f..a7ddf7b30c 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -703,14 +703,6 @@ class Game uint16_t getWalkFirstStepDelay() { return m_walkFirstStepDelay; } bool canPerformGameAction() const; - bool checkBotProtection() const; - bool isEnabledBotProtection() { -#ifdef BOT_PROTECTION - return true; -#else - return false; -#endif - } bool isOnline() { return m_online; } bool isLogging() { return !m_online && m_protocolGame; } diff --git a/src/client/luafunctions.cpp b/src/client/luafunctions.cpp index bdb716b893..c3693860fb 100644 --- a/src/client/luafunctions.cpp +++ b/src/client/luafunctions.cpp @@ -189,10 +189,8 @@ void Client::registerLuaFunctions() g_lua.bindSingletonFunction("g_map", "getMinimapColor", &Map::getMinimapColor, &g_map); g_lua.bindSingletonFunction("g_map", "isSightClear", &Map::isSightClear, &g_map); -#ifndef BOT_PROTECTION g_lua.bindSingletonFunction("g_map", "findEveryPath", &Map::findEveryPath, &g_map); g_lua.bindSingletonFunction("g_map", "getSpectatorsByPattern", &Map::getSpectatorsByPattern, &g_map); -#endif g_lua.registerSingletonClass("g_minimap"); g_lua.bindSingletonFunction("g_minimap", "clean", &Minimap::clean, &g_minimap); @@ -360,7 +358,6 @@ void Client::registerLuaFunctions() g_lua.bindSingletonFunction("g_game", "isUsingProtobuf", &Game::isUsingProtobuf, &g_game); g_lua.bindSingletonFunction("g_game", "enableTileThingLuaCallback", &Game::enableTileThingLuaCallback, &g_game); g_lua.bindSingletonFunction("g_game", "isTileThingLuaCallbackEnabled", &Game::isTileThingLuaCallbackEnabled, &g_game); - g_lua.bindSingletonFunction("g_game", "isEnabledBotProtection", &Game::isEnabledBotProtection, &g_game); g_lua.bindSingletonFunction("g_game", "stashWithdraw", &Game::stashWithdraw, &g_game); g_lua.bindSingletonFunction("g_game", "requestHighscore", &Game::requestHighscore, &g_game); g_lua.bindSingletonFunction("g_game", "imbuementDurations", &Game::imbuementDurations, &g_game); @@ -608,12 +605,10 @@ void Client::registerLuaFunctions() g_lua.bindClassMemberFunction("isFullHealth", &Creature::isFullHealth); g_lua.bindClassMemberFunction("isCovered", &Creature::isCovered); -#ifndef BOT_PROTECTION g_lua.bindClassMemberFunction("setText", &Creature::setText); g_lua.bindClassMemberFunction("getText", &Creature::getText); g_lua.bindClassMemberFunction("clearText", &Creature::clearText); g_lua.bindClassMemberFunction("canShoot", &Creature::canShoot); -#endif #ifdef FRAMEWORK_EDITOR g_lua.registerClass(); @@ -900,14 +895,12 @@ void Client::registerLuaFunctions() g_lua.bindClassMemberFunction("isCovered", &Tile::isCovered); g_lua.bindClassMemberFunction("isCompletelyCovered", &Tile::isCompletelyCovered); -#ifndef BOT_PROTECTION g_lua.bindClassMemberFunction("setText", &Tile::setText); g_lua.bindClassMemberFunction("getText", &Tile::getText); g_lua.bindClassMemberFunction("setTimer", &Tile::setTimer); g_lua.bindClassMemberFunction("getTimer", &Tile::getTimer); g_lua.bindClassMemberFunction("setFill", &Tile::setFill); g_lua.bindClassMemberFunction("canShoot", &Tile::canShoot); -#endif #ifdef FRAMEWORK_EDITOR g_lua.bindClassMemberFunction("isHouseTile", &Tile::isHouseTile); diff --git a/src/client/map.cpp b/src/client/map.cpp index 9d8e98ede4..e2feb1857c 100644 --- a/src/client/map.cpp +++ b/src/client/map.cpp @@ -1238,7 +1238,6 @@ void Map::updateAttachedWidgets(const MapViewPtr& mapView) } } -#ifndef BOT_PROTECTION std::map> Map::findEveryPath(const Position& start, int maxDistance, const std::map& params) { // using Dijkstra's algorithm @@ -1454,5 +1453,4 @@ std::vector Map::getSpectatorsByPattern(const Position& centerPos, } } return creatures; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/client/map.h b/src/client/map.h index 0cfafca23f..3cb74244cf 100644 --- a/src/client/map.h +++ b/src/client/map.h @@ -295,10 +295,8 @@ class Map void setFloatingEffect(const bool enable) { m_floatingEffect = enable; } bool isDrawingFloatingEffects() { return m_floatingEffect; } -#ifndef BOT_PROTECTION std::map> findEveryPath(const Position& start, int maxDistance, const std::map& params); std::vector getSpectatorsByPattern(const Position& centerPos, const std::string& pattern, Otc::Direction direction); -#endif int getMinimapColor(const Position& pos); bool isSightClear(const Position& fromPos, const Position& toPos); diff --git a/src/client/mapview.cpp b/src/client/mapview.cpp index 2d9b6c605f..fc133ef532 100644 --- a/src/client/mapview.cpp +++ b/src/client/mapview.cpp @@ -264,7 +264,7 @@ void MapView::drawForeground(const Rect& rect) p += rect.topLeft(); animatedText->drawText(p, rect); } -#ifndef BOT_PROTECTION + g_drawPool.scale(1.f); for (const auto& tile : m_foregroundTiles) { const auto& dest = transformPositionTo2D(tile->getPosition()); @@ -277,7 +277,6 @@ void MapView::drawForeground(const Rect& rect) tile->drawTexts(p); } -#endif } void MapView::updateVisibleTiles() diff --git a/src/client/protocolgame.h b/src/client/protocolgame.h index 84099490c2..d8ae7daa01 100644 --- a/src/client/protocolgame.h +++ b/src/client/protocolgame.h @@ -31,7 +31,6 @@ class ProtocolGame final : public Protocol { public: void login(std::string_view accountName, std::string_view accountPassword, std::string_view host, uint16_t port, std::string_view characterName, std::string_view authenticatorToken, std::string_view sessionKey); - void send(const OutputMessagePtr& outputMessage) override; void sendExtendedOpcode(uint8_t opcode, const std::string& buffer); void sendLoginPacket(uint32_t challengeTimestamp, uint8_t challengeRandom); diff --git a/src/client/protocolgamesend.cpp b/src/client/protocolgamesend.cpp index 9a93dd66ae..6ea5d28df7 100644 --- a/src/client/protocolgamesend.cpp +++ b/src/client/protocolgamesend.cpp @@ -25,15 +25,6 @@ #include "protocolgame.h" #include -void ProtocolGame::send(const OutputMessagePtr& outputMessage) -{ - // avoid usage of automated sends (bot modules) - if (!g_game.checkBotProtection()) - return; - - Protocol::send(outputMessage); -} - void ProtocolGame::sendExtendedOpcode(const uint8_t opcode, const std::string& buffer) { if (m_enableSendExtendedOpcode) { diff --git a/src/client/tile.cpp b/src/client/tile.cpp index 2f97c34ea0..0a5a6644a8 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -57,12 +57,10 @@ void Tile::draw(const Point& dest, const int flags, const LightViewPtr& lightVie uint8_t drawElevation = 0; -#ifndef BOT_PROTECTION if (m_fill != Color::alpha) { g_drawPool.addFilledRect(Rect(dest, Size{ g_gameConfig.getSpriteSize() }), m_fill); return; } -#endif for (const auto& thing : m_things) { if (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom()) @@ -153,11 +151,7 @@ void Tile::drawTop(const Point& dest, const int flags, const bool forceDraw, uin void Tile::clean() { - if (g_client.getMapWidget() -#ifndef BOT_PROTECTION - && (m_text || m_timerText) -#endif - ) { + if (g_client.getMapWidget() && (m_text || m_timerText)) { g_dispatcher.scheduleEvent([tile = static_self_cast()] { if (g_client.getMapWidget()) g_client.getMapWidget()->getMapView()->removeForegroundTile(tile); @@ -913,7 +907,6 @@ bool Tile::canRender(uint32_t& flags, const Position& cameraPosition, const Awar return flags > 0; } -#ifndef BOT_PROTECTION void Tile::drawTexts(Point dest) { if (m_timerText && g_clock.millis() < m_timer) { @@ -985,4 +978,3 @@ bool Tile::canShoot(int distance) return false; return g_map.isSightClear(playerPos, m_position); } -#endif \ No newline at end of file diff --git a/src/client/tile.h b/src/client/tile.h index eacc54b642..a13d353d65 100644 --- a/src/client/tile.h +++ b/src/client/tile.h @@ -205,7 +205,6 @@ class Tile final : public AttachableObject bool checkForDetachableThing(TileSelectType selectType = TileSelectType::FILTERED); -#ifndef BOT_PROTECTION void drawTexts(Point dest); void setText(const std::string& text, Color color); std::string getText(); @@ -214,7 +213,7 @@ class Tile final : public AttachableObject void setFill(Color color); void resetFill() { m_fill = Color::alpha; } bool canShoot(int distance); -#endif + private: void updateThingStackPos(); void drawTop(const Point& dest, int flags, bool forceDraw, uint8_t drawElevation); @@ -242,12 +241,10 @@ class Tile final : public AttachableObject std::unique_ptr> m_effects; std::unique_ptr> m_tilesRedraw; -#ifndef BOT_PROTECTION std::unique_ptr m_timerText; std::unique_ptr m_text; Color m_fill = Color::alpha; ticks_t m_timer = 0; -#endif uint32_t m_isCompletelyCovered{ 0 }; uint32_t m_isCovered{ 0 }; diff --git a/src/client/uiitem.cpp b/src/client/uiitem.cpp index 01be01f243..35eb9d6870 100644 --- a/src/client/uiitem.cpp +++ b/src/client/uiitem.cpp @@ -74,34 +74,29 @@ void UIItem::setItemId(const int id) m_item->setId(id); else m_item = Item::create(id); -#ifndef BOT_PROTECTION + callLuaField("onItemChange"); -#endif } void UIItem::setItemCount(const int count) { if (m_item) m_item->setCount(count); -#ifndef BOT_PROTECTION + callLuaField("onItemChange"); -#endif } void UIItem::setItemSubType(const int subType) { if (m_item) m_item->setSubType(subType); -#ifndef BOT_PROTECTION + callLuaField("onItemChange"); -#endif } void UIItem::setItem(const ItemPtr& item) { m_item = item; -#ifndef BOT_PROTECTION callLuaField("onItemChange"); -#endif } void UIItem::onStyleApply(const std::string_view styleName, const OTMLNodePtr& styleNode) diff --git a/src/framework/stdext/string.cpp b/src/framework/stdext/string.cpp index 8ec0b7de8c..63264f724d 100644 --- a/src/framework/stdext/string.cpp +++ b/src/framework/stdext/string.cpp @@ -140,11 +140,7 @@ namespace stdext std::wstring utf8_to_utf16(const std::string_view src) { -#ifndef BOT_PROTECTION constexpr size_t BUFFER_SIZE = 65536; -#else - constexpr size_t BUFFER_SIZE = 4096; -#endif std::wstring res; wchar_t out[BUFFER_SIZE]; @@ -155,11 +151,7 @@ namespace stdext std::string utf16_to_utf8(const std::wstring_view src) { -#ifndef BOT_PROTECTION constexpr size_t BUFFER_SIZE = 65536; -#else - constexpr size_t BUFFER_SIZE = 4096; -#endif std::string res; char out[BUFFER_SIZE]; diff --git a/tools/make_snapshot.sh b/tools/make_snapshot.sh index 07e877d77e..fe251f3b5d 100755 --- a/tools/make_snapshot.sh +++ b/tools/make_snapshot.sh @@ -12,18 +12,18 @@ makejobs=4 replace=false rebuild=true for arg in "$@"; do - case "$arg" in - --no-rebuild) - rebuild=false - ;; - --replace) - replace=true - ;; - *) - echo "usage: $0 [--replace] [--no-rebuild]" - exit - ;; - esac + case "$arg" in + --no-rebuild) + rebuild=false + ;; + --replace) + replace=true + ;; + *) + echo "usage: $0 [--replace] [--no-rebuild]" + exit + ;; + esac done # setup work directory @@ -32,41 +32,38 @@ cd $workdir # update otclient if [ -d otclient ]; then - cd otclient - git pull || exit + cd otclient + git pull || exit else - git clone $gitroot otclient || exit + git clone $gitroot otclient || exit fi cd $workdir/otclient -revision=`git rev-list --all | wc -l` -commit=`git describe --always` -version=`cat CMakeLists.txt | grep "set(VERSION" | sed 's/.*"\([^"]*\)".*/\1/'` - +revision=$(git rev-list --all | wc -l) +commit=$(git describe --always) +version=$(cat CMakeLists.txt | grep "set(VERSION" | sed 's/.*"\([^"]*\)".*/\1/') if $rebuild; then - rm -rf build.win32 - rm -rf build.win64 - rm -rf build.win32dx9 - rm -rf build.win64dx9 - rm -rf build.linux32 - rm -rf build.linux64 + rm -rf build.win32 + rm -rf build.win64 + rm -rf build.win32dx9 + rm -rf build.win64dx9 + rm -rf build.linux32 + rm -rf build.linux64 fi WIN32_EXTRA_LIBS="-Wl,-Bstatic -lgcc -lstdc++ -lpthread -Wl,-Bdynamic" - # compile for win64 mkdir -p build.win64 cd build.win64 if $rebuild; then - x86_64-w64-mingw32-cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBOT_PROTECTION=OFF \ - -DBUILD_REVISION=$revision \ - -DBUILD_COMMIT=$commit \ - -DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ - .. || exit + x86_64-w64-mingw32-cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_REVISION=$revision \ + -DBUILD_COMMIT=$commit \ + -DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ + .. || exit fi make -j$makejobs || exit cd .. @@ -75,13 +72,12 @@ cd .. mkdir -p build.win32 cd build.win32 if $rebuild; then - i686-w64-mingw32-cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBOT_PROTECTION=OFF \ - -DBUILD_REVISION=$revision \ - -DBUILD_COMMIT=$commit \ - -DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ - .. || exit + i686-w64-mingw32-cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_REVISION=$revision \ + -DBUILD_COMMIT=$commit \ + -DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ + .. || exit fi make -j$makejobs || exit cd .. @@ -90,14 +86,13 @@ cd .. #mkdir -p build.win64dx9 #cd build.win64dx9 #if $rebuild; then - #x86_64-w64-mingw32-cmake \ - #-DCMAKE_BUILD_TYPE=Release \ - #-DBOT_PROTECTION=OFF \ - #-DOPENGLES=2.0 \ - #-DBUILD_REVISION=$revision \ - #-DBUILD_COMMIT=$commit \ - #-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ - #.. || exit +#x86_64-w64-mingw32-cmake \ +#-DCMAKE_BUILD_TYPE=Release \ +#-DOPENGLES=2.0 \ +#-DBUILD_REVISION=$revision \ +#-DBUILD_COMMIT=$commit \ +#-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ +#.. || exit #fi #make -j$makejobs || exit #cd .. @@ -106,14 +101,13 @@ cd .. #mkdir -p build.win32dx9 #cd build.win32dx9 #if $rebuild; then - #i686-w64-mingw32-cmake \ - #-DCMAKE_BUILD_TYPE=Release \ - #-DBOT_PROTECTION=OFF \ - #-DOPENGLES=2.0 \ - #-DBUILD_REVISION=$revision \ - #-DBUILD_COMMIT=$commit \ - #-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ - #.. || exit +#i686-w64-mingw32-cmake \ +#-DCMAKE_BUILD_TYPE=Release \ +#-DOPENGLES=2.0 \ +#-DBUILD_REVISION=$revision \ +#-DBUILD_COMMIT=$commit \ +#-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \ +#.. || exit #fi #make -j$makejobs || exit #cd .. @@ -122,11 +116,10 @@ cd .. mkdir -p build.linux64 cd build.linux64 if $rebuild; then - cmake -DCMAKE_BUILD_TYPE=Release \ - -DBOT_PROTECTION=OFF \ - -DBUILD_REVISION=$revision \ - -DBUILD_COMMIT=$commit \ - .. || exit + cmake -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_REVISION=$revision \ + -DBUILD_COMMIT=$commit \ + .. || exit fi make -j$makejobs || exit cd .. @@ -138,18 +131,17 @@ export LDFLAGS="-march=i686 -m32" LIBPATH=/usr/lib if [ -d /usr/lib32 ]; then - LIBPATH=/usr/lib32 + LIBPATH=/usr/lib32 fi mkdir -p build.linux32 cd build.linux32 if $rebuild; then - cmake -DCMAKE_BUILD_TYPE=Release \ - -DBOT_PROTECTION=OFF \ - -DBUILD_REVISION=$revision \ - -DBUILD_COMMIT=$commit \ - -DCMAKE_LIBRARY_PATH=$LIBPATH \ - .. || exit + cmake -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_REVISION=$revision \ + -DBUILD_COMMIT=$commit \ + -DCMAKE_LIBRARY_PATH=$LIBPATH \ + .. || exit fi make -j$makejobs || exit cd .. @@ -187,11 +179,11 @@ cd $workdir # determine zip name if ! $replace; then - let i=1 - while [ -e $pkgzip ]; do - pkgzip="$pkgname-$i.zip" - let i=i+1 - done + let i=1 + while [ -e $pkgzip ]; do + pkgzip="$pkgname-$i.zip" + let i=i+1 + done fi # compress to a zip file @@ -241,11 +233,11 @@ cd $workdir # determine zip name if [ ! $replace ]; then - let i=1 - while [ -e $pkgzip ]; do - pkgzip="$pkgname-$i.zip" - let i=i+1 - done + let i=1 + while [ -e $pkgzip ]; do + pkgzip="$pkgname-$i.zip" + let i=i+1 + done fi # compress to a zip file @@ -258,4 +250,3 @@ echo "Package generated to $pkgzip" cd otclient wine build.win32/otclient.exe rm -f *.log - diff --git a/vc17/settings.props b/vc17/settings.props index aba0b9cdf6..9198fd4d5c 100644 --- a/vc17/settings.props +++ b/vc17/settings.props @@ -7,7 +7,6 @@ _CRT_SECURE_NO_WARNINGS; _WIN32_WINNT=0x0600; NTDDI_VERSION=0x06000000; - BOT_PROTECTION; CRASH_HANDLER; FRAMEWORK_GRAPHICS; FRAMEWORK_NET; From 8d9d14d0fe39c7e6816359c482933bd878c83551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Ja=C5=82ocha?= Date: Tue, 14 Jan 2025 09:19:13 +0100 Subject: [PATCH 2/3] Load later bot in client_mods --- mods/client_mods/mods.otmod | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/client_mods/mods.otmod b/mods/client_mods/mods.otmod index 1ae4ecb86c..bd16c91bd9 100644 --- a/mods/client_mods/mods.otmod +++ b/mods/client_mods/mods.otmod @@ -9,3 +9,4 @@ Module - game_buttons - game_itemselector - client_textedit + - game_bot From 11527369b0c7915d711e16c6e248bd9787d84aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Ja=C5=82ocha?= Date: Tue, 14 Jan 2025 15:15:30 +0100 Subject: [PATCH 3/3] Add back option for showing id if bot is loaded --- modules/game_interface/gameinterface.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 5d7bf600ab..6eafa199fd 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -803,6 +803,12 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing) end end + if g_modules.getModule("game_bot"):isLoaded() and useThing and useThing:isItem() then + menu:addSeparator() + local useThingId = useThing:getId() + menu:addOption("ID: " .. useThingId, function() g_window.setClipboardText(useThingId) end) + end + if g_game.getFeature(GameThingQuickLoot) and modules.game_quickloot and lookThing and not lookThing:isCreature() and lookThing:isPickupable() then local quickLoot = modules.game_quickloot.QuickLoot menu.addSeparator(menu)