This commit is contained in:
Crispy 2025-05-23 02:31:02 +02:00
parent 12ffbdc45d
commit 13ddce15ae
15 changed files with 8967 additions and 61 deletions

View file

@ -1,15 +1,15 @@
pp = require("cc.pretty")
if _G.pos == nil then
_G.facing = "south"
_G.pos = vector.new(0,0,0)
file = fs.open("pos.txt", "r")
data = splitString(file.readAll())
_G.pos.x = tonumber(data[1])
_G.pos.y = tonumber(data[2])
_G.pos.z = tonumber(data[3])
_G.facing = data[4]
end
-- if _G.pos == nil then
_G.facing = "south"
_G.pos = vector.new(0,0,0)
-- file = fs.open("pos.txt", "r")
-- data = splitString(file.readAll())
-- _G.pos.x = tonumber(data[1])
-- _G.pos.y = tonumber(data[2])
-- _G.pos.z = tonumber(data[3])
-- _G.facing = data[4]
-- end
local up = vector.new(0,1,0)
@ -35,9 +35,9 @@ local vecOf = {
}
function savePos()
fs.delete("pos.txt")
file = fs.open("pos.txt", "w")
file.write(_G.pos.x .. " " .. _G.pos.y .. " " .. _G.pos.z .. " " .. _G.facing)
-- fs.delete("pos.txt")
-- file = fs.open("pos.txt", "w")
-- file.write(_G.pos.x .. " " .. _G.pos.y .. " " .. _G.pos.z .. " " .. _G.facing)
end
@ -112,8 +112,7 @@ end
function go_to(target, face)
while target ~= _G.pos do
stepTo(target)
-- print(_G.pos, _G.facing, target, face)
print(_G.pos, _G.facing)
-- print(_G.pos, _G.facing)
end
if face and face ~= _G.facing then
if rightOf[_G.facing] == face then