SHOW:
|
|
- or go back to the newest paste.
| 1 | - | function GetLevels() |
| 1 | + | function getLevels() |
| 2 | local Levels = m.getLevels() | |
| 3 | print("There are ".. Levels.." levels stored")
| |
| 4 | end | |
| 5 | ||
| 6 | function Enchant() | |
| 7 | term.clear() | |
| 8 | term.setCursorPos(1,1) | |
| 9 | select(1) | |
| 10 | - | GetLevels() |
| 10 | + | getLevels() |
| 11 | print("Enchanting item at Which Level?")
| |
| 12 | local LVLS = tonumber(m.getLevels()) | |
| 13 | local EnchantLVL = tonumber(read()) | |
| 14 | - | if EnchantLVL > 30 then |
| 14 | + | |
| 15 | term.setCursorPos(1,1) | |
| 16 | if type(EnchantLVL) ~= "number" then | |
| 17 | print("Cannot enchant, you probably did not enter a number.")
| |
| 18 | sleep(2) | |
| 19 | elseif EnchantLVL > 30 then | |
| 20 | print("Cannot enchant with more then 30 Levels.")
| |
| 21 | sleep(2) | |
| 22 | elseif EnchantLVL > LVLS then | |
| 23 | print("Cannot enchant, not enough Levels available.")
| |
| 24 | sleep(2) | |
| 25 | elseif m.enchant(EnchantLVL) == true then | |
| 26 | print("Enchanting succeeded, please check your item.")
| |
| 27 | sleep(5) | |
| 28 | else | |
| 29 | print("Enchanting failed, either there is no item in slot 1, or it is not enchantable.")
| |
| 30 | sleep(2) | |
| 31 | end | |
| 32 | end | |
| 33 | - | print("To enchant an item, place it in slot 1 and press any character key...")
|
| 33 | + | |
| 34 | m=peripheral.wrap("right")
| |
| 35 | while true do | |
| 36 | term.clear() | |
| 37 | term.setCursorPos(1,1) | |
| 38 | print("To enchant an item, place it in slot 1 and press any character key to continue...")
| |
| 39 | os.pullEvent("char")
| |
| 40 | Enchant() | |
| 41 | end |