Posted 22 June 2014 - 04:54 AM
Hi all,
I hate to ask but I am simply dumbfounded as to why this program is not working.
The error it gives me is [string "nav"]:20: unexpected symbol.
Sincerely, Chain
Post Script: Thanks in advance!
Post Post Script: oh yeah here is the code http://pastebin.com/ve9B54zV
I forgot to include my file api :http://pastebin.com/erXji62P
I hate to ask but I am simply dumbfounded as to why this program is not working.
The error it gives me is [string "nav"]:20: unexpected symbol.
Sincerely, Chain
Post Script: Thanks in advance!
Post Post Script: oh yeah here is the code http://pastebin.com/ve9B54zV
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
I forgot to include my file api :http://pastebin.com/erXji62P
function create(fileName,data)
local file=fs.open(fileName,"w")
file.write(textutils.serialize(data))
file.close()
end
function read(fileName)
local file = fs.open(fileName,"r")
local data = file.readAll()
file.close()
return textutils.unserialize(data)
end