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

Help scripting multiple Turtles to tunnel via wireless

Started by dyveira, 12 August 2013 - 05:09 PM
dyveira #1
Posted 12 August 2013 - 07:09 PM
Topic: Help scripting multiple Turtles to tunnel via wireless

Content:

I am trying to figure out how to command multiple wireless Mining Turtles through a wirelessly-enabled computer. I have scoured the internet for a few days, gone to the Computercraft Wiki numerous times, browsed the forums and asked people on IRC, and I'm at a loss as how to figure this out. I have all the relevant items made, but if anyone could spell out for me in plain English to someone who is not one-hundred-percent familiar with Computercraft how to send a command to multiple Turtles wirelessly, I would be eternally grateful. Thank-you.
campicus #2
Posted 12 August 2013 - 08:51 PM
You would be looking for:

rednet.broadcast("mine")

If you broadcast that from a computer and have the turtles run something like this:

local id, message = rednet.receive()
if message == "mine" then
	shell.run("<yourMiningProgram>")
end
Check this tutorial out :

http://computercraft...Rednet_Tutorial
dyveira #3
Posted 12 August 2013 - 10:39 PM
I tried your suggestion, but I still can't get it to work. I save and run the script exactly as shown there, but the turtles don't move.
campicus #4
Posted 13 August 2013 - 12:27 AM
Are you getting an error? Do the turtles have enough fuel in them?
Lord_Spelunky #5
Posted 13 August 2013 - 12:46 AM
Change
shell.run("mine")
To
shell("<the program you want it to run")
campicus #6
Posted 13 August 2013 - 01:35 AM
Thanks Spelunky, my answer may have been ambiguous. Edited my response
jay5476 #7
Posted 13 August 2013 - 03:32 AM
make sure you have a wireless modem open on the turtles and computer NOTE: turtles have to be crafted with the wireless modem and then use rednet.open("right")
dyveira #8
Posted 14 August 2013 - 02:10 AM
I'm sorry guys, but I still cannot figure it out for the life of me. The tutorial isn't very helpful either, since there's too much fluff, and it's about 2 computers talking, not a computer telling a Turtle to do something. I've tried every variation of scripts and programs, and I can't make it work. I think I'm at my wit's end. :(/>
immibis #9
Posted 14 August 2013 - 03:53 AM
First, Turtles are just computers with movement ability. Everything that works on computers works on turtles.
Second, there is no built-in program to do remotely send commands. You will have to do some programming yourself, or find an existing program on the forums (like nsh)
Third, if you do decide to write a program yourself, programming is about putting things together. Once you know Lua's syntax (and you do need to know this) you can find out how to wait for a specific message, and find out how to run a program, and put them together - you don't need a tutorial that does exactly the thing you want to do. If you don't want to learn to program in Lua, then find an existing program
dyveira #10
Posted 14 August 2013 - 09:59 PM
It's alright, I've already given up on this, it's just too much of a pain in the arse for little gain. Maybe one day when I have patience again I will try it, but for now I honestly can't be bothered anymore. There's no space in my brain for more pointless knowledge. :P/>