basic scripts for executing remote scripts in computercraft
This commit is contained in:
parent
def73419fc
commit
4d7132d681
3 changed files with 11 additions and 1 deletions
6
download.lua
Normal file
6
download.lua
Normal file
|
@ -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
Normal file
5
execute.lua
Normal file
|
@ -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 +0,0 @@
|
||||||
print("Hello world!")
|
|
Reference in a new issue