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

Wireless Strip-Mining Turtle

Started by Robbo5899, 21 March 2013 - 10:56 AM
Robbo5899 #1
Posted 21 March 2013 - 11:56 AM
Title : Wireless Strip-Mining Turtle

I am looking for an advanced coder to be able to help me create a program that allows me to have numerous Wireless Mining Turtles controlled (told to mine) from one computer in a central location.

I would like to have it so that I can place my mining turtles in their position to mine and then tell them from a computer placed close by to the strip mine to go. I would also like to be able to have a monitor placed next tot the computer and have it tell me whether the turtle is In-Progress(mining) or finnished.

I have a simple script that makes the turtle mine 2x1 for a user definable distance that places torches every 10 blocks, I would like to be able to keep this feature if possible.

Thank you and I hope you can help,
PixelToast #2
Posted 22 March 2013 - 03:17 AM
i could help with the networking code
Robbo5899 #3
Posted 22 March 2013 - 07:02 AM
i could help with the networking code
That would be great!

Here is My current code:
--[[fuel must be placed in slot 15,
torches must be placed in slot 16.]]

-- Create the function for refueling
function checkFuel()
  if turtle.getFuelLevel() <= 10 then
    turtle.select(15)
    turtle.refuel(1)
    turtle.select(1)
  end --if
end --checkFuel()

-- Create the turnAround function
function turnAround()
  turtle.turnRight()
  turtle.turnRight()
end --turnAround()

-- Digs the tunnel for the given length
function tunnel(givenLength)
  local distance = 0
  for index = 1,givenLength do
    turtle.dig()
    if turtle.forward() then
	  distance = distance + 1
    end --if
    turtle.digUp()
    turtle.select(1)
    turtle.placeDown()

-- Places a torch every 10 blocks
    if distance == 10 then
	  turtle.select(16)
	  print("Placing torch...")
	  turnAround()
	  turtle.place()
	  turnAround()
	  distance = 0
	  checkFuel()
    end --if
  end --for
   end --tunnel()

-- Main script
print("Input tunnel length:")
local length = read()
print("starting excavation...")
checkFuel()
tunnel(length)
print("The tunnel has been excavated!")

I Just have to type [Program Name] and it prompts me to input the Distance I would like it to mine.

As i said before I want to be able to Tell it to come on from a close by Computer.
Could you tell me what i need to add to/change in my code top get this to work and also what code will i need on the computer.

Thanks
Robbo5899

PS i know the ID's of the Computers and Turtles