This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tintolein's profile picture

Let user interact while beeing in a loop

Started by Tintolein, 19 December 2017 - 05:53 PM
Tintolein #1
Posted 19 December 2017 - 06:53 PM
I got a code which is devided into to while loops. Now I need to get an text the user has to write. The problem is that the user can´t interact because the while loop is blocking. P.S. the programm in running on a Monitor on the left of the Computer(monitor left Homescreen). Link to the program https://pastebin.com/vTUeKy6V
Propably something looks strange or can be done in a much easier way but now I only need the one answer.
My english isn´t that good to because I´m from germany but I thing it´s enought to understand me.
I would be really happy If someone could help me.
KingofGamesYami #2
Posted 19 December 2017 - 10:49 PM
You can use parallel.waitForAny to run another function which reads the input you want, at the same time.

It is also possible to effectively implement the read function alongside your current code, but that is much harder to do.

I speak very little German, but other members of this forum may speak more. It would be acceptable to provide a German version of your post, alongside an English translation.