Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
3.6K
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.
File: cavebot.lua | 500b | 15 lines.
 --[[
  Script made by Lee (Discord: l33_) - www.trainorcreations.com
  If you want to support my work, feel free to donate at https://trainorcreations.com/donate
  PS. Stop ripping off my work and selling it as your own.
 ]]--
--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

24 Dec 2021
Ads