Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 'flat' for turtles
- -- Made by ryanv09
- -- edited by pirateandy (support multiple slots of cobblestone, starting at slot 1)
- -- Place the turtle at southwest corner of desired surface
- arg = {...}
- length = arg[1]
- width = arg[2]
- slots = 1
- turtle.select(slots)
- -- Usage
- if (length == nil or width == nil) then
- print ("Usage: flat <length> <width>")
- return
- end
- -- Checks if the turtle is empty
- -- If empty, pauses turtle until last slot has resources
- function empty()
- print ("\nchecking slot: ")
- print (slots)
- if (turtle.getItemCount(slots) == 0) then
- if( slots < 17 ) then
- slots = slots + 1
- turtle.select(slots)
- end
- end
- end
- for i=0,(width - 1),1 do
- for j=1,(length - 1),1 do
- empty()
- turtle.forward()
- turtle.placeDown()
- end
- if (i % 2 == 0) then
- if (i ~= width - 1) then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- empty()
- turtle.placeDown()
- end
- else
- if (i ~= width - 1) then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- empty()
- turtle.placeDown()
- end
- end
- if (j ~= length - 1) then
- empty()
- turtle.placeDown()
- end
- end
- print("\nSurface complete.")
Advertisement
Add Comment
Please, Sign In to add comment