How can I use computer to control other computer at the same time? #1898
-
How can I use computer to control other computer at the same time? I try to use rednet but it can only send message but cna't send command . If you can give a detailed solution or code, that's even better. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You need a program on the receiver side, and make the program execute the command you have sent. An easy example will be: while true do
local _, command = rednet.receive()
local parsedCommand, err = load(command)
if parsedCommand then
local result = {parsedCommand()}
-- and send back the result if you want
end
end The controller just send or broadcast Lua commands. Note: In actual use, you may want define protocol, and add encrypt & signature to keep your computer in secure |
Beta Was this translation helpful? Give feedback.
You need a program on the receiver side, and make the program execute the command you have sent.
An easy example will be:
The controller just send or broadcast Lua commands.
If you want execute shell command, just use
shell.run
instead ofload
Note: In actual use, you may want define protocol, and add encrypt & signature to keep your computer in secure