Posted 19 May 2013 - 04:02 PM
I'm trying to create an xp turtle program that allows the user to run certain functions, mainly: Just collecting levels, enchanting one item, auto enchanting items.
I'm stuck at to how to best accomplish that. My current idea is to have 4 seperate programs with shell.run to swap to the correct program.
The main problem is it's not responding the way i'd expect. Nothing is shown untill i enter a keypress then it seems to start up. I'm also worried I'm over thinking the entire thing and that I can do it all in one program. Any advice would be great. Thanks
I'm stuck at to how to best accomplish that. My current idea is to have 4 seperate programs with shell.run to swap to the correct program.
The main problem is it's not responding the way i'd expect. Nothing is shown untill i enter a keypress then it seems to start up. I'm also worried I'm over thinking the entire thing and that I can do it all in one program. Any advice would be great. Thanks
Spoiler
--enchanting menu
local level=read()
function clearScreen()
term.clear()
term.setCursorPos(1,1)
end
function menu ()
clearScreen()
print("Reganom's Enchanting")
print("1:Enchant items")
print("2:Auto Enchanter")
print("3:Auto Collecter")
print("Select an option:", read())
end
function levelSelect()
clearScreen()
print("What level would you like to enchant at?"
print("Level:", read())
end
end
while true do
menu()
local e, key = os.pullEvent('key')
if e == 1 then
levelSelect() -- should run levelSelect() which is then used in the shell.run as for the next program
shell.run("one", level)
elseif e == 2 then
levelSelect()
shell.run("two", level)
elseif e == 3 then
shell.run("three")
else
end
end