Advertisement
guitarplayer616

WhatEveryTurtleNeedsBackup v1.1

Nov 24th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. local sArgs = ...
  2. left,right,up,down,front,back = nil,nil,nil,nil,nil,nil
  3. --sArgs 'forceUpdate'
  4.  
  5. if not fs.exists("helpful") then
  6.     fs.makeDir("helpful")
  7. end
  8.  
  9. function readTab(t)
  10.     for i,v in pairs(t) do
  11.         print(i,": ",v)
  12.     end
  13. end
  14.  
  15. sides = {'left','right','up','down','front','back'}
  16. for i,v in pairs(sides) do
  17.     if v then
  18.         loadstring( v.." = peripheral.wrap(\""..v.."\") " ) ()
  19.     end
  20. end
  21.  
  22. local programs = {
  23.     EventViewer = "K8rtdFgX",
  24.     AutoUpdate = "eyujLQr1",
  25.     PeripheralCheck = "x3AEjJtd",
  26.     uWords = "M4R2wazQ",
  27. }
  28.  
  29. local runOnStartup = {
  30.     uWords = "M4R2wazQ",
  31.  
  32. }
  33.  
  34. for i,v in pairs(programs) do
  35.     if not fs.exists(i) or sArgs == "forceUpdate" then
  36.         local tmp = fs.open("helpful/"..i,"w")
  37.         tmp.write( http.get("http://pastebin.com/raw/"..v).readAll() )
  38.         tmp.close()
  39.     end
  40. end
  41.  
  42. --uWords API
  43. if not draw or not readTab or sArgs == "forceUpdate" then
  44.     --[[for _,v in pairs(runOnStartup) do
  45.         loadstring(http.get("http://pastebin.com/raw/"..v).readAll())()
  46.     end]]--
  47.     for i in pairs(runOnStartup) do
  48.         shell.run("helpful/"..i)
  49.     end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement