Posted 01 July 2012 - 02:31 PM
Ok, so I want to create my first GUI that shows all my programs. I'm very new to coding so if you try to explain something please do it noobish :P/>/>
I use this code to go up and Down
First of all I want the Cursor to stop when it reaches the top or the bottom, how do I do this? Then of course I want to list all programs and make them chooseable with the cursor by pressing enter, how do I do this?
I use this code to go up and Down
local currentX = 1
local currentY = 1
function drawCursor()
term.clear() --Clears the screen
term.setCursorPos(currentX, currentY)
write(">")
end
while true do
drawCursor()
local e,key = os.pullEvent( "key" )
if key == 17 or key == 200 then
currentY = currentY -1
elseif key == 31 or key == 208 then
currentY = currentY +1
end
end
First of all I want the Cursor to stop when it reaches the top or the bottom, how do I do this? Then of course I want to list all programs and make them chooseable with the cursor by pressing enter, how do I do this?