Jump to content




RedSend


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

#1 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 16 August 2012 - 09:21 PM

This is a basic program I made for sending quick msgs via rednet.
Feel free to use this and since it is just a few lines you can just write it on all computers you need it on.
Here is the code:
local rSide = "back" --Side of the modem
local pName = "redsend" --The name of the program
local tArgs = { ... }
local i = tonumber(tArgs[1])
local m = tostring(tArgs[2])
if #tArgs < 2 then
  print("Correct Usage: ", pName, " id msg")
  print("Or Correct Usage: ", pName, "broadcast msg")
  return
end
if tArgs[1] == "broadcast" then
  rednet.open(rSide)
  rednet.broadcast(m)
  rednet.close(rSide)
  print("The message has been broadcasted ")
else
  rednet.open(rSide)
  rednet.send(i, m)
  rednet.close(rSide)
  print("Message has been sent to: ", i)
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users