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

multiple conditions error(if a=true and b=true then)

Started by Escarchado, 19 October 2014 - 05:24 AM
Escarchado #1
Posted 19 October 2014 - 07:24 AM
My error is 299: '=' expected
299 is the elseif line

stepDir is for the option of a tunnel having steps up, or steps down.
stepSliceCount creates a step on every other advance.


function step()
  
	if stepDir == 1 and stepSliceCount == 2 then
  
		moveUp()
		stepSliceCount = 0
	  
	elseIf stepDir == 2 and stepSliceCount == 2 then
	  
		moveDown()
		stepSliceCount = 0
	  
	else
  
	end
end
Lyqyd #2
Posted 19 October 2014 - 07:29 AM
Lua is case-sensitive, so elseIf and elseif (the correct capitalization) are different things.
Escarchado #3
Posted 19 October 2014 - 07:39 AM
Thx, that did it! On to the next error. Lol.