Jump to content




[Lua] Rednet message == ?


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

#1 SNWLeader

  • Members
  • 71 posts
  • LocationTampa Bay, Florida

Posted 03 February 2013 - 09:37 AM

I am trying in hopes of making a creditcard system in my singleplayer so that I may transfer it over to a server when I get the chance.

I am trying to get the part about getting the rednet messages to trigger a action.

I wanted to know how to check if the rednet message is equal to a command and will preform a certain action.

What would I do for that?



Also I wanted to know when to detect, since my credit system will work by saving files for each user and encrypting them by multiplaying the balance by itself to encrypt it, how would I have it to detect when the user file is not existing to perform an action.

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 03 February 2013 - 09:47 AM

sID, msg = rednet.receive()

if msg == "Reboot" then
    os.reboot()
elseif msg == "Derp" then
    print("I derped!")
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users