Advertisement
Farrk

MFRAutoEnchanter_1.6.4

Dec 18th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. direction="north"
  2. slotNum=2
  3.  
  4. m=peripheral.wrap("front")
  5. function checkSlot(slot)
  6. stackInfo=m.getStackInSlot(slot)
  7. if stackInfo ~= nil then
  8. itemPresent=true
  9. else
  10. itemPresent=false
  11. end
  12. return itemPresent
  13. end
  14.  
  15. function enchantThing()
  16. while turtle.getItemCount(1)<1 do
  17. turtle.select(slotNum)
  18. turtle.transferTo(1)
  19. turtle.select(1)
  20. os.sleep(1)
  21. slotNum=slotNum+1
  22. if slotNum>16 then slotNum=2 end
  23. end
  24.  
  25. turtle.drop(1)
  26. os.sleep(1)
  27.  
  28. while checkSlot(1) do
  29. print("Waiting for current enchantment to finish.")
  30. os.sleep(2)
  31. end
  32.  
  33. os.sleep(1)
  34. while checkSlot(2) do
  35. print("Taking out enchanted things.")
  36. m.pushItem(direction,2,64)
  37. os.sleep(1)
  38. end
  39. end
  40.  
  41. while 1 do
  42. shell.run("clear")
  43. while checkSlot(1) do
  44. print("Wait for current enchantment to finish.")
  45. os.sleep(2)
  46. m.pushItem(direction,2,1)
  47. end
  48. print("How many enchant attempts?")
  49. amount=read()
  50. for i=1,amount do
  51. enchantThing()
  52. os.sleep(1)
  53. end
  54. print("Done. Enchanted "..amount.." items!")
  55. print("Press any button to reset turtle.")
  56. os.pullEvent()
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement