Skip to content

How can I use computer to control other computer at the same time? #1898

Answered by zyxkad
HenryDu8133 asked this question in Q&A
Discussion options

You must be logged in to vote

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.
If you want execute shell command, just use shell.run instead of load

Note: In actual use, you may want define protocol, and add encrypt & signature to keep your computer in secure

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@HenryDu8133
Comment options

@HenryDu8133
Comment options

@zyxkad
Comment options

Answer selected by HenryDu8133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants