Stand - vBot extension
#56
This allows you to add a stand button inside the bot so you can tell bot to stand 1 square away from where you are facing.
To install see my Auto extension loader code here
To install see my Auto extension loader code here
--[[
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.
]]--
CaveBot.Extensions.Stand = {}
function getStandPos()
local dirs = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 }}
local dir = player:getDirection() + 1
local dirPos = pos()
dirPos.x = dirPos.x + dirs[dir][1]
dirPos.y = dirPos.y + dirs[dir][2]
return dirPos.x .. "," .. dirPos.y .. "," .. dirPos.z .. ",0"
end
CaveBot.registerAction("Stand", "#00FFFF", function(value, retries, prev)
local action = CaveBot.Actions["goto"]
if action then
local status, result = pcall(function()
return action.callback(value, retries, prev)
end)
if status then
if result == "retry" or type(result) == 'boolean' then
return result
end
end
end
end)
CaveBot.Extensions.Stand.setup = function()
CaveBot.Editor.registerAction("stand", "stand", {
value=function() return getStandPos() end,
title="Stand position",
description="stand at the position infront of character (x,y,z,0)",
multiline=false,
})
end
--[[
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.
]]--
CaveBot.Extensions.Stand = {}
function getStandPos()
local dir = player:getDirection()
local dir_pos = pos()
if dir == 0 then
dir_pos.y = dir_pos.y - 1
elseif dir == 1 then
dir_pos.x = dir_pos.x + 1
elseif dir == 2 then
dir_pos.y = dir_pos.y + 1
elseif dir == 3 then
dir_pos.x = dir_pos.x - 1
end
return dir_pos.x .. "," .. dir_pos.y .. "," .. dir_pos.z .. ", 0"
end
CaveBot.Extensions.Stand.setup = function()
CaveBot.Editor.registerAction("goto", "stand", {
value=function() return getStandPos() end,
title="Stand position",
description="stand position (x,y,z,0)",
multiline=false,
})
end
02 Apr 2022