Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Pastebin: "PqesqdYK"
- --A=Alpha, B=Beta, F=Finished
- --This version is: A1
- --suggestion by Waynestar : make it use Ender-chests
- local tArgs = {...}
- if #tArgs < 1 then
- print("Write: stripmine <number>")
- return
- end
- --term.clear()
- --term.setCursorPos(1, 1)
- --print("Write <speed> or <slow>")
- --term.write("Which mode?>")
- --modeCheck = read()
- print("Mining: "..tArgs[1].." Cycles")
- function NeedFuel()
- local abo = 0
- for i = 1, tArgs[1] do
- abo = abo+27
- end
- print("You need this much fuel to complete all the cycles chosen: "..abo.." ")
- end
- function antiCobbleDirt()
- cow = 0
- low = 0
- for i = 1, 14 do
- cow = cow+1
- turtle.select(15)
- if turtle.getItemCount(cow) >= 0 then
- if turtle.compareTo(cow) == true then
- turtle.select(cow)
- turtle.drop()
- end
- end
- end
- end
- function DetectMob()
- while turtle.forward() == false do
- attackMob()
- checkBlock()
- end
- end
- function CheckSlots()
- local item = 0
- ea = turtle.getItemSpace(1)
- eb = turtle.getItemSpace(2)
- ec = turtle.getItemSpace(3)
- ed = turtle.getItemSpace(4)
- ee = turtle.getItemSpace(5)
- ef = turtle.getItemSpace(6)
- eg = turtle.getItemSpace(7)
- eh = turtle.getItemSpace(8)
- ei = turtle.getItemSpace(9)
- ej = turtle.getItemSpace(10)
- ek = turtle.getItemSpace(11)
- el = turtle.getItemSpace(12)
- em = turtle.getItemSpace(13)
- en = turtle.getItemSpace(14)
- eo = turtle.getItemSpace(15)
- ep = turtle.getItemSpace(16)
- item = item+ea
- item = item+eb
- item = item+ec
- item = item+ed
- item = item+ee
- item = item+ef
- item = item+eg
- item = item+eh
- item = item+ei
- item = item+ej
- item = item+ek
- item = item+el
- item = item+em
- item = item+en
- item = item+eo
- item = item+ep
- print("You have a total of this much capacity left, in the turtle:")
- print(item)
- end
- function CheckBlockUp()
- while turtle.detectUp() == true do
- turtle.digUp()
- if turtle.detectUp() == true then
- sleep(0.4)
- end
- end
- end
- function StartFuel()
- if turtle.getFuelLevel() == 0 then
- turtle.select(1)
- turtle.refuel(1)
- turtle.select(2)
- turtle.refuel(1)
- turtle.select(3)
- turtle.refuel(1)
- turtle.select(4)
- turtle.refuel(1)
- turtle.select(5)
- turtle.refuel(1)
- turtle.select(6)
- turtle.refuel(1)
- turtle.select(7)
- turtle.refuel(1)
- turtle.select(8)
- turtle.refuel(1)
- turtle.select(9)
- turtle.refuel(1)
- turtle.select(10)
- turtle.refuel(1)
- turtle.select(11)
- turtle.refuel(1)
- turtle.select(12)
- turtle.refuel(1)
- turtle.select(13)
- turtle.refuel(1)
- turtle.select(14)
- turtle.refuel(1)
- turtle.select(15)
- turtle.refuel(1)
- turtle.select(16)
- turtle.refuel(1)
- print("I tried to consume some coal to keep my fuel level up")
- end
- end
- function CheckItems()
- local item = 0
- ea = turtle.getItemCount(1)
- eb = turtle.getItemCount(2)
- ec = turtle.getItemCount(3)
- ed = turtle.getItemCount(4)
- ee = turtle.getItemCount(5)
- ef = turtle.getItemCount(6)
- eg = turtle.getItemCount(7)
- eh = turtle.getItemCount(8)
- ei = turtle.getItemCount(9)
- ej = turtle.getItemCount(10)
- ek = turtle.getItemCount(11)
- el = turtle.getItemCount(12)
- em = turtle.getItemCount(13)
- en = turtle.getItemCount(14)
- eo = turtle.getItemCount(15)
- ep = turtle.getItemCount(16)
- item = item+ea
- item = item+eb
- item = item+ec
- item = item+ed
- item = item+ee
- item = item+ef
- item = item+eg
- item = item+eh
- item = item+ei
- item = item+ej
- item = item+ek
- item = item+el
- item = item+em
- item = item+en
- item = item+eo
- item = item+ep
- print("You have a total of this many items, in the turtle:")
- print(item)
- end
- function CheckFuel()
- if turtle.getFuelLevel() == 30 then
- turtle.select(1)
- turtle.refuel(1)
- turtle.select(2)
- turtle.refuel(1)
- turtle.select(3)
- turtle.refuel(1)
- turtle.select(4)
- turtle.refuel(1)
- turtle.select(5)
- turtle.refuel(1)
- turtle.select(6)
- turtle.refuel(1)
- turtle.select(7)
- turtle.refuel(1)
- turtle.select(8)
- turtle.refuel(1)
- turtle.select(9)
- turtle.refuel(1)
- turtle.select(10)
- turtle.refuel(1)
- turtle.select(11)
- turtle.refuel(1)
- turtle.select(12)
- turtle.refuel(1)
- turtle.select(13)
- turtle.refuel(1)
- turtle.select(14)
- turtle.refuel(1)
- turtle.select(15)
- turtle.refuel(1)
- turtle.select(16)
- turtle.refuel(1)
- print("I tried to consume some coal to keep my fuel level up")
- end
- if turtle.getFuelLevel() == 5 then
- turtle.select(1)
- turtle.refuel(1)
- turtle.select(2)
- turtle.refuel(1)
- turtle.select(3)
- turtle.refuel(1)
- turtle.select(4)
- turtle.refuel(1)
- turtle.select(5)
- turtle.refuel(1)
- turtle.select(6)
- turtle.refuel(1)
- turtle.select(7)
- turtle.refuel(1)
- turtle.select(8)
- turtle.refuel(1)
- turtle.select(9)
- turtle.refuel(1)
- turtle.select(10)
- turtle.refuel(1)
- turtle.select(11)
- turtle.refuel(1)
- turtle.select(12)
- turtle.refuel(1)
- turtle.select(13)
- turtle.refuel(1)
- turtle.select(14)
- turtle.refuel(1)
- turtle.select(15)
- turtle.refuel(1)
- turtle.select(16)
- turtle.refuel(1)
- print("I tried to consume some coal to keep my fuel level up")
- end
- if turtle.getFuelLevel() == 0 then
- print("Shutting down...Reason: No fuel")
- sleep(20)
- shell.run("shutdown")
- end
- end
- function StopTorch()
- if turtle.getItemCount(16) == 0 then
- print("Shutting down...Reason: Not enough torches")
- sleep(20)
- shell.run("shutdown")
- end
- end
- function attackMob()
- while turtle.attack() == true do
- turtle.attack()
- sleep(0.6)
- end
- end
- function checkBlock()
- while turtle.detect() == true do
- turtle.dig()
- if turtle.detect() == true then
- sleep(0.4)
- end
- end
- end
- function forward1()
- CheckFuel()
- CheckBlockUp()
- attackMob()
- checkBlock()
- CheckBlockUp()
- DetectMob()
- attackMob()
- CheckBlockUp()
- CheckFuel()
- turtle.digDown()
- turtle.down()
- checkBlock()
- turtle.digDown()
- turtle.select(15)
- turtle.placeDown()
- end
- function forward()
- attackMob()
- StopTorch()
- CheckFuel()
- checkBlock()
- CheckBlockUp()
- DetectMob()
- attackMob()
- CheckBlockUp()
- checkBlock()
- turtle.digDown()
- turtle.select(15)
- turtle.placeDown()
- end
- function mine()
- antiCobbleDirt()
- forward1()
- forward()
- turtle.up()
- CheckBlockUp()
- turtle.down()
- forward()
- attackMob()
- CheckFuel()
- StopTorch()
- checkBlock()
- CheckBlockUp()
- turtle.up()
- turtle.turnRight()
- attackMob()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- turtle.turnLeft()
- turtle.turnLeft()
- attackMob()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- checkBlock()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- attackMob()
- checkBlock()
- turtle.digDown()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- turtle.turnRight()
- turtle.turnRight()
- attackMob()
- checkBlock()
- CheckFuel()
- DetectMob()
- turtle.digDown()
- turtle.digDown()
- attackMob()
- checkBlock()
- CheckBlockUp()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- checkBlock()
- CheckFuel()
- DetectMob()
- attackMob()
- turtle.digDown()
- CheckBlockUp()
- checkBlock()
- turtle.digDown()
- CheckBlockUp()
- turtle.turnLeft()
- StopTorch()
- CheckFuel()
- turtle.select(16)
- turtle.digDown()
- turtle.placeDown()
- CheckFuel()
- end
- NeedFuel()
- sleep(5)
- shell.run("clear")
- print("Do not stand infront of this turtle...It may kill you!")
- sleep(5)
- shell.run("clear")
- print("The Creator of this program is -Andersfc-")
- sleep(2)
- shell.run("clear")
- CheckItems()
- CheckSlots()
- f = turtle.getFuelLevel()
- print("Your fuel level is:")
- print(f)
- z = turtle.getItemCount(16)
- print("You have this many items in slot #16:")
- print(z)
- print("Loading text...")
- sleep(10)
- shell.run("clear")
- print("Put torches in slot #16 to optionally place torches, or put an item/entity in the slot, so it wont place anything at all, put cobblestone or any desired block in slot #15 to make sure it places torches no matter what!")
- print("I use 27 fuel units, to move a cycle of a stripmine")
- print("My max capacity is 1024 Items")
- print("Loading program...")
- sleep(15)
- print("Starting the stripmine...")
- StartFuel()
- CheckFuel()
- for i = 1, tArgs[1] do
- mine()
- end
- shell.run("clear")
- print("I'm done mining Master!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement