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

Ladders Ladders Ladders in 1.4.5

Started by athelred, 27 October 2012 - 10:05 PM
athelred #1
Posted 28 October 2012 - 12:05 AM
I am having difficulty placing ladders. No matter what I do the ladder is placed onto the south wall. Is there any secret to using these, or this an issue?

Here is the code I happen to be using now. It has gone through several iterations. I have tried placing in front of the turtle and below the turtle. I have tried turning different directions. Neither had any effect.


function ForceMoveUp()
  local attempts = 0
  while (turtle.up() == false)
  do
	turtle.digUp()
	turtle.attackUp()
  
	attempts = attempts + 1
	if (attempts == 3)
	then
	  return false
	end
  end

  return true
end
function ForceMoveDown()
  local attempts = 0
  while (turtle.down() == false)
  do
	turtle.digDown()
	turtle.attackDown()
  
	attempts = attempts + 1
	if (attempts == 3)
	then
	  return false
	end
  end

  return true
end
function ForceMoveForward()
  local attempts = 0
  while (turtle.forward() == false)
  do
	turtle.dig()
	turtle.attack()
  
	attempts = attempts + 1
	if (attempts == 3)
	then
	  return false
	end
  end

  return true
end
function SelectFillMaterial()
  for i = 13, 16, 1
  do
	if turtle.getItemCount(i) ~= 0
	then
	  turtle.select(i)
	  return true
	end
  end
  return false
end
local disTraveled = 0
while (ForceMoveDown() == true)
do
  turtle.dig()
  disTraveled = disTraveled + 1
end
for i =1, disTraveled, 1
do
  turtle.forward()
  turtle.dig()
  SelectFillMaterial()
  turtle.place()
  turtle.back()
  turtle.select(1)
  turtle.place()
  turtle.up()
  SelectFillMaterial()
  turtle.placeDown()
end

It works as expected, except for the wall the ladders end up on.
ChunLing #2
Posted 28 October 2012 - 01:56 AM
Why does it matter?