Posted 16 August 2012 - 10: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:
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