Jump to content




Whenever I do parallel.waitForAnY() the other display disappears, then reappears in >1 seconds


  • You cannot reply to this topic
2 replies to this topic

#1 n1ghtk1ng

  • Members
  • 58 posts

Posted 11 December 2012 - 03:21 PM

I hope the title explained my problem right. What the program does is on one side display an input/stats(currently just have Solar Panels)
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/qJpJLKPm

#2 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 12 December 2012 - 10:09 AM

You don't have to use parallel, you need more like a timer for os.pullEvent(), so every time the timer start an event, then you update the right screen, like this:
local tTimer = os.startTimer(the_time_you_want_it_to_wait_to_update)
local event, param = os.pullEvent()
if event == "timer" then
--update the right screen code
end


#3 n1ghtk1ng

  • Members
  • 58 posts

Posted 12 December 2012 - 10:31 AM

View Postanonimo182, on 12 December 2012 - 10:09 AM, said:

You don't have to use parallel, you need more like a timer for os.pullEvent(), so every time the timer start an event, then you update the right screen, like this:
local tTimer = os.startTimer(the_time_you_want_it_to_wait_to_update)
local event, param = os.pullEvent()
if event == "timer" then
--update the right screen code
end
Sorry, I don't quite get what you mean. Can you place it in my code so that I can understand it better?

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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users