Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Floor v2.0
- term.clear()
- term.setCursorPos(1,1)
- print("Floor 2.0 by subzero22")
- turtle.select(1)
- print("This code was originally for a new version of CC. It has been edited for an older version to be used in tekkit and so it might have some bugs.")
- print()
- --print("Put the item you want to build with in the bottom left slot.")
- print("")
- function long()
- print("How long do you want the foor to be?")
- write("> ")
- l = tonumber( read() )
- print()
- if l then
- else
- print("Please enter a number.")
- return long()
- end
- end
- long()
- function wide()
- print("How wide do you want the floor to be?")
- write("> ")
- w = tonumber( read() )
- print()
- if w then
- else
- print("Please enter a number")
- return wide()
- end
- end
- wide()
- print("Build left or right?")
- write("> ")
- left = string.lower(read())
- print("")
- print("would you like the turlte to dig the floor also? yes/no")
- write("> ")
- dig = string.lower(read())
- print("")
- s = 1
- l = l - 1
- turtle.select(s)
- function check()
- if turtle.getItemCount(s) == 0 then
- s = s + 1
- turtle.select(s)
- sleep(0.2)
- check()
- elseif s == 9 and turtle.getItemCount(9) <= 1 then
- print("Turtle ran out of resources to build with")
- print("Please refill turtle with needed blocks and")
- print("press any key to continue building")
- os.pullEven("key")
- s = 1
- turtle.select(s)
- sleep(0.2)
- check()
- --[[ elseif turtle.compareTo(16) == false then
- s = s + 1
- turtle.select(s)
- sleep(0.2)
- check()
- ]]
- end
- end
- function floor()
- check()
- if dig == "yes" then
- while not turtle.placeDown() do
- turtle.digDown()
- -- turtle.attackDown()
- sleep(0.1)
- end
- else
- while not turtle.placeDown() do
- -- turtle.attackDown()
- end
- end
- while not turtle.forward() do
- turtle.dig()
- -- turtle.attack()
- sleep(0.6)
- end
- end
- function turn()
- if left == "left" then
- turtle.turnLeft()
- floor()
- turtle.turnLeft()
- left = "right"
- else
- turtle.turnRight()
- floor()
- turtle.turnRight()
- left = "left"
- end
- end
- for a=1,w do
- for b=1,l do
- floor()
- end
- turn()
- end
Advertisement
Add Comment
Please, Sign In to add comment