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

redstone.getInput(help)

Started by GareBear, 07 January 2014 - 06:36 AM
GareBear #1
Posted 07 January 2014 - 07:36 AM
I'm getting the error message

dig:34: Expected string


function graveldetect()
if turtle.forward() == false then
  repeat
   turtle.dig()
  until turtle.forward() == true
else
  turtle.dig
end
turtle.forward()
turtle.digUp()
turtle.digDown()
end
function dump()
x = 1
repeat
  turtle.select(x)
  turtle.dropDown()
  x = x + 1
until x == 17
redstone.setOutput(bottom, true)
end
function dig()
y = 0
while y < 100 do
  graveldetect()
  y = y + 1
end
turtle.turnLeft()
turtle.turnLeft()
repeat
  graveldetect()
until redstone.getInput(bottom) == true
dump()
end
dig()

He runs fine right up until this bit.


repeat
graveldetect()
until redstone.getInput(bottom) == true

I'm not really sure exactly how I messed up the redstone.getInput() thing. I also tried redstone.getInput(bottom, true) == true but that just returned the same error.
Lyqyd #2
Posted 07 January 2014 - 10:44 AM
The argument needs to be a string.


until rs.getInput("bottom")

Since that function only returns true or false, you don't need to compare the result to true.