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

Is it possible to have a Turtle doing something while receiving RN events

Started by Zepher48, 02 August 2012 - 05:25 PM
Zepher48 #1
Posted 02 August 2012 - 07:25 PM
Hey everybody,
What I would like to do, is have a master computer that controls all the turtles in the area, and from that, you are able to select a turtle and give it a task, such as mine to bedrock and come back, would there be a way to make my turtle stop mining half way through and perform a different task with a rednet message somehow?
Thanks for helping!
BigSHinyToys #2
Posted 02 August 2012 - 07:29 PM
First off the project you just described is a massive endeavor.

any way Simple answer Yes

More complex. using coroutines or parallel API you could have a program executing while a other program deciphers messages and issues instructions to the first program or terminates it then runs another program.

to quote my self this MAY be helpful full as it does something similar to what you want.

I don't know if this will be of any assistance. It is something along the lines of what you are trying to make But a bit complex and badly written.
http://pastebin.com/DxdiFF6R
In this you can see that i have several programs running at the same time doing different thinks It might be a bit hard to understand.

I never meant to release this code it is conceded scrap to me so I declare the above linked code OPEN SOURCE.
basically use it as you see fix.
Zepher48 #3
Posted 02 August 2012 - 07:38 PM
Okay thank you, yes it is a big project, ive already gotten started though, and if i cant get this to work, it will be okay, just i will have to make the turtles check in with the main server to see if anything has changed, which may be easier, i will look into coroutines and parallel API to see how they could help me,
Thanks alot!