Advertisement
Killer5252

Xp Enchanting Turtle

Jun 11th, 2013
1,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. mon = peripheral.wrap("left")
  2. xp = peripheral.wrap("right")
  3. xp.setAutoCollect(true)
  4. mon.setTextColor(colors.red)
  5. mon.setBackgroundColor(colors.black)
  6. mon.setTextScale(1)
  7.  
  8. function enchant()
  9. turtle.select(1)
  10. turtle.suckUp()
  11. turtle.transferTo(16, 1)
  12. turtle.select(16)
  13. xp.enchant(30)
  14. turtle.dropDown()
  15. inventclr()
  16. inventclr()
  17. end
  18.  
  19. function inventclr()
  20. z = 1
  21. repeat
  22. turtle.select(z)
  23. turtle.dropUp()
  24. z = z + 1
  25. until z == 17
  26. end
  27.  
  28. while true do
  29.   if xp.getLevels() > 29  then
  30.     enchant()
  31.   else
  32.   mon.clear()
  33.   mon.setCursorPos(1, 3)
  34.   mon.write("Enchanting:")
  35.   mon.setCursorPos(12, 3)
  36.   mon.write(math.floor(((xp.getLevels() / 30) * 100)))
  37.   mon.write("%")
  38.   mon.setCursorPos(1, 1)
  39.   mon.write("Level:")
  40.   mon.write(xp.getLevels())
  41.   sleep(5)
  42. end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement