Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function forward(dirToGo)
- if dirToGo == "north" then
- y = y + 1
- if direction == "north" then
- turtle.forward()
- elseif direction == "south" then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- elseif direction == "west" then
- turtle.turnRight()
- turtle.forward()
- elseif direction == "east" then
- turtle.turnLeft()
- turtle.forward()
- end
- direction = "north"
- elseif dirToGo == "east" then
- x = x + 1
- if direction == "north" then
- turtle.turnRight()
- turtle.forward()
- elseif direction == "west" then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- elseif direction == "east" then
- turtle.forward()
- elseif direction == "south" then
- turtle.turnLeft()
- turtle.forward()
- end
- direction = "east"
- elseif dirToGo == "south" then
- y = y - 1
- if direction == "south" then
- turtle.forward()
- elseif direction == "north" then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- elseif direction == "east" then
- turtle.turnRight()
- turtle.forward()
- elseif direction == "west" then
- turtle.turnLeft()
- turtle.forward()
- end
- direction = "south"
- elseif dirToGo == "west" then
- x = x - 1
- if direction == "west" then
- turtle.forward()
- elseif direction == "east" then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- elseif direction == "south" then
- turtle.turnRight()
- turtle.forward()
- elseif direction == "north" then
- turtle.turnLeft()
- turtle.forward()
- end
- direction = "west"
- end
- fuel()
- end
Advertisement
Add Comment
Please, Sign In to add comment