Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- turtle.craft(number quantity ( if not supplied will craft as many as possible ))
- -- turtle.select(number slotNumber (1-16 in ComputerCraft 1.4+, otherwise 1-9))
- -- turtle.getItemCount(slot)
- -- turtle.suckDown([number amount])
- -- boolean true if at least one item was moved into the turtle's inventory; false otherwise.
- function craft_and_drop()
- turtle.select(16)
- turtle.craft()
- turtle.turnRight()
- turtle.turnRight()
- turtle.drop()
- turtle.turnRight()
- turtle.turnRight()
- end
- function dump(start_point,end_point)
- for i=start_point,end_point,1 do
- turtle.select(i)
- turtle.dropDown()
- end
- end
- while true do
- dump(1,16)
- turtle.select(1)
- turtle.suckDown(64)
- local blockcount = turtle.getItemCount(1)
- if blockcount > 3 then
- -- spread blocks out evenly
- local each_slot_count = math.floor(blockcount / 4)
- turtle.dropDown()
- turtle.suckDown(each_slot_count)
- turtle.select(2)
- turtle.suckDown(each_slot_count)
- turtle.select(5)
- turtle.suckDown(each_slot_count)
- turtle.select(6)
- turtle.suckDown(each_slot_count)
- craft_and_drop()
- else
- print('Waiting 5 min')
- os.sleep(300) -- 5 min
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment