r/ComputerCraft • • Jan 17 '16

Error message help.

When I run the following code in a turtle, I get an error message. Please help, I am new to computercraft and lua.

while rs.getAnalogInput("right") true
    do turtle.dig()
1 Upvotes

6 comments sorted by

View all comments

3

u/eniallator Jan 17 '16

if you want the turtle to infinitely run but only do the dig function when its getting a redstone signal then use this code:

while true do
  if redstone.getInput("right") then
    turtle.dig()
  end
end

1

u/AAQsR Jan 18 '16

Thank you!