From 8e77afda33cb916e614fdb9b7e1b9547c79dd855 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2012 21:07:57 +0200 Subject: [PATCH 1/3] fixed some syntax errors --- makefloor | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/makefloor b/makefloor index 9338eef..35f8404 100644 --- a/makefloor +++ b/makefloor @@ -1,5 +1,22 @@ + 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 if args[1] == "rightturn" or args[1] == "leftturn" then local turnedLeft = args[1] == "rightturn" @@ -18,15 +35,16 @@ local function selectMatStack() end curContainer = curContainer + 1 turtle.select(curContainer) + itemCount = turtle.getItemCount(curContainer) end return true end 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() 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() return retval end @@ -43,7 +61,7 @@ local function fillblock() end turtle.placeDown() 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() turtle.forward() turnAction() From fa3d43ccbd4fd6498599a618826a5cce96ae8314 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2012 21:28:18 +0200 Subject: [PATCH 2/3] yet more makefloor fixes --- makefloor | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/makefloor b/makefloor index 35f8404..2263b87 100644 --- a/makefloor +++ b/makefloor @@ -15,22 +15,24 @@ turtle.turnRight = placeholder turtle.detect = placeholder turtle.getItemCount = placeholder turtle.placeDown = placeholder +turtle.select = placeholder ]] turnedLeft = nil if args[1] == "rightturn" or args[1] == "leftturn" then - local turnedLeft = args[1] == "rightturn" + local turnedLeft = (args[1] == "rightturn") else - print("usage: \"makefloor [leftturn|rightturn] whatever the first turn may be") + print("usage: \"makefloor [leftturn|rightturn]\" whatever the first turn may be") return end local curContainer = 1 +turtle.select(curContainer) local function selectMatStack() itemCount = turtle.getItemCount(curContainer) while itemCount == 0 do - if curContainer == 10 then + if curContainer == 9 then return false end curContainer = curContainer + 1 @@ -68,8 +70,9 @@ local function fillblock() turnedLeft = not turnedLeft else turtle.forward() - turtle.down() end + turtle.down() + return true end while fillblock() do end From 7746998019cd588207d2aa02a75b70443feeb380 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Apr 2012 21:33:45 +0200 Subject: [PATCH 3/3] more fixes for makefloor --- makefloor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/makefloor b/makefloor index 2263b87..79c2c8c 100644 --- a/makefloor +++ b/makefloor @@ -1,6 +1,5 @@ local args = { ... } - --[[ local function placeholder() return true end local turtle = {} @@ -18,14 +17,16 @@ turtle.placeDown = placeholder turtle.select = placeholder ]] -turnedLeft = nil +local turnedLeft = nil if args[1] == "rightturn" or args[1] == "leftturn" then - local turnedLeft = (args[1] == "rightturn") + turnedLeft = (args[1] == "rightturn") else print("usage: \"makefloor [leftturn|rightturn]\" whatever the first turn may be") return end +print(turnedLeft) + local curContainer = 1 turtle.select(curContainer)