tools.lua

main 19 lines · 693 bytes Raw
Alex Alex Commit Client Upload Part 2 19/10/2026 00:06
1local context = G.botContext
2
3context.encode = function(data, indent) return json.encode(data, indent or 2) end
4context.decode = function(text) local status, result = pcall(function() return json.decode(text) end) if status then return result end return {} end
5
6context.displayGeneralBox = function(title, message, buttons, onEnterCallback, onEscapeCallback)
7 local box = displayGeneralBox(title, message, buttons, onEnterCallback, onEscapeCallback)
8 box.botWidget = true
9 return box
10end
11
12context.doScreenshot = function(filename)
13 g_app.doScreenshot(filename)
14end
15context.screenshot = context.doScreenshot
16
17context.getVersion = function()
18 return g_app.getVersion()
19end
Top