Jump to content




How Can I Preserve A Variable Across Rednet?


  • You cannot reply to this topic
3 replies to this topic

#1 JohnOptegrove

  • New Members
  • 1 posts

Posted 05 November 2013 - 08:24 PM

I'm trying to set up a stargate control system using Rednet and two computers. My idea is to store the address for the stargate to dial in the variable "address", then send the contents of "address" over Rednet to the other terminal which would then wrap the stargate as a peripheral and dial it.

Is this possible and if so how would I go about doing it?

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 November 2013 - 10:51 AM

Split into new topic.

Yep, just send the variable contents and receive it on the other side.

#3 Bomb Bloke

    Hobbyist Coder

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

Posted 06 November 2013 - 04:22 PM

In particular, you'll be making use of either the modem or Rednet APIs.

What gets sent is the contents of your variable, which you dump into a new variable at the other end. If you wish to send a table (instead of a single value), you'll want to make use of textutils.serialize().

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 November 2013 - 08:49 PM

Tables can be sent across without the need for serialization and deserialization in more recent versions.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users