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

REQUEST: A turtle script that removes water, lava, and oil from tunnels

Started by ShoeLace1291, 19 July 2018 - 11:07 PM
ShoeLace1291 #1
Posted 20 July 2018 - 01:07 AM
A while back on my old server I had a script for my turtle that filled in empty space around a tunnel so that no liquid could enter. I never saved the script to my PC and now that turtlescripts.com is no longer up I can't find the old script. I would greatly appreciate it if someone could make a script that does this for me, or if they can find one that already exists, post a link. Thanks!
Lyqyd #2
Posted 20 July 2018 - 02:19 AM
Moved to General.

That's not really what we do in Ask a Pro.
Lupus590 #3
Posted 20 July 2018 - 09:07 AM
you could try modifying the built in tunnel program
campicus #4
Posted 09 October 2018 - 02:32 PM
It's messy and it's slow, but it does what you want. I only made this for myself so, it only works for 3 high and 1 wide tunnels
https://pastebin.com/zdXcJqqU

Spoiler

local slot = 1
local length = 1

function instructions()
  term.clear()
  term.setCursorPos(1,1)
  print("Place turtle on the middle of the tunnel to be lava proofed. Tunnel should be 3 high, 1 wide and any length \(as long as there is an end.\)")
  io.read()
end

function checkInventory()
  repeat
	turtle.select(slot)
	if turtle.getItemCount() < 1 then
	  slot = slot + 1
	  if slot > 16 then
		slot = 1
	  end
	end
  until turtle.getItemCount() > 0
end

instructions()
checkInventory()
turtle.up()
while turtle.forward() do
  checkInventory()
  turtle.placeUp()
  turtle.turnLeft()
  checkInventory()
  turtle.place()
  turtle.turnRight()
  turtle.turnRight()
  checkInventory()
  turtle.place()
  turtle.turnLeft()
  length = length + 1
end
turtle.down()
for x = 1,(length-1) do
  turtle.turnLeft()
  checkInventory()
  turtle.place()
  turtle.turnRight()
  turtle.turnRight()
  checkInventory()
  turtle.place()
  turtle.turnLeft()
  turtle.back()
end
turtle.down()
for x = 1,length do
  checkInventory()
  turtle.placeDown()
  turtle.turnLeft()
  checkInventory()
  turtle.place()
  turtle.turnRight()
  turtle.turnRight()
  checkInventory()
  turtle.place()
  turtle.turnLeft()
  turtle.forward()
end
for x = 1,length do
  turtle.back()
end
Edited on 10 October 2018 - 11:32 PM