Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Stripmine 2.0
- term.clear()
- term.setCursorPos(1,1)
- print("Stripmine 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()
- function long()
- print("How long do you want the tunnels?")
- write("> ")
- x = tonumber( read() )
- if x then
- else
- print("Please enter a number.")
- return long()
- end
- end
- long()
- function wide()
- print("How wide do you want each strip?")
- write("> ")
- w = tonumber( read() )
- if w then
- else
- print("Please enter a number.")
- return wide()
- end
- end
- wide()
- print("How many strips do you want?")
- write("> ")
- r = tonumber( read() )
- -- math to figure if strips is odd or even
- if r%2 == 1 then
- rm = "odd"
- else
- rm = "even"
- end
- print("Would you like the turtle to make the strips left or right?")
- write("> ")
- left = string.lower(read())
- --[[
- print("Does the turtle have ender chest support? (yes/no)")
- print("If so put ender chest in slot 9")
- write("> ")
- ch = string.lower(read())
- ]]
- if ch == yes then
- print("Would you like it to place torches? (yes/no)")
- print("If so put torches in slot 8")
- torch = string.lower(read())
- else
- print("Would you like it to place torches? (yes/no)")
- print("If so put torches in slot 9")
- torch = string.lower(read())
- end
- if torch == "yes" then
- print("How many spaces do you want each torch to be?")
- ts = tonumber( read() )
- end
- if torch == "yes" then
- tp = 7
- else
- tp = 8
- end
- s = 1
- w = w + 1
- rw = w * r
- tl = 1
- --[[
- fuel = x * r + w * r + rw
- flvl = turtle.getFuelLevel()
- turtle.select(1)
- while turtle.getFuelLevel() <= fuel do
- print("Turtle has "..flvl.." fuel and needs "..fuel.."fuel to strip this much.")
- print("Please put fuel in slot 1.")
- os.pullEvent("turtle_inventory")
- turtle.refuel(64)
- end
- print("Stripmine Starting")
- print("Turtle will use "..fuel.." fuel.")
- sleep(1)
- ]]
- function chest()
- if ch == "yes" then
- if turtle.getItemCount(tp) > 0 then
- turtle.select(9)
- if turtle.placeDown() == false then
- turtle.digDown()
- turtle.placeDown()
- end
- for i=1,tp do
- turtle.select(s)
- turtle.dropDown()
- s = s + 1
- end
- s = 1
- turtle.select(9)
- turtle.digDown()
- turtle.select(1)
- end
- turtle.select(1)
- end
- end
- function strip()
- chest()
- while not turtle.forward() do
- turtle.dig()
- sleep(0.6)
- end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.6)
- end
- while turtle.detectDown() do
- turtle.digDown()
- end
- if torch == "yes" then
- tl = tl + 1
- end
- if tl == ts then
- if ch == yes then
- to = 8
- else
- to = 9
- end
- if turtle.getItemCount(to) < 0 then
- print("Turtle is out of torches. Please place more in slot "..to)
- os.pullEvent("turtle_inventory")
- else
- turtle.select(to)
- if turtle.placeDown() == false then
- if turtle.placeUp() == false then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
- turtle.select(1)
- tl = 1
- end
- end
- function turn()
- if left == "left" then
- turtle.turnLeft()
- for i=1,w do
- strip()
- end
- turtle.turnLeft()
- left = "right"
- else
- turtle.turnRight()
- for i=1,w do
- strip()
- end
- turtle.turnRight()
- left = "left"
- end
- end
- function back()
- if rm == "odd" and left == "right" then
- turtle.turnLeft()
- for i=1,rw do
- strip()
- end
- turtle.turnRight()
- for i=1,x do
- strip()
- end
- end
- if rm == "odd" and left == "left" then
- turtle.turnRight()
- for i=1,rw do
- strip()
- end
- turtle.turnLeft()
- for i=1,x do
- strip()
- end
- end
- if rm == "even" and left == "left" then
- turtle.turnRight()
- for i=1,rw do
- strip()
- end
- end
- if rm == "even" and left == "right" then
- turtle.turnLeft()
- for i=1,rw do
- strip()
- end
- end
- end
- for i=1,r do
- for i=1,x do
- strip()
- end
- turn()
- end
- back()
- print("Turtle has completed it's job.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement