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.
102
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.
Edit your CONFIGNAME\vBot\cavebot.lua add this line as you would with other extensions. dofile("/cavebot/stand.lua")
create a file CONFIGNAME\cavebot\stand.lua and add code below.
File: stand.lua | 641b | 24 lines.
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

21 Sep 2021