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

Wireless Mining Turtle W/ Rednet

Started by wakafanykai123, 07 January 2013 - 04:57 AM
wakafanykai123 #1
Posted 07 January 2013 - 05:57 AM
Hey all, I'm looking for someone to explain/ or write code for this program I've been thinking of.
It would allow you to just broadcast over rednet "Mine" and the turtle would receive that(basically keep rednet open and receiving in the background forever)and start mining out a pre-programed mineshaft or such. And to stop it you would broadcast "Stop" and it would stop the current mining program. I have no idea if this is even possible, but could someone correct me if I'm wrong or its not possible?
Lyqyd #2
Posted 07 January 2013 - 06:02 AM
It's possible. This is one of the few instances in which the parallel API comes in handy, since the turtle movement calls eat events.
wakafanykai123 #3
Posted 07 January 2013 - 06:07 AM
It's possible. This is one of the few instances in which the parallel API comes in handy, since the turtle movement calls eat events.
Thanks for telling me its possible :)/>
BTW, how do you keep rednet open, like when you do rednet.recieve(), it only receives one message before it has to be re-typed. And you can't do anything till it receives.
KaBooMa #4
Posted 07 January 2013 - 06:20 AM
When you do rednet.open(side) it should be staying open. Does for me. If you mean how do you receive constantly and also run code, you can do rednet.receive(timeout) to make it only wait for a msg so long. I might have just told you info you wasn't asking for though :S Sorry if I did. :)/>
Lyqyd #5
Posted 07 January 2013 - 06:45 AM
Well, if you are going to do the parallel route, you have one function in a loop that does rednet.receive() or os.pullEvent() all the time, and the other function does whatever else you need it to do.
wakafanykai123 #6
Posted 07 January 2013 - 06:54 AM
Well, if you are going to do the parallel route, you have one function in a loop that does rednet.receive() or os.pullEvent() all the time, and the other function does whatever else you need it to do.
Thanks.
Could someone help me with coding it?
ChunLing #7
Posted 07 January 2013 - 09:45 PM
Yes. But only help.

That is to say, if you're looking for complete code that you don't need to be able to maintain yourself, you should be looking through the Turtle Programs forum for good Remote Control programs. This forum is more for helping people who are writing their own programs and have run into difficulties.