Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetLevels()
- m=peripheral.wrap("right")
- local Levels = m.getLevels()
- print("There are ".. Levels.." levels stored")
- end
- function Enchant()
- term.clear()
- term.setCursorPos(1,1)
- select(1)
- GetLevels()
- print("Enchanting item at Which Level?")
- print("Choose from 5,10,15,20,25 or 30")
- local EnchantLVL = read()
- if type(Levels) ~= "number" then
- print("Incorrect value for enchanting level given, please try again...")
- sleep(3)
- elseif EnchantLVL > Levels then
- print("Cannot enchant, not enough Levels available.")
- sleep(3)
- elseif EnchantLVL == "5" then
- m.enchant(5)
- print("Enchanting Finished :)")
- elseif EnchantLVL == "10" then
- m.enchant(10)
- print("Enchanting Finished :)")
- elseif EnchantLVL == "15" then
- m.enchant(15)
- print("Enchanting Finished :)")
- elseif EnchantLVL == "20" then
- m.enchant(20)
- print("Enchanting Finished :)")
- elseif EnchantLVL == "25" then
- m.enchant(25)
- print("Enchanting Finished :)")
- elseif EnchantLVL == "30" then
- m.enchant(30)
- print("Enchanting Finished :)")
- else
- print("Incorrect value for enchanting level given, please try again...")
- sleep(3)
- end
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("To enchant an item, place it in slot 1 and press any character key...")
- os.pullEvent("char")
- Enchant()
- end
Advertisement
Add Comment
Please, Sign In to add comment