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

Lua Problem :(

Started by qsysmine, 11 February 2014 - 10:45 PM
qsysmine #1
Posted 11 February 2014 - 11:45 PM
I am creating a rednet client with a loop to check if you're supposed to receive the message.

while true do
  id,message = rednet.recieve()
  local splitMessage = splitter.split(message, ";..;")
  local broadcastOS = splitMessage[1]
  broadcastType = splitMessage[2]
  broadcastRecipient = splitMessage[3]
  broadcastContent = splitMessage[4]
  if tonumber(broadcastRecipient) != os.getComputerID() then
	break
  end
end
When I tested the code in computercraft I got this error:

bios:399: [string "networkClient"]:27: 'then' expected
Line 27 is the if statement. Someone please help me find the error in my if statement.
Lyqyd #2
Posted 12 February 2014 - 12:02 AM
Please post the whole code you're working with next time you ask a question.

Lua uses ~= for inequality comparison.