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

Getting "error ":1: "do" expected", even though "do" already exists

Started by Conlan99, 05 April 2013 - 11:56 AM
Conlan99 #1
Posted 05 April 2013 - 01:56 PM
So I was making a program to control my redpower2 tunnel bore (I'm using computercraft computers), and when I run this program, I get the error, "error [something here] :1: "do" expected". I already have a "do" on line 1 though, so I'm not sure what to do…
Essentially what this program is supposed to do is, whenever it receives a redstone signal from the front, it starts the frame motors with redstone signals.

while redstone.getInput("front") = true do
  redstone.setOutput("back", true)
  sleep(0.4)
  redstone.setOutput("back", false)
  sleep(1.44)
  redstone.setOutput("left", true)
  redstone.setOutput("right", true)
  sleep(1.44)
  redstone.setOutput("left", false)
  redstone.setOutput("right", false)
end
Telokis #2
Posted 05 April 2013 - 01:59 PM
To check if a variable is equal to something else, you have to put "==" instead of "=".
Engineer #3
Posted 05 April 2013 - 02:00 PM
To compare you must put == instead of =
Edit: ninja'd
Conlan99 #4
Posted 05 April 2013 - 02:53 PM
To check if a variable is equal to something else, you have to put "==" instead of "=".
Thank you!