Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Shadow_Assailant's Dark Iron Forge--
- --v2.0--
- local function checkInv(b) -- Searches for a slot with items and bypasses empty inventory slots
- turtle.select(b)
- if turtle.getItemCount(b)==0 then
- repeat
- b = b + 1
- turtle.select(b)
- until turtle.getItemCount(b)>0 or b==16
- end
- end
- local function transfering()
- local z = 1
- local l = turtle.getItemCount(16)
- repeat
- if turtle.getItemCount(z)<64 then
- local s = turtle.getItemSpace(z)
- turtle.select(16)
- turtle.transferTo(z,s)
- l = l - s
- z = z + 1
- else
- z = z + 1
- end
- until l<=0
- end
- local function wait(m)
- m = m + 1
- if m >= 10 then
- term.clear()
- term.setCursorPos(1,1)
- print("Must let Wrath Fire regrow!")
- print("Sleeping...")
- sleep(90)
- term.clear()
- term.setCursorPos(1,1)
- print("Resuming work!")
- term.setCursorPos(1,1)
- m = 0
- end
- end
- for t = 1, 16 do
- for f = 1, 15 do
- while 2 > 1 do
- term.clear()
- term.setCursorPos(1,1)
- local b = 1 -- So the above function defaults at 1
- local m = 0
- local i = 0 -- Inventory 1 - 16
- local q = 0 -- Inventory 1 - 15
- i = turtle.getItemCount(t) -- Should(?) count items in each slot
- q = turtle.getItemCount(f)
- if i>0 then
- term.setCursorPos(1,1)
- print("Creating Dark Iron!")
- term.setCursorPos(1,1)
- if turtle.getItemCount(16)>0 and q>=897 then -- If the inventory is FULL of Iron, there needs to be space for the Dark Iron, so it creates 1 slot for space
- turtle.select(16)
- turtle.drop()
- turtle.select(1)
- i = i - turtle.getItemCount(16) -- Seeing as these blocks are gone, the count needs to be recaculated
- elseif turtle.getItemCount(16)>0 and q<897 then
- transfering()
- turtle.select(1)
- end
- turtle.turnRight()
- turtle.turnRight()
- while i>0 and turtle.getItemCount(t)>0 do
- checkInv(b)
- turtle.place()
- sleep(3)
- turtle.dig()
- wait(m)
- i = i - 1 -- One less block of regular iron, so must take that into account
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(t)
- turtle.drop()
- turtle.select(1)
- else
- term.clear()
- sleep(1) -- Will wait until I give it iron
- print("Waiting!")
- sleep(1)
- term.setCursorPos(1,1)
- i = turtle.getItemCount(t)
- q = turtle.getItemCount(f)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment