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

If Statement Issues

Started by Rectorian, 12 October 2016 - 01:47 AM
Rectorian #1
Posted 12 October 2016 - 03:47 AM
So, I've been working on my own little basic mining program for mining a long tube for a viaduct, and i've been having a problem, here is a rough copy of my program.

local n = 2000
local i = 10
local x = 0
while n>0 do
if i=10 then
x = x+16
while x>0 do
turtle.select(x)
turtle.refuel()
x = x-1
end
else
i = i+1
end
turtle.dig()
turtle.forward()
end

My problem is that whenever I try to run the program it says that it expects a then on line five. If you look at line 5, there is a then. If anyone has any help or information, that would be awesome. Thanks!
Lyqyd #2
Posted 12 October 2016 - 04:20 AM
You're using an assignment operator (=) where you should be using a comparison operator (==).