Hello, Im currently working on a programm to controll SGCrafts stargates.
Im trying to run multiple operations:
* Reading inputs from User
* check for an open connection (and send a redstone signal it it connected)
But its not working.
thread = require("thread")
function check()
while(true) do
-- Check and manage the signal
end
end
function userInput()
while(true) do
-- Process inputs
end
end
thread.create(check)
thread.create(userInput)
What is the Problem? When I start the first loop the other wont get started. (The same problem with coroutines)
So my Questions:
1) Is there any way to get this working?
2) (if not) is there any way to process code while waiting for an userinput via io.read()?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello, Im currently working on a programm to controll SGCrafts stargates.
Im trying to run multiple operations:
* Reading inputs from User
* check for an open connection (and send a redstone signal it it connected)
But its not working.
thread = require("thread") function check() while(true) do -- Check and manage the signal end end function userInput() while(true) do -- Process inputs end end thread.create(check) thread.create(userInput)
What is the Problem? When I start the first loop the other wont get started. (The same problem with coroutines)
So my Questions:
1) Is there any way to get this working?
2) (if not) is there any way to process code while waiting for an userinput via io.read()?
Thanks!
Link to post
Share on other sites