Browse Source

basic scripts for executing remote scripts in computercraft

master
Joshua Moerman 12 years ago
parent
commit
4d7132d681
  1. 6
      download.lua
  2. 5
      execute.lua
  3. 1
      hello_world.lua

6
download.lua

@ -0,0 +1,6 @@
local tArgs = { ... }
local url = "http://example.net/computercraft/"
local x = http.get(url..tArgs[1]).readAll()
hFile = io.open(tArgs[2], "w")
hFile:write(x)
hFile:close()

5
execute.lua

@ -0,0 +1,5 @@
local tArgs = { ... }
local url = "http://example.net/computercraft/"
local x = http.get(url..tArgs[1]).readAll()
f = loadstring(x)
f(unpack(tArgs, 2))

1
hello_world.lua

@ -1 +0,0 @@
print("Hello world!")