Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wall v2.0
- term.clear()
- term.setCursorPos(1,1)
- print("Wall 2.0 by subzero22")
- 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 block you want to build with in slot 9")
- print()
- function tall()
- print("How tall do you want it?")
- write("> ")
- t = tonumber(read())
- if t then
- else
- print("Please enter a number.")
- return tall()
- end
- end
- tall()
- function wall()
- print("How wide should it be?")
- write("> ")
- w = tonumber(read())
- if w then
- else
- print("Please enter a number.")
- return wall()
- end
- end
- wall()
- print("Build left or right?")
- write("> ")
- left = string.lower(read())
- a = 1
- c = 1
- t = t - 1
- h = 1
- turtle.select(1)
- function check()
- if turtle.getItemCount(c) == 0 then
- c = c + 1
- turtle.select(c)
- sleep(0.2)
- check()
- elseif c == 9 and turtle.getItemCount(9) <= 0 then
- print("Turtle ran out of resources to build with.")
- print("Please put more stuff in turtle and press any key to continue.")
- os.pullEvent("key")
- c = 1
- turtle.select(c)
- sleep(0.2)
- check()
- --[[ elseif turtle.compareTo(16) == false then
- c = c + 1
- select(c)
- sleep(0.2)
- check()
- ]]
- end
- end
- function place()
- check()
- while not turtle.place() do
- turtle.dig()
- --turtle.attack()
- end
- end
- function up()
- for i=1,t do
- place()
- while not turtle.up() do
- --turtle.attackUp()
- turtle.digUp()
- end
- end
- place()
- end
- function down()
- for i=1,t do
- place()
- while not turtle.down() do
- --turtle.attackDown()
- turtle.digDown()
- end
- end
- place()
- end
- function wall()
- if a == 1 then
- up()
- a = 0
- else
- down()
- a = 1
- end
- end
- function turn()
- if left == "left" then
- turtle.turnLeft()
- while not turtle.forward() do
- --turtle.attack()
- turtle.dig()
- end
- turtle.turnRight()
- else
- turtle.turnRight()
- while not turtle.forward() do
- --turtle.attack()
- turtle.dig()
- end
- turtle.turnLeft()
- end
- end
- for l=1,w do
- wall()
- turn()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement