tools.lua

main 36 lines · 1.3 KB Raw
Alex Alex Commit Client Upload Part 2 19/10/2026 00:06
1local context = G.botContext
2local Panels = context.Panels
3
4Panels.TradeMessage = function(parent)
5 context.macro(60000, "Send message on trade", nil, function()
6 local trade = context.getChannelId("advertising")
7 if not trade then
8 trade = context.getChannelId("trade")
9 end
10 if context.storage.autoTradeMessage:len() > 0 and trade then
11 context.sayChannel(trade, context.storage.autoTradeMessage)
12 end
13 end, parent)
14 context.addTextEdit("autoTradeMessage", context.storage.autoTradeMessage or "I'm using OTClientV8 - https://github.com/OTCv8/otclientv8", function(widget, text)
15 context.storage.autoTradeMessage = text
16 end, parent)
17end
18
19Panels.AutoStackItems = function(parent)
20 context.macro(500, "Auto stacking items", nil, function()
21 local containers = context.getContainers()
22 for i, container in pairs(containers) do
23 local toStack = {}
24 for j, item in ipairs(container:getItems()) do
25 if item:isStackable() and item:getCount() ~= 100 then
26 local otherItem = toStack[item:getId()]
27 if otherItem then
28 g_game.move(item, otherItem, item:getCount())
29 return
30 end
31 toStack[item:getId()] = container:getSlotPosition(j - 1)
32 end
33 end
34 end
35 end, parent)
36end
Top