Posted 21 December 2012 - 11:29 AM
I'm working on a very complex project that controls many different computers with rednet messages. There is one command and control computer that all the other computers listen to for commands. This computer uses an os.pullEvent() function, which it waits either for redstone state changes or rednet messages. However, I would like this project to read from a file and send rednet messages based on the contents of the file, and not necessarily have to wait for an os.pullEvent(). I can either:
1. Come up with some convoluted way to set up an event queue to read from the file and send messages, possibly missing a critical rednet message from one of the computers or turtles.
2. Use a Coroutine to read the file and send messages, where I have no experience with coroutines.
3. Use another computer entirely to read from the file and send the rednet messages when the C&C computer sends a ready state.
I'm already using about 16-20 computers already, will one more computer slow things down at all? Or am I just a lazy coder who doesn't want to use proper event handling?
1. Come up with some convoluted way to set up an event queue to read from the file and send messages, possibly missing a critical rednet message from one of the computers or turtles.
2. Use a Coroutine to read the file and send messages, where I have no experience with coroutines.
3. Use another computer entirely to read from the file and send the rednet messages when the C&C computer sends a ready state.
I'm already using about 16-20 computers already, will one more computer slow things down at all? Or am I just a lazy coder who doesn't want to use proper event handling?