Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print( "Hello! I can make a platform, say you need a floor or a roof or just a flat surface I can do it" )
- print( "Push any key to continue" )
- os.pullEvent( "key" )
- term.clear()
- term.setCursorPos(1, 1)
- print( "Place me in the bottom left corner that you would like to be your platform." )
- print( "Push any key to continue" )
- os.pullEvent( "key" )
- term.clear()
- term.setCursorPos(1, 1)
- print( "How long would you like the first side to be? This will be the first length" )
- local a = io.read()
- local length = tonumber( a )
- term.clear()
- term.setCursorPos(1, 1)
- print( "How long would you like the width to be?" )
- local b = io.read()
- local width = tonumber( b )
- term.clear()
- term.setCursorPos(1, 1)
- local counterLength = 1
- local counterWidth = 1
- local inventory = 1,15
- local direction = 0
- local slot = 1
- local function floor()
- turtle.digDown()
- turtle.placeDown()
- counterLength = counterLength + 1
- turtle.forward()
- end
- while true do
- print( "Building..." )
- while turtle.getItemCount(slot) == 0 do
- for i=1,15 do
- slot = i
- turtle.select(i)
- if turtle.compareTo(16) == true
- then break
- else
- turtle.drop()
- end
- end
- if turtle.getItemCount(slot) == 0 then
- print( "I ran out of blocks... Can I have some more? Press a key when ready" )
- os.pullEvent( "key" )
- else
- end
- end
- floor()
- if counterLength == length then
- if direction == 0 then
- turtle.digDown()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- direction = 1
- counterLength = 1
- counterWidth = counterWidth +1
- end
- end
- if counterLength == length then
- if direction == 1 then
- turtle.digDown()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- direction = 0
- counterLength = 1
- counterWidth = counterWidth +1
- end
- end
- if counterWidth == width + 1 then
- term.clear()
- term.setCursorPos()
- print( "Platform is complete!" )
- os.pullEvent( "key" )
- startup()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement