Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("kapi")
- function burnCoal()
- local burnCoal = turtle.getItemCount(1)-1
- turtle.select(1)
- turtle.refuel(burnCoal)
- end
- while true do
- kapi.menu("I consume Orebs at my whims.\nPut coal in slot 1 to fuel my ire.\nPut the ignition key in slot 2.\nPut End Chest output in slot 3.\nYou have ten seconds to comply. If you're not ready, CTRL+T to stop.\n")
- sleep(10)
- kapi.printFuel()
- x = 0
- while x == 0 do
- if turtle.getFuelLevel() < 1000 then -- Check for fuel levels, if too low, will wait until fed.
- print("please feed me... coal in slot 1... \nPress enter when I have food")
- z = kapi.keyread()
- if z == keys.enter then
- print("nom, nom")
- burnCoal()
- kapi.printFuel()
- else
- print("Not valid input!")
- sleep(2)
- end
- else
- print("I am sated.")
- x = 1
- end
- end
- while x == 1 do -- Checks for the necessary end chest in front of the turtle to start the process
- turtle.select(3)
- if turtle.compare() == false then
- print("The Way is Shut. Place Ignition Chest in front of me.")
- sleep(30)
- term.clearLine()
- else
- x = 0
- end
- end -- ending ignition check
- time = 10
- while time > 0 do -- Countdown timer
- sleep(1)
- time = time-1
- if time > 0 then
- term.clear()
- print("Make sure to place me on the bottom left corner of 5x5, on the very top, facing inwards. Ensure two blocks of air is between me and the corner of the 5x5 block under me. Place End Chest connected to the ritual in front of me when ready to ignite.\n\nSnoozing for " ..time.. " seconds.")
- else
- term.clear()
- print("Attacking Oreb now")
- sleep(2)
- end
- end -- ending countdown timer
- if turtle.detect() == true then -- Put key in ignition
- turtle.select(2)
- turtle.drop(1)
- else
- print("Can't place inventory here! Terminating program.")
- break
- end
- kickoff = 0
- while kickoff == 0 do
- print("Starting Cycle...")
- turtle.select(1)
- print("Down 2")
- kapi.down(2)
- seriesStart = 1 -- Slice
- series = 1
- sideStart = 1 -- Side of Slice
- side = 1
- vertStart = 15 -- Initial vertical position (13)
- vert = 15
- horzStart = 5 -- Initial horzitional position (5)
- horz = 5
- while series < 9 do -- track cycles done
- while side < 5 do -- track sides done
- while horz > 0 do -- track forward distance
- while vert > 0 do -- track up and down distance
- if turtle.getItemCount(16) < 1 then
- vert = vert -1
- print("Mine 1 down, then move 1 down. \nCurrent position:"..vert)
- kapi.mine("d")
- kapi.down()
- else
- kapi.endDumpUp(4)
- turtle.select(4)
- print("Dumping")
- turtle.select(1)
- end
- if turtle.getFuelLevel() < 1000 then -- Check for fuel levels, if too low, eats fuel.
- burnCoal()
- print("refuelling")
- kapi.printFuel()
- else
- print("I'm sated.")
- end
- end --vert
- horz = horz-1
- vert = vertStart
- print("Going up "..vert.." blocks.")
- kapi.up(vert)
- print("Mining 1 forward then moving 1 forward.\nCurrent position:"..horz)
- kapi.mine("f")
- kapi.forward()
- end --horz
- side = side+1
- horz = horzStart-1
- print("Going backwards 1, then, turning 1, mining 1 forward then moving 1 forward.")
- kapi.turn("b")
- kapi.forward()
- kapi.turn("l")
- kapi.mine("f")
- kapi.forward()
- print("On side:"..side)
- kapi.printFuel()
- end -- side
- side = 1
- series = series+1 -- Track cycles
- print("Starting Series "..series)
- if series == 2 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- kapi.down()
- vertStart = 14 -- Initial vertical position
- vert = 14
- horzStart = 7 -- Initial horzitional position
- horz = 7
- elseif series == 3 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- vertStart = 14 -- Initial vertical position
- vert = 14
- horzStart = 9 -- Initial horzitional position
- horz = 9
- elseif series == 4 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- vertStart = 14 -- Initial vertical position
- vert = 14
- horzStart = 11 -- Initial horzitional position
- horz = 11
- elseif series == 5 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- kapi.down()
- vertStart = 13 -- Initial vertical position
- vert = 13
- horzStart = 13 -- Initial horzitional position
- horz = 13
- burnCoal()
- elseif series == 6 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- kapi.down()
- vertStart = 12 -- Initial vertical position
- vert = 12
- horzStart = 15 -- Initial horzitional position
- horz = 15
- elseif series == 7 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- vertStart = 12 -- Initial vertical position
- vert = 12
- horzStart = 17 -- Initial horzitional position
- horz = 17
- elseif series == 8 then
- print("Set position")
- kapi.turn("b")
- kapi.forward(2)
- kapi.turn("r")
- kapi.forward()
- kapi.turn("r")
- kapi.down()
- vertStart = 11 -- Initial vertical position
- vert = 11
- horzStart = 19 -- Initial horzitional position
- horz = 19
- else
- print("doneski")
- end
- end -- series
- print("returning to origin") -- return to origin and dump stuff
- kapi.turn("r")
- kapi.forward(7)
- kapi.turn("l")
- kapi.forward(6)
- kapi.up(6)
- print("Ending Cycle...")
- sleep(5)
- kapi.endDumpUp(4)
- burnCoal()
- if turtle.detect() == true then -- Taking key out of ignition
- turtle.select(2)
- turtle.suck(1)
- else
- print("Can't find inventory here! Terminating program.")
- break
- end -- Deignite
- time = 10800
- while time > 0 do -- Countdown timer
- sleep(1)
- time = time-1
- if time > 0 then
- term.clear()
- print("Make sure to place me on the bottom left corner of 5x5, on the very top, facing inwards. Ensure two blocks of air is between me and the nearest block under me. Place End Chest connected to the ritual in front of me when ready to ignite.\n\nSnoozing for " ..time.. " seconds.")
- else
- term.clear()
- print("Attacking Oreb now")
- sleep(2)
- end
- end -- ending countdown timer
- if turtle.detect() == true then -- Put key in ignition
- turtle.select(2)
- turtle.drop(1)
- else
- print("Can't place inventory here! Terminating program.")
- break
- end -- End the snooze cycle
- end -- ending the kickoff
- end -- ending the while true do
Add Comment
Please, Sign In to add comment