Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- direction="north"
- slotNum=2
- m=peripheral.wrap("front")
- function checkSlot(slot)
- stackInfo=m.getStackInSlot(slot)
- if stackInfo ~= nil then
- itemPresent=true
- else
- itemPresent=false
- end
- return itemPresent
- end
- function enchantThing()
- while turtle.getItemCount(1)<1 do
- turtle.select(slotNum)
- turtle.transferTo(1)
- turtle.select(1)
- os.sleep(1)
- slotNum=slotNum+1
- if slotNum>16 then slotNum=2 end
- end
- turtle.drop(1)
- os.sleep(1)
- while checkSlot(1) do
- print("Waiting for current enchantment to finish.")
- os.sleep(2)
- end
- os.sleep(1)
- while checkSlot(2) do
- print("Taking out enchanted things.")
- m.pushItem(direction,2,64)
- os.sleep(1)
- end
- end
- while 1 do
- shell.run("clear")
- while checkSlot(1) do
- print("Wait for current enchantment to finish.")
- os.sleep(2)
- m.pushItem(direction,2,1)
- end
- print("How many enchant attempts?")
- amount=read()
- for i=1,amount do
- enchantThing()
- os.sleep(1)
- end
- print("Done. Enchanted "..amount.." items!")
- print("Press any button to reset turtle.")
- os.pullEvent()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement