Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
darthhose

Transfer programs between computers

Question

Hi.

I' m trying to write a controll program for stargates from gregs sgcraft.
I made one with all known adresses and a need to send this program to all Computers i use (dont want to update every computer manual if i add a new adress)

Is it possible to send hole programs?
Or can i use an hdd with multiple Computers (and if thats possible, how could i access that hdd)

 

I made a program out of search results from google, many (MANY) lua wikis and a youtube tutorial. am i on the right way or is it just stupid?

shell = require("shell")
file = require("filesystem")
term = require("term")

local dir = shell.getWorkingDirectory()
local args, options = shell.parse(...)

-- this part reads the lines of a file and saves it in a table

if #args >= 1 then
 doc = dir .. args[1]
 print(doc)
 reader = io.open(doc, 'r')
 if reader ~= nil then
  z = 1
  x = {}
  for line in reader:lines() do
   x[z] = line
   z = z + 1
  end
  reader:close()
 end
end

-- this part takes the table and puts the stings back into a file

y = io.open(dir .. args[2], "w")
if y ~= nil then
 for i in pairs(x) do
  y:write(x[i], "\n")
 end
 y:close()
 print("done")
else print("error")
end 

right now it just takes the lines from one program to another on the same computer. i will use a modem to send it to another.

or is there another way to do this?

Thanks

Edited by darthhose
Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.