Posted 23 April 2013 - 08:49 PM
Hi all,
I'm new in lua and computercraft. After reading many informations in the wiki, i've wrote a little program to pilot my nuclear reactor.
Here is the code (uncommented) : http://pastebin.com/QTjVeYuA
After a while this program is running, the menu become laggy.
Some infos :
m refers to the wireless modem
r refers to the nuclear information reader
cb refers to the chat box
the menu has 3 items :
"Demarrer" for starting the nuclear reactor
"Arreter" for stopping it
"Quitter" to stop the program
In the main loop, I use this line to force an event for checking the heat of the reactor :
I think that the "lag" comes from here, but I don't know how to avoid this and keep checking the heat, even if a key is not stroke.
if someone can help me understand why it generate lag and how to avoid that, it will be great.
I'm new in lua and computercraft. After reading many informations in the wiki, i've wrote a little program to pilot my nuclear reactor.
Here is the code (uncommented) : http://pastebin.com/QTjVeYuA
After a while this program is running, the menu become laggy.
Some infos :
m refers to the wireless modem
r refers to the nuclear information reader
cb refers to the chat box
the menu has 3 items :
"Demarrer" for starting the nuclear reactor
"Arreter" for stopping it
"Quitter" to stop the program
In the main loop, I use this line to force an event for checking the heat of the reactor :
os.startTimer(0.2)
I think that the "lag" comes from here, but I don't know how to avoid this and keep checking the heat, even if a key is not stroke.
if someone can help me understand why it generate lag and how to avoid that, it will be great.