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/martmists Jan 17 '16 edited Jan 17 '16
while rs.getInput("right") do
  turtle.dig()
end

(Fixed it :D)

0

u/AAQsR Jan 17 '16

That makes the turtle dig an infinite amount of times. I want it to run only when there is a redstone signal on the right.

2

u/martmists Jan 17 '16 edited Jan 17 '16

If rs.getAnalogInput("right") returns true when the signal is on and false when the signal is off this program works. I've never used the rs api :/

EDIT:

Use

rs.getInput("right") --returns true/false

Instead of

rs.getAnalogInput("right") --returns signal strength