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

How to automate quarry/tesseract/chest placing?

Started by koeer11, 27 September 2013 - 02:25 AM
koeer11 #1
Posted 27 September 2013 - 04:25 AM
So, my question is, would it be possible with turtles to automatically place a quarry, an energy tesseract and an ender chest each 62 blocks from the other, go another 62 blocks and place the same 3 in the same formation?
Lyqyd #2
Posted 27 September 2013 - 08:59 PM
Split into new topic.
UltraNoobian #3
Posted 27 September 2013 - 09:08 PM
Is it possible? Yes.

You could do that but without a chunkloader anything past the border would simply stop including the turtle.

EDIT: How? I am still eating breakfast and unable to code atm.
BigTwisty #4
Posted 28 September 2013 - 02:19 AM
The other problem you'll find is that tesseracts don't keep their settings like redstone cells do when you wrench them. The turtle can place them, but they won't actually do anything until you come by and set their frequencies.
Engineer #5
Posted 28 September 2013 - 05:18 AM
This is a coding solution, not a loaded chunk solution.

while true do -- infinite loop
  for i = 1, 62 do
    turtle.forward() -- move 62 times
  end
  -- code for placing here
end

This is a very bad solution, as you need to check if there is fuel to move, etc.
Lyqyd #6
Posted 28 September 2013 - 04:13 PM
The other problem you'll find is that tesseracts don't keep their settings like redstone cells do when you wrench them. The turtle can place them, but they won't actually do anything until you come by and set their frequencies.

You can use either a shiny dust or a shiny ingot on them to cause them to retain their settings when broken. This may only work when they're broken with the crescent hammer. TE adds an "engineering turtle" or similar that has a crescent hammer tool attached. Obviously, craft a turtle and a crescent hammer to get one.
BigTwisty #7
Posted 28 September 2013 - 05:46 PM
The other problem you'll find is that tesseracts don't keep their settings like redstone cells do when you wrench them. The turtle can place them, but they won't actually do anything until you come by and set their frequencies.

You can use either a shiny dust or a shiny ingot on them to cause them to retain their settings when broken. This may only work when they're broken with the crescent hammer. TE adds an "engineering turtle" or similar that has a crescent hammer tool attached. Obviously, craft a turtle and a crescent hammer to get one.

That is awesome! Never knew that. Thanks!
Lyqyd #8
Posted 28 September 2013 - 09:03 PM
Also, I didn't clarify very well; I said above you can use either a dust or an ingot. In fact, you can only use one or the other. I can't remember whether it is the dust or the ingot.
plazter #9
Posted 29 September 2013 - 03:57 PM
Its dust:)

EDIT1:
I saw this post yesterday, and now i've made a program to do it :)/>
Have a look at it and get some inspiration! :)/>
link: http://pastebin.com/Sb8VwgwU

Heres the code if you just want a look :)/>

Spoiler

local quarry = 13
local tesseract = 16
local landmark = 15
local chest = 14
local args = {...}
local length = 10

function checkFuel()
term.clear()
term.setCursorPos(1,1)
  print("Checking if i have enough fuel..")

  sleep(2)

if turtle.getFuelLevel() >= 500 then
  print("Im fine on fuel thanks.. press enter to continue.")
	while true do
	local event, key = os.pullEvent("key")
	 if key == keys.enter then
	  return
	 end
	end
   end
end

function lenght()
term.clear()
term.setCursorPos(1,1)
  print("How big do you want the quarry?")
  input = read()

if input then
length = input
   elseif input == nil then
print("Error..")
   end

  print("You have said that you want the quarry to be: ".. tostring(length))
   print("Are you sure?")
	print("Press Y/N")

  while true do
   local event, key = os.pullEvent("key")
	if key == keys.y then
	 print("I'm gonna go a head and build you quarry!")
	sleep(2)
	Quarry()
	end
	if key == keys.n then
	 print("You pressed N, breaking the program..")
	break
	end
  end
end

   function Quarry()
-- [ Landmarks ] --	
   for i = 1,length do
	 turtle.forward()
	end

	turtle.select(landmark)
	turtle.place()

	for o = 1, length -1  do
	 turtle.back()
	end

  turtle.turnRight()

  for p = 1,length do
   turtle.forward()
   end

   turtle.place()

  for a = 1, length do
   turtle.back()
  end

  turtle.turnLeft()
  turtle.back()
  turtle.place()
  turtle.attack()
-- [ Landmarks end] --
  turtle.back()
  turtle.select(quarry)
  turtle.place()
  turtle.up()
  turtle.select(chest)
  turtle.place()
  turtle.back()
  turtle.down()
  turtle.select(tesseract)
  turtle.place()
  print("Done.")

  end
		 function itemsSlot()
		  term.clear()
term.setCursorPos(1,1)
print("Place following items in slot:")
print("Quarry: 13")
print("Chest: 14")
print("Landmarks: 15")
print("Tesseract: 16")
sleep(5)
end
-- [Main program] --	  
itemsSlot()
checkFuel()
lenght()