Welcome to my rednet program. If you are bad with rednet in the lua interpreter, than you can use my program via shell.run("")
This is explained further in this topic.
This automatically turns on your rednet and sends it to your specified computer. If you dont got an ID, then it will broadcast!
Here is the code for it:
local tArgs = {...}
for k, v in pairs(rs.getSides()) do
rednet.open(v)
end
local id = tonumber(tArgs[#tArgs])
tArgs[#tArgs] = nil
local msg = table.concat(tArgs," ")
if tArgs[1] == nil then
print("Usage:\nRednet <message> <optional: id>")
elseif id ~= nil then
rednet.send(id, msg)
print("Sent '"..msg.."' to computer: "..id)
elseif id == nil then
tArgs[#tArgs] = nil
rednet.broadcast(msg)
print("Broadcasted: '"..msg.."'")
tArgs[#tArgs] = nil
end
or
pastebin get kk8aezHG program
"Program" can be changed into anything
Type in your computer: program <message> <optional ID>
If you want this to use in your lua interpreter, use:
shell.run("program <message> <optional ID>")
It's that easy! :D/>
Enjoy
(Please leave me feedback)
Changelog:
Spoiler
- Changed topic name etc.- Changed opening modems