Posted 07 April 2013 - 08:45 AM
This is my program, I'm using the XP Turtle to auto collect XP in a different program, that works but this is my second program for user input to use the XP stored but line i don't know why it dosen't work? help please :/ Very gratefull :)/> thanks alot to any responses :D/> Line 16 crashes, says it should be a number
||||| Pastebin : http://pastebin.com/NZsLa53u |||||
[indent=1]function GetLevels()[/indent]
[indent=1]m = peripheral.wrap("left")[/indent]
[indent=1]local Levels = m.getLevels()[/indent]
[indent=1]print("There are "..Levels.." levels stored")[/indent]
[indent=1]end[/indent]
[indent=1]function EnchantFunction()[/indent]
[indent=1]print("Would You like to enchant an item?")[/indent]
[indent=1]local EnchantTrue = "Yes"[/indent]
[indent=1]local input = read()[/indent]
[indent=1]if input == EnchantTrue then[/indent]
[indent=1]print("Place item in slot 1")[/indent]
[indent=1]select(1)[/indent]
[indent=1]print("Enchanting Slot 1 At Which Level?")[/indent]
[indent=1]local EnchantLevel = read()[/indent]
[indent=1]m.Enchant("EnchantLevel")[/indent]
[indent=1]else[/indent]
[indent=1]print("You have not chosen to enchant, restarting")[/indent]
[indent=1]term.clear()[/indent]
[indent=1]term.setCursorPos(1,1)[/indent]
[indent=1]end[/indent]
[indent=1]end[/indent]
[indent=1]GetLevels()[/indent]
[indent=1]EnchantFunction()[/indent]
||||| Pastebin : http://pastebin.com/NZsLa53u |||||
[indent=1]function GetLevels()[/indent]
[indent=1]m = peripheral.wrap("left")[/indent]
[indent=1]local Levels = m.getLevels()[/indent]
[indent=1]print("There are "..Levels.." levels stored")[/indent]
[indent=1]end[/indent]
[indent=1]function EnchantFunction()[/indent]
[indent=1]print("Would You like to enchant an item?")[/indent]
[indent=1]local EnchantTrue = "Yes"[/indent]
[indent=1]local input = read()[/indent]
[indent=1]if input == EnchantTrue then[/indent]
[indent=1]print("Place item in slot 1")[/indent]
[indent=1]select(1)[/indent]
[indent=1]print("Enchanting Slot 1 At Which Level?")[/indent]
[indent=1]local EnchantLevel = read()[/indent]
[indent=1]m.Enchant("EnchantLevel")[/indent]
[indent=1]else[/indent]
[indent=1]print("You have not chosen to enchant, restarting")[/indent]
[indent=1]term.clear()[/indent]
[indent=1]term.setCursorPos(1,1)[/indent]
[indent=1]end[/indent]
[indent=1]end[/indent]
[indent=1]GetLevels()[/indent]
[indent=1]EnchantFunction()[/indent]