southpole

Exp-Turtle

Jul 7th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. --Auto-Enchanting by Direwolf20 customized by Southp0le
  2.  
  3. -----------
  4. --Options--
  5. -----------
  6. monitor = peripheral.wrap("front")
  7. t = peripheral.wrap("right")
  8. m.setAutoCollect(true)
  9. local currLevel = 0
  10.  
  11. -------------
  12. --functions--
  13. -------------
  14. --grabs book and enchants it
  15. function enchantBook()
  16.    turtle.select(1)
  17.    turtle.suckUp()
  18.    turtle.dropUp(turtle.getItemCount(1)-1)
  19.    t.enchant(30)
  20.    turtle.dropUp()  
  21. end
  22.  
  23.  
  24. --function checkBook()
  25.  
  26. ---------
  27. --Cycle--
  28. ---------
  29. while true do
  30.    currLevel = t.getLevels()
  31.    monitor.setCursorPos(1,1)
  32.    monitor.write("Current")
  33.    monitor.setCursorPos(1,2)
  34.    monitor.write("Level:")
  35.    monitor.setCursorPos(1,4)
  36.    monitor.write(""..currLevel)
  37.    if currLevel >=30 then --if level >= 30 calls enchant function
  38.       enchantBook()
  39.    else
  40.       sleep(10)
  41.       monitor.clear()
  42.    end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment