Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get QwPsPGTg startup
- -- -------------------------------------------
- -- Dark iron farm -Sinkir-
- -- Version 1.0 (2014/10/11)
- -- slot 1 Wrath Igniter +-+-+-+-+
- -- slot 2 Iron block |W|I| | |
- -- slot 16 Fuel | | | | |
- -- | | | | |
- -- | | | |F|
- -- +-+-+-+-+
- -- -------------------------------------------
- -- _____
- -- | ___| _ _ __ ___
- -- | |_ | | | | '_ \ / __|
- -- | _|| |_| | | | | (__
- -- |_| \__,_|_| |_|\___|
- --
- count = function(id)
- return turtle.getItemCount(id)
- end
- select = function(id)
- return turtle.select(id)
- end
- fuel = function()
- return turtle.getFuelLevel()
- end
- function testFuel()
- if(fuel() < 1)then
- print('Plus de coco, test de refuel')
- select(16)
- turtle.refuel(1)
- end
- if(count(16) == 0)then
- return false
- end
- return true
- end
- function checkFuel()
- if(turtle.compareTo(16) == true)then
- if(count(16) < 64) then
- turtle.transferTo(16, turtle.getItemSpace(16))
- end
- end
- end
- function dropAll()
- local flag
- for i=3,15 do
- if(count(i)>0)then
- select(i)
- checkFuel()
- flag = turtle.dropDown()
- if(flag == false)then
- sleep(1)
- i = i-1
- end
- end
- end
- return true
- end
- function init()
- if(turtle.detectUp() == true)then
- if(turtle.back() == false)then
- print("can't go back; exit")
- shell.exit()
- else
- return true
- end
- end
- if(turtle.detect() == false)then
- if(count(2) == 0)then
- print("no iron block; reboot")
- sleep(30)
- os.reboot()
- end
- end
- end
- function checkIgniter()
- if(count(1) == 0)then
- select(1)
- if(turtle.suckDown() == false)then
- print("can't get Igniter")
- return false
- end
- end
- return true
- end
- function checkIronBlock()
- local i = 0
- if(turtle.detect() == true)then
- select(2)
- if(turtle.compare() == true)then
- i = 0
- while (i < 16)do
- sleep(0.5)
- if(turtle.compare() == false)then
- i = 16
- else
- i = i+1
- end
- end
- if(turtle.compare() == true)then
- reIgnite()
- else
- turtle.dig()
- end
- else
- turtle.dig()
- end
- else
- if(count(2) == 1)then
- select(2)
- turtle.place()
- sleep(10)
- turtle.dig()
- turtle.dropDown()
- sleep(1)
- os.reboot()
- elseif(count(2) > 0)then
- select(2)
- turtle.place()
- else
- sleep(30)
- os.reboot()
- end
- end
- end
- function reIgnite()
- testFuel()
- if(checkIgniter() == false)then
- print("no Igniter; exit")
- shell.exit()
- end
- if(turtle.detect() == true)then
- select(2)
- if(turtle.dig() == true)then
- turtle.forward()
- select(1)
- turtle.place()
- select(2)
- turtle.back()
- end
- end
- end
- -- __ __ _ ____
- -- | \/ | __ _(_)_ __ / /\ \
- -- | |\/| |/ _` | | '_ \| | | |
- -- | | | | (_| | | | | | | | |
- -- |_| |_|\__,_|_|_| |_| | | |
- -- \_\/_/
- --
- testFuel()
- init()
- stop = false
- while(stop==false)do
- checkIgniter()
- checkIronBlock()
- dropAll()
- --sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement