Compare commits
2 commits
8e18e26e47
...
59c9c151ce
Author | SHA1 | Date | |
---|---|---|---|
59c9c151ce | |||
1d33c2fcc0 |
2 changed files with 36 additions and 1 deletions
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
|
@ -1,3 +1,7 @@
|
||||||
{
|
{
|
||||||
"deno.enable": true
|
"deno.enable": true,
|
||||||
|
"Lua.diagnostics.globals": [
|
||||||
|
"fs",
|
||||||
|
"http"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
31
cc-tweaked/scripts/autorun.lua
Normal file
31
cc-tweaked/scripts/autorun.lua
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
os.run = os.run
|
||||||
|
os.sleep = os.sleep
|
||||||
|
|
||||||
|
function table.slice(tbl, first, last)
|
||||||
|
local result = {}
|
||||||
|
for i = first or 1, last or #tbl do
|
||||||
|
result[#result + 1] = tbl[i]
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
local program = ...
|
||||||
|
local args = table.slice(arg, 1)
|
||||||
|
|
||||||
|
local function main()
|
||||||
|
if program == nil then
|
||||||
|
print("Usage: autorun <program> [...args]")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local i = 0
|
||||||
|
while true do
|
||||||
|
i = i + 1
|
||||||
|
os.run({}, "/update", program)
|
||||||
|
os.run({}, program, table.unpack(args))
|
||||||
|
print("autorun", i)
|
||||||
|
os.sleep(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue