diff --git a/modules/game_bot/bot.lua b/modules/game_bot/bot.lua index 7b0fea5..d3d1f54 100644 --- a/modules/game_bot/bot.lua +++ b/modules/game_bot/bot.lua @@ -497,7 +497,9 @@ function initCallbacks() onRemoveItem = botContainerRemoveItem, onGameEditText = botGameEditText, onSpellCooldown = botSpellCooldown, - onSpellGroupCooldown = botGroupSpellCooldown + onSpellGroupCooldown = botGroupSpellCooldown, + onQuestLog = botGameQuestLog, + onQuestLine = botGameQuestLine }) connect(Tile, { @@ -560,7 +562,9 @@ function terminateCallbacks() onAttackingCreatureChange = botAttackingCreatureChange, onGameEditText = botGameEditText, onSpellCooldown = botSpellCooldown, - onSpellGroupCooldown = botGroupSpellCooldown + onSpellGroupCooldown = botGroupSpellCooldown, + onQuestLog = botGameQuestLog, + onQuestLine = botGameQuestLine }) disconnect(Tile, { @@ -789,4 +793,14 @@ end function botGroupSpellCooldown(iconId, duration) if botExecutor == nil then return false end safeBotCall(function() botExecutor.callbacks.onGroupSpellCooldown(iconId, duration) end) +end + +function botGameQuestLog(quests) + if botExecutor == nil then return false end + safeBotCall(function() botExecutor.callbacks.onGameQuestLog(quests) end) +end + +function botGameQuestLine(quests) + if botExecutor == nil then return false end + safeBotCall(function() botExecutor.callbacks.onGameQuestLine(questId, questMissions) end) end \ No newline at end of file diff --git a/modules/game_bot/executor.lua b/modules/game_bot/executor.lua index 0566712..4863e47 100644 --- a/modules/game_bot/executor.lua +++ b/modules/game_bot/executor.lua @@ -72,7 +72,9 @@ function executeBot(config, storage, tabs, msgCallback, saveConfigCallback, relo onGameEditText = {}, onGroupSpellCooldown = {}, onSpellCooldown = {}, - onRemoveItem = {} + onRemoveItem = {}, + onGameQuestLog = {}, + onGameQuestLine = {} } -- basic functions & classes @@ -404,6 +406,26 @@ function executeBot(config, storage, tabs, msgCallback, saveConfigCallback, relo callback(iconId, duration) end end, + onGameQuestLog = function(quests) + local tmp = {} + for j,questEntry in pairs(quests) do + local id, name, completed = unpack(questEntry) + table.insert(tmp, { id = id, name = name, completed = completed }) + end + for i, callback in ipairs(context._callbacks.onGameQuestLog) do + callback(tmp) + end + end, + onGameQuestLine = function(questId, questMissions) + local tmp = {} + for i,questMission in pairs(questMissions) do + local name, description = unpack(questMission) + table.insert(tmp, { name = name, description = description }) + end + for i, callback in ipairs(context._callbacks.onGameQuestLine) do + callback(questId, tmp) + end + end, } } end \ No newline at end of file diff --git a/modules/game_bot/functions/callbacks.lua b/modules/game_bot/functions/callbacks.lua index 55b7a69..cf60145 100644 --- a/modules/game_bot/functions/callbacks.lua +++ b/modules/game_bot/functions/callbacks.lua @@ -225,6 +225,16 @@ context.onGroupSpellCooldown = function(callback) return context.callback("onGroupSpellCooldown", callback) end +-- onGameQuestLog - callback = function(quests) +context.onGameQuestLog = function(callback) + return context.callback("onGameQuestLog", callback) +end + +-- onGameQuestLine - callback = function(questMission) +context.onGameQuestLine = function(callback) + return context.callback("onGameQuestLine", callback) +end + -- CUSTOM CALLBACKS -- listen(name, callback) -- callback = function(text, channelId, pos) diff --git a/modules/game_containers/containers.lua b/modules/game_containers/containers.lua index 0fe6c64..2ae2888 100644 --- a/modules/game_containers/containers.lua +++ b/modules/game_containers/containers.lua @@ -94,6 +94,18 @@ function refreshContainerPages(container) nextPageButton:setEnabled(true) nextPageButton.onClick = function() g_game.seekInContainer(container:getId(), container:getFirstIndex() + container:getCapacity()) end end + + local pagePanel = container.window:recursiveGetChildById('pagePanel') + if pagePanel then + pagePanel.onMouseWheel = function(widget, mousePos, mouseWheel) + if pages == 1 then return end + if mouseWheel == MouseWheelUp then + return prevPageButton.onClick() + else + return nextPageButton.onClick() + end + end + end end function onContainerOpen(container, previousContainer) @@ -126,6 +138,20 @@ function onContainerOpen(container, previousContainer) child:onDrop(widget, mousePos, true) end end + + containerWindow.onMouseRelease = function(widget, mousePos, mouseButton) + if mouseButton == MouseButton4 then + if container:hasParent() then + return g_game.openParent(container) + end + elseif mouseButton == MouseButton5 then + for i, item in ipairs(container:getItems()) do + if item:isContainer() then + return g_game.open(item, container) + end + end + end + end -- this disables scrollbar auto hiding local scrollbar = containerWindow:getChildById('miniwindowScrollBar') diff --git a/modules/gamelib/const.lua b/modules/gamelib/const.lua index be9e7e0..f18f929 100644 --- a/modules/gamelib/const.lua +++ b/modules/gamelib/const.lua @@ -211,6 +211,7 @@ GameCreaturesMana = 122 -- get mana from server for creatures other than Player GameQuickLootFlags = 123 -- enables quick loot feature for all protocols GameDontMergeAnimatedText = 124 GameMissionId = 125 +GameItemCustomAttributes = 126 LastGameFeature = 130 diff --git a/otclient_dx.exe b/otclient_dx.exe index c9644a3..2f7c11c 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index ffe4350..7899ee7 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/otclient_linux b/otclient_linux index 2730c28..2b16b32 100644 Binary files a/otclient_linux and b/otclient_linux differ diff --git a/otclient_mac b/otclient_mac index 1a79a11..b6ff5d6 100644 Binary files a/otclient_mac and b/otclient_mac differ diff --git a/otclientv8.apk b/otclientv8.apk index a022be8..26b350b 100644 Binary files a/otclientv8.apk and b/otclientv8.apk differ