3 posts
Posted 18 May 2014 - 02:34 AM
Hello, I am looking for a program that I can use to tell several wireless mining turtles to run "tunnel 60"
from one central computer. I am not able to find a tutorial on youtube and I have no idea how to code the computers in computercraft.
8543 posts
Posted 18 May 2014 - 12:03 PM
Moved to General.
995 posts
Location
Canada
Posted 18 May 2014 - 03:02 PM
Simply make a rednet (easier than modems) rig to run shell commands. Here is an implementation that cannot be considered secure in any way, shape or form, but is relatively simple. It uses the new rednet protocols in 1.6 to have a small message filter, but don't count on this when on a server.
--# server computer
print("Enter command to send to computers:")
local command = read()
rednet.open("side") --#replace with your side for wireless modem, too lazy to write something complex
rednet.broadcast(command, "ArcticStormTurtleControl")
rednet.close()
--# client computers/turtles (This should be in a file called "startup"
rednet.open("side") --#replace with your side again
print("Waiting for command…")
local _, msg, = rednet.receive("ArcticStormTurtleControl")
rednet.close()
shell.run(msg)
Edited on 18 May 2014 - 01:02 PM
3 posts
Posted 20 May 2014 - 12:24 AM
Alright thanks, and I'm playing tekkit lite which runs computercraft os 1.5 I think; it's also on a private server so I wont have to worry about my friends ruining the program.
995 posts
Location
Canada
Posted 20 May 2014 - 12:51 AM
If you are on 1.5 you will need to reimplement that code, if copy-pasting the "rednet" file in rom/programs/apis from the new ComputerCraft builds and using it in the old ones doesn't work.
3 posts
Posted 20 May 2014 - 01:25 AM
What do you mean by reimplementing the code? Also I got computercrafts most recent update and installed it in normal ssp, typed in the codes, server one worked fine but the client/turtles one would give me an error apon rebooting the turtle. (bios:336: [string "startup"]:3: '<name>' expected)
Edited on 20 May 2014 - 06:54 AM