Another problem, and this one's a bit more complicated. This is the segment of my program I'm having issues with:
function clock() --// This function displays the time in the bottom right corner of the screen
while true do
time = os.time()
term.setCursorPos(44,19)
term.setBackgroundColor(colors.blue)
term.write(textutils.formatTime(os.time(),false))
sleep(.75)
end
end
function console() --// This function enters the console, and makes it look like it would when you first boot up.
term.setBackgroundColor(colors.black)
term.clear()
term.setTextColor(colors.yellow)
term.setCursorPos(1,1)
print("CraftOS 1.7")
term.setCursorPos(1,2)
end
function menu(userslot) --// "Userslot" simply tells the program what save the user is currently signed into.
local state = 0
local function click()
while true do
event,side,x,y = os.pullEvent("mouse_click")
if x >= 1 and x <= 7 and y == 19 then
state = 1
break
--// ...
elseif x >= 11 and x <= 20 and y >= 8 and y <= 9 then
state = 8
break
--// ...
end
end
end
parallel.waitForAny(clock,click)
if state == 1 then
desktopScreen(userslot)
desktop(userslot)
--// ...
elseif state == 8 then
console()
return
--// ...
end
end
My problem is near the end, with entering the console when the state == 8. It
does execute the console() function, however the cursor isn't blinking, or even present, and if you attempt typing anything, nothing happens (in the console, that is). I think that the issue is to do with the "parallel.waitForAny(clock,click)" line, because if you re-click on the button that launched the console it takes you back to the menu screen. I tried using the return function (the break function didn't work becuase it couldn't find anything to break), but it didn't seem to do anything at all. Am I missing something obvious here?
Here is a pretty pictures to help you:
https://www.dropbox.com/home?preview=Problem+Picture.pngPS: If you want to know why I used the "state" variable instead of simply executing the function, see [member='H4X0RZ']'s post earlier