Jump to content




Lua Problem :(


  • You cannot reply to this topic
1 reply to this topic

#1 qsysmine

  • Members
  • 5 posts

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.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users