Jump to content




textutils.serialize() and unserialize


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

#1 Kenzo

  • Members
  • 18 posts

Posted 31 December 2014 - 06:29 AM

so im trying to send a couple of variables over rednet using textutils.serialize() and unserialize but its giving me an error every time it unserializes

"sender, message = rednet.receive()
mail = textutils.unserialize(message)

account = mail[1]
func = mail[2]
p1 = mail[3]
p2 = mail[4]
p3 = mail[5]"

any idea why?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 31 December 2014 - 06:43 AM

What's the sending code look like? What does the error look like?

If it's throwing an attempt to index nil, then that would imply that whatever message is being received isn't a valid serialised table. You could try printing "message" to ensure it's what you think it should be.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users