Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("position") then
- local pos={0,0,0}
- print("false")
- file.create("position",pos) end
- pos=file.read("position")
- x=pos[1]
- y=pos[2]
- z=pos[3]
- print("true")
- print("I am at |x:",x,"|y:",y,"|z:",z)
- facing={"north","south","east","west"}
- if not fs.exists("direction") then
- file.create("direction","north") end
- way=file.read("direction")
- function turn(direction,count)
- counter=0
- repeat
- counter=counter+1
- if direction == "right" and if way ~= "north" and if way ~= "south" then
- countDirection=1
- turtle.turnRight()
- end
- if direction=="left" and if way~= "north" and if way ~= "south" then
- countDirection=-1
- turtle.turnLeft()
- end
- until counter==#count
- end
Advertisement
Add Comment
Please, Sign In to add comment