Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Shadow_Assailant's Dark Iron Forge--
- --v3.0--
- local function checkInv() -- 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
- end
- end
- local function transfering()
- 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 + 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
- while true do
- b = 1
- z = 1
- m = 0
- q = 0
- for f = 1, 15 do
- term.clear()
- term.setCursorPos(1,1)
- if turtle.getItemCount(f)>0 or turtle.getItemCount(16)>0 then
- term.setCursorPos(1,1)
- print("Creating Dark Iron!")
- term.setCursorPos(1,1)
- q = q + turtle.getItemCount(f)
- 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)
- elseif turtle.getItemCount(16)>0 and q<897 then
- q = q + turtle.getItemCount(16)
- transfering()
- turtle.select(1)
- end
- turtle.turnRight()
- turtle.turnRight()
- while q>0 do
- checkInv()
- turtle.place()
- sleep(3)
- turtle.dig()
- wait(m)
- q = q - 1 -- One less block of regular iron, so must take that into account
- end
- turtle.turnRight()
- turtle.turnRight()
- for t = 1, 16 do
- turtle.select(t)
- turtle.drop()
- end
- turtle.select(1)
- else
- b = 1
- z = 1
- m = 0
- q = 0
- term.clear()
- sleep(1) -- Will wait until I give it iron
- print("Waiting!")
- sleep(1)
- term.setCursorPos(1,1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment