Watchful11

Untitled

May 20th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. --name cleanstart
  2. --version 1.0
  3.  
  4. args = { ... }
  5.  
  6. if args[1] ~= "false" then
  7. fs.delete("watch")
  8. end
  9.  
  10. function downloadFile(name)
  11. site = http.get("https://dl.dropbox.com/u/27836116/lua/"..name)
  12. if site == nil then
  13. print("File not found at address: "..address)
  14. return false
  15. else
  16. content = site.readAll()
  17. end
  18. fs.makeDir("watch")
  19. file = fs.open("watch/"..name,"w")
  20. file.write(content)
  21. file.close()
  22. return true
  23. end
  24.  
  25. os.setComputerLabel("watchturtle"..os.getComputerID())
  26.  
  27. if (not downloadFile("watchapi")) or (not downloadFile("internetapi")) or (not downloadFile("variablesapi")) then
  28. do return end
  29. end
  30.  
  31. os.loadAPI("watch/watchapi")
  32.  
  33. watchapi.loadModuleVariables()
  34.  
  35. watchapi.addAPItolist("watchapi")
  36. watchapi.addAPItolist("internetapi")
  37. watchapi.addAPItolist("variablesapi")
  38. watchapi.addAPItolist("movementapi")
  39. watchapi.addAPItolist("queueapi")
  40. watchapi.addAPItolist("persistantapi")
  41. watchapi.updateAndLoad()
  42.  
  43. watchapi.addProgramtolist("watch/gow")
  44. watchapi.addProgramtolist("watch/pos")
  45. watchapi.addProgramtolist("watch/watchscript")
  46. watchapi.addProgramtolist("cleanstart")
  47. watchapi.addProgramtolist("treefarm")
  48. watchapi.updatePrograms()
  49.  
  50. if (args[2] ~= nil) and (args[3] ~= nil) and (args[4] ~= nil) and (args[5] ~= nil) then --rework
  51. watchapi.setpos(args[2],args[3],args[4],args[5])
  52. end
Advertisement
Add Comment
Please, Sign In to add comment