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

How to tell 5 or more wireless turtles to tunnel and then return

Started by JollyGreenFox, 29 August 2013 - 12:18 AM
JollyGreenFox #1
Posted 29 August 2013 - 02:18 AM
Title: How To Tell 5 Or More Wireless Turtles To Tunnel And Than Return

Im trying to figure out how to get 5 or more wireless turtles to make mine shafts and than return dumping items in a chest, i have looked around youtube and used the almighty google but found nothing, Im a miner and what these turtles do for me is create mine shafts and Hallways but starting them all one by one is getting annoying and i would like them to all start at once

Thanks In Advance for the Help
Jolly
Bubba #2
Posted 29 August 2013 - 07:11 AM
Split into new topic.
LBPHacker #3
Posted 29 August 2013 - 07:30 AM
First of all, show the code you currently have. We (or at least I) have no idea what you mean by tunneling and returning.
JollyGreenFox #4
Posted 29 August 2013 - 09:34 AM
First of all, show the code you currently have. We (or at least I) have no idea what you mean by tunneling and returning.

To be honest i have no code ive gone on youtube and tried one code but, there is a command called Tunnel that creates a 2x3 tunnel for the amount of blocks specified, also i want it to come back to where is started so i don't have to walk down the 50 long hall way and get it and all i know is
fs.copy(disk/jolly"),"jolly")
rednet.open("left)
but i have no idea if i can just start turtles tunneling because as i said before im a miner in my Work server
TheOddByte #5
Posted 29 August 2013 - 04:09 PM
First of all.. Check out the wiki about rednet and turtles
SpoilerAnd one way you could do is to run the pre-made tunnel program from your program by doing this

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks

And if you just want it to go back after that you could do something like this

--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end

But I guess you have a computer that you'd like to launch the turtles from right?
Then make a program like this that sends a message to all the turtles so they start mining together

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"

--Table with the turtles id, That I set to 1-5 here so just change them
local turtles = {
1, 2, 3, 4, 5,
}

for i = 1,#turtles do
  rednet.send(turtles[i],"StartMining")
end


Now the turtles have to receive those messages and start mining when they receive them

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"[/size]

repeat
id, msg = rednet.receive()
until msg == "StartMining" and id == 1337 -- Repeats until its the message StartMining and the id is 1337 which should be changed to your comp. id

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks
--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end
JollyGreenFox #6
Posted 03 September 2013 - 10:26 AM
First of all.. Check out the wiki about rednet and turtles
SpoilerAnd one way you could do is to run the pre-made tunnel program from your program by doing this

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks

And if you just want it to go back after that you could do something like this

--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end

But I guess you have a computer that you'd like to launch the turtles from right?
Then make a program like this that sends a message to all the turtles so they start mining together

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"

--Table with the turtles id, That I set to 1-5 here so just change them
local turtles = {
1, 2, 3, 4, 5,
}

for i = 1,#turtles do
  rednet.send(turtles[i],"StartMining")
end


Now the turtles have to receive those messages and start mining when they receive them

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"[/size]

repeat
id, msg = rednet.receive()
until msg == "StartMining" and id == 1337 -- Repeats until its the message StartMining and the id is 1337 which should be changed to your comp. id

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks
--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end
Okay i put all the code in as you have it written but the problem i have is it will not do the shell.run("rom/programs/turtle/tunnel, 50")
it will turn around tho but other than that i get nothing
TheOddByte #7
Posted 03 September 2013 - 11:21 AM
First of all.. Check out the wiki about rednet and turtles
SpoilerAnd one way you could do is to run the pre-made tunnel program from your program by doing this

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks

And if you just want it to go back after that you could do something like this

--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end

But I guess you have a computer that you'd like to launch the turtles from right?
Then make a program like this that sends a message to all the turtles so they start mining together

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"

--Table with the turtles id, That I set to 1-5 here so just change them
local turtles = {
1, 2, 3, 4, 5,
}

for i = 1,#turtles do
  rednet.send(turtles[i],"StartMining")
end


Now the turtles have to receive those messages and start mining when they receive them

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"[/size]

repeat
id, msg = rednet.receive()
until msg == "StartMining" and id == 1337 -- Repeats until its the message StartMining and the id is 1337 which should be changed to your comp. id

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks
--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end
Okay i put all the code in as you have it written but the problem i have is it will not do the shell.run("rom/programs/turtle/tunnel, 50")
it will turn around tho but other than that i get nothing

I think it should be

shell.run("/rom/programs/turtle/tunnel", 50) --This is arguments you enter and 50 should not be a string..

This is the same as doing
tunnel 50
JollyGreenFox #8
Posted 03 September 2013 - 12:26 PM
First of all.. Check out the wiki about rednet and turtles
SpoilerAnd one way you could do is to run the pre-made tunnel program from your program by doing this

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks

And if you just want it to go back after that you could do something like this

--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end

But I guess you have a computer that you'd like to launch the turtles from right?
Then make a program like this that sends a message to all the turtles so they start mining together

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"

--Table with the turtles id, That I set to 1-5 here so just change them
local turtles = {
1, 2, 3, 4, 5,
}

for i = 1,#turtles do
  rednet.send(turtles[i],"StartMining")
end


Now the turtles have to receive those messages and start mining when they receive them

rednet.open(sideHere) --Like "top", "bottom", "back", "front", "left", "right"[/size]

repeat
id, msg = rednet.receive()
until msg == "StartMining" and id == 1337 -- Repeats until its the message StartMining and the id is 1337 which should be changed to your comp. id

shell.run("rom/programs/turtle/tunnel", 50) --This would run the tunnel program and let it mine for 50 blocks
--Turning around, 180
for i = 1,2 do
  turtle.turnLeft()
end

-- Moving forward 50 blocks (This is the part where it goes back to you)
for i = 1,50 do
   turtle.forward()
end
Okay i put all the code in as you have it written but the problem i have is it will not do the shell.run("rom/programs/turtle/tunnel, 50")
it will turn around tho but other than that i get nothing

I think it should be

shell.run("/rom/programs/turtle/tunnel", 50) --This is arguments you enter and 50 should not be a string..

This is the same as doing
tunnel 50
right i understand that but i put it in the turtle and it only spun and says No such Program
TheOddByte #9
Posted 04 September 2013 - 11:02 AM
Hmm.. Have you tested just using 'shell.run("tunnel", 50)'

Edit: Tested using 'shell.run("tunnel", 50)' and 'shell.run("/rom/programs/turtle/tunnel", 50' and both worked.. Are you using a mining turtle or are you missing the tunnel program?

Do this to check that you have it:
cd rom/programs/turtle
ls
Then tunnel should show up

And make sure that it is 'tunnel' and not 'Tunnel' or something since Lua is case sensitive