AutoLoader- vBot extensions
#75
This allows you to drag and drop extensions into vBot without editing the vBot cavebot.lua file to load them.
- Find the file CONFIGNAME\vBot\cavebot.lua
- Find the line --dofile("/cavebot/extension_template.lua")
- Add the code below on the line below it.
This will auto create a folder called "extensions" in path CONFIGNAME\cavebot
if it doesn't exist.
- Find the file CONFIGNAME\vBot\cavebot.lua
- Find the line --dofile("/cavebot/extension_template.lua")
- Add the code below on the line below it.
This will auto create a folder called "extensions" in path CONFIGNAME\cavebot
if it doesn't exist.
--dofile("/cavebot/extension_template.lua")
local configName = modules.game_bot.contentsPanel.config:getCurrentOption().text
local path = "/bot/" .. configName .. "/cavebot/extensions"
if not g_resources.directoryExists(path) then
g_resources.makeDir(path)
end
local extFiles = g_resources.listDirectoryFiles(path, false, false)
for i, file in ipairs(extFiles) do
local ext = file:split(".")
if ext[#ext]:lower() == "lua" then
dofile('/cavebot/extensions/'..file)
end
end
- remove | + add
24 Dec 2021