Dodedodo33

Enchant Turtle

May 18th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GetLevels()
  2.    m=peripheral.wrap("right")
  3.    local Levels = m.getLevels()  
  4.    print("There are ".. Levels.." levels stored")
  5. end
  6.  
  7. function Enchant()
  8.    term.clear()
  9.    term.setCursorPos(1,1)
  10.    select(1)
  11.    GetLevels()
  12.    print("Enchanting item at Which Level?")
  13.    print("Choose from 5,10,15,20,25 or 30")
  14.    local EnchantLVL = tonumber(read())
  15.    if EnchantLVL > Levels then
  16.       print("Cannot enchant, not enough Levels available.")
  17.       sleep(3)
  18.    else
  19.       m.enchant(EnchantLVL)
  20.    end
  21. end
  22.  
  23. while true do
  24. term.clear()
  25. term.setCursorPos(1,1)
  26. print("To enchant an item, place it in slot 1 and press any character key...")
  27. os.pullEvent("char")
  28. Enchant()
  29. end
Advertisement
Add Comment
Please, Sign In to add comment