Browse Source

fixed some syntax errors

master
unknown 13 years ago
parent
commit
8e77afda33
  1. 24
      makefloor

24
makefloor

@ -1,5 +1,22 @@
local args = { ... } local args = { ... }
--[[
local function placeholder() return true end
local turtle = {}
turtle.up = placeholder
turtle.down = placeholder
turtle.digUp = placeholder
turtle.digDown = placeholder
turtle.dig = placeholder
turtle.forward = placeholder
turtle.turnLeft = placeholder
turtle.turnRight = placeholder
turtle.detect = placeholder
turtle.getItemCount = placeholder
turtle.placeDown = placeholder
]]
turnedLeft = nil turnedLeft = nil
if args[1] == "rightturn" or args[1] == "leftturn" then if args[1] == "rightturn" or args[1] == "leftturn" then
local turnedLeft = args[1] == "rightturn" local turnedLeft = args[1] == "rightturn"
@ -18,15 +35,16 @@ local function selectMatStack()
end end
curContainer = curContainer + 1 curContainer = curContainer + 1
turtle.select(curContainer) turtle.select(curContainer)
itemCount = turtle.getItemCount(curContainer)
end end
return true return true
end end
local function checkIfNextTurn() local function checkIfNextTurn()
if turnedLeft then turnAction = turtle.TurnRight else turnAction = turtle.TurnLeft end if turnedLeft then turnAction = turtle.turnRight else turnAction = turtle.turnLeft end
turnAction() turnAction()
retval = not turtle.detect() retval = not turtle.detect()
if not turnedLeft then turnAction = turtle.TurnRight else turnAction = turtle.TurnLeft end if not turnedLeft then turnAction = turtle.turnRight else turnAction = turtle.turnLeft end
turnAction() turnAction()
return retval return retval
end end
@ -43,7 +61,7 @@ local function fillblock()
end end
turtle.placeDown() turtle.placeDown()
if shouldTurn then if shouldTurn then
if turnedLeft then turnAction = turtle.TurnRight else turnAction = turtle.TurnLeft end if turnedLeft then turnAction = turtle.turnRight else turnAction = turtle.turnLeft end
turnAction() turnAction()
turtle.forward() turtle.forward()
turnAction() turnAction()