SHOW:
|
|
- or go back to the newest paste.
| 1 | -- ############################ | |
| 2 | -- Auto Download program | |
| 3 | -- http://hevohevo.hatenablog.com/ | |
| 4 | -- version 0.2 | |
| 5 | - | -- config |
| 5 | + | |
| 6 | - | API_NAME = "test_api" |
| 6 | + | -- Config |
| 7 | - | PASTEBIN_CODE = "TeWK9FBw" |
| 7 | + | -- api_name="pastebin code" |
| 8 | API_INFO = {
| |
| 9 | test_api="TeWK9FBw", | |
| 10 | test_api2="NCYAEPRA" | |
| 11 | } | |
| 12 | ||
| 13 | -- function | |
| 14 | function installAPI(name,code) | |
| 15 | if fs.exists(name) then | |
| 16 | print("API_FILE exists.")
| |
| 17 | else | |
| 18 | print("API_FILE doesn't exist.")
| |
| 19 | shell.run("pastebin","get",code,name)
| |
| 20 | end | |
| 21 | - | installAPI(API_NAME, PASTEBIN_CODE) |
| 21 | + | |
| 22 | - | test_api.testPrint() |
| 22 | + | |
| 23 | ||
| 24 | -- main | |
| 25 | for k,v in pairs(API_INFO) do | |
| 26 | installAPI(k, v) | |
| 27 | end | |
| 28 | ||
| 29 | test_api.testPrint() | |
| 30 | test_api2.testPrint() |