Advertisement
hevohevo

ComputerCraft Tutorial: auto_download0_2

May 31st, 2014
1,660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- ############################
  2. -- Auto Download program
  3. -- http://hevohevo.hatenablog.com/
  4. -- version 0.2
  5.  
  6. -- Config
  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.   os.loadAPI(name)
  22. end
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement