When I use my menu(left side of the screen), the stas(right side of the screen disappears than reappears. How do I fix this?
#1
Posted 13 December 2012 - 05:13 AM
and on the left side is my menu that I can scroll through and enable/disable with enter which outputs things. Whenever I press enter (or the up/down arrow to scroll) the right(input/stats) side disappears, then reappears in about 1 second. How can I make this not do that?
Code : http://pastebin.com/Re6GKQxQ
#2
Posted 13 December 2012 - 05:15 AM
#3
Posted 13 December 2012 - 10:00 AM
#5
Posted 13 December 2012 - 12:10 PM
anonimo182, on 13 December 2012 - 10:00 AM, said:
n1ghtk1ng, on 13 December 2012 - 12:09 PM, said:
anonimo182, on 13 December 2012 - 10:00 AM, said:
EDIT: I understand how to use the timer, but I don't understand how to use it in my code.
EDIT2: Nevermind! I reread it a little bit later and I understand it now. Thanks!
EDIT3: Tested, it doesn't even print the right side of the screen anymore when I do your timer suggestion. Anyother ideas?
function PrintFinalStats() local tTimer = os.startTimer(3) local event, param = os.pullEvent() if event == "timer" then CheckTime() printDisplay() ReceiveStats() end end
#6
Posted 13 December 2012 - 03:50 PM
n1ghtk1ng, on 13 December 2012 - 12:10 PM, said:
anonimo182, on 13 December 2012 - 10:00 AM, said:
n1ghtk1ng, on 13 December 2012 - 12:09 PM, said:
anonimo182, on 13 December 2012 - 10:00 AM, said:
EDIT: I understand how to use the timer, but I don't understand how to use it in my code.
EDIT2: Nevermind! I reread it a little bit later and I understand it now. Thanks!
EDIT3: Tested, it doesn't even print the right side of the screen anymore when I do your timer suggestion. Anyother ideas?
function PrintFinalStats() local tTimer = os.startTimer(3) local event, param = os.pullEvent() if event == "timer" then CheckTime() printDisplay() ReceiveStats() end end
Make it so at every second(?) it updates, but get the line of "if event == "timer" then", just leave the functions there, so every event can update it, and if there are any events, the timer will do it
After all, you encase the function in a loop, so it always be processed, in this case:
while true do printFinalStats() end
#7
Posted 14 December 2012 - 02:26 AM
anonimo182, on 13 December 2012 - 03:50 PM, said:
n1ghtk1ng, on 13 December 2012 - 12:10 PM, said:
anonimo182, on 13 December 2012 - 10:00 AM, said:
n1ghtk1ng, on 13 December 2012 - 12:09 PM, said:
anonimo182, on 13 December 2012 - 10:00 AM, said:
EDIT: I understand how to use the timer, but I don't understand how to use it in my code.
EDIT2: Nevermind! I reread it a little bit later and I understand it now. Thanks!
EDIT3: Tested, it doesn't even print the right side of the screen anymore when I do your timer suggestion. Anyother ideas?
function PrintFinalStats() local tTimer = os.startTimer(3) local event, param = os.pullEvent() if event == "timer" then CheckTime() printDisplay() ReceiveStats() end end
Make it so at every second(?) it updates, but get the line of "if event == "timer" then", just leave the functions there, so every event can update it, and if there are any events, the timer will do it
After all, you encase the function in a loop, so it always be processed, in this case:
while true do printFinalStats() end
Can I make a suggestion here though. Given that you say parallel.waitForAny(......) using this code:
function PrintFinalStats() while true do CheckTime() printDisplay() ReceiveStats() end end
will most likely cause the program to terminate saying something about yielding. so put like a sleep(0.5) or something to make the program sleep for 0.5 seconds and not quit due to lack of "yield"
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users