Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Platform script, written by iPeer
- local args = { ... }
- local len = tonumber(args[1]) or 9999
- local width = tonumber(args[2]) or 9999
- local curwidth = width
- local dir = tonumber(args[3]) or 0
- local curlen = 0
- print("Creating a "..len.."x"..width.." platform")
- function hasBlocks()
- for s = 1, 16 do
- if turtle.getItemCount(s) > 0 then
- turtle.select(s)
- return true
- end
- end
- return false
- end
- for z = width-1, 0, -1 do
- for x = 0, len-1 do
- if not hasBlocks() then
- print("Out of blocks.")
- return
- end
- if not turtle.detectDown() then
- turtle.placeDown()
- end
- if (x < len-1) then
- if not turtle.forward() then
- break
- end
- end
- end
- if z > 0 then
- if dir == 1 then
- dir = 0
- turtle.turnRight()
- if not turtle.forward() then
- print("There\'s an obstruction.")
- break
- end
- turtle.turnRight()
- else
- dir = 1
- turtle.turnLeft()
- if not turtle.forward() then
- print("There\'s an obstruction.")
- break
- end
- turtle.turnLeft()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement