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

10 Wireless Turtles with "Tunnel 50" Command?

Started by Nopsi, 30 October 2012 - 12:03 PM
Nopsi #1
Posted 30 October 2012 - 01:03 PM
Greetings,

sorry for my bad english, german user here.

i am totaly new to computer craft and fascinated by the opportunitys you have.

as a "normal" user on a server i am using my turtles to harvest materials etc.

atm i am using 20 mining turtles to make "tunnel 50"

10 in a row and 10 below them, which i am starting after the first row. from 40 to layer 6.

my idea is now: i am placing 10 wireless turtles and i wanted to send them all the command "tunnel 50"
so the first row starts at the exact same time.

i have installed the wireless modem on a terminal and on a mining turtle

i opened lua and activated the modem on the right side, at the computer and at the turtle.

my question is now:

is there an easy way to send to one or multiple turtles the "tunnel 50" command?
KaoS #2
Posted 30 October 2012 - 01:34 PM

rednet.open('right')
while true do
  local id,msg,dist==rednet.receive()
  if msg=='starttunnel' then
    shell.run('tunnel',50)
  end
end

then just broadcast the message 'starttunnel' and they will all start tunneling
Nopsi #3
Posted 30 October 2012 - 02:43 PM
thank you very much, when i destroy the turtle, cause i want to move it to a other position, the startup file will be deleted, right? can i avoid that somehow?
KaoS #4
Posted 30 October 2012 - 02:48 PM
label the turtle with the program (THIS IS NOT LUA CODE)

label set label

please note that the turtle will then no longer stack with other turtles
Nopsi #5
Posted 30 October 2012 - 03:52 PM
Hi KaoS,

thank you so much!

I made three test turtles and wrote the code into the startup code on a disk.

when i place a turtle right next to the disk drive i get a error message:

bios:206: [string "startup"]:3:
unexpected symbol i attach a pic of the code



what did i do wrong?
BigSHinyToys #6
Posted 30 October 2012 - 04:07 PM
local id,msg,dist==rednet.receive()

should be

local id,msg,dist = rednet.receive()
KaoS #7
Posted 30 October 2012 - 04:15 PM
derp. my bad lol
Nopsi #8
Posted 30 October 2012 - 04:30 PM
thank you both!

It Works! haha, that looks so cool, 10 mining turtles perfect synchron!

BigSHinyToys #9
Posted 30 October 2012 - 05:28 PM
derp. my bad lol

Don't worry about it that happens to me all the time. that is why I check my code before posting ALWAYS but that is just me.
KaoS #10
Posted 30 October 2012 - 05:41 PM
derp. my bad lol

Don't worry about it that happens to me all the time. that is why I check my code before posting ALWAYS but that is just me.

I'm at work lol. no MC