Advertisement
hevohevo

ComputerCraft Tutorial: auto_download0_1

May 31st, 2014
1,618
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. -- ############################
  2. -- Auto Download program
  3. -- http://hevohevo.hatenablog.com/
  4.  
  5. -- config
  6. API_NAME = "test_api"
  7. PASTEBIN_CODE = "TeWK9FBw"
  8.  
  9. -- function
  10. function installAPI(name,code)
  11.   if fs.exists(name) then
  12.     print("API_FILE exists.")
  13.   else
  14.     print("API_FILE doesn't exist.")
  15.     shell.run("pastebin","get",code,name)
  16.   end
  17.   os.loadAPI(name)
  18. end
  19.  
  20. -- main
  21. installAPI(API_NAME, PASTEBIN_CODE)
  22. test_api.testPrint()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement