Advertisement
fishermedders

Fishub

Dec 20th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. --This program gets all of the files
  2. --from my github so that you are allowed
  3. --to download them in computercraft. Use if you like,
  4. --but give credit :)
  5. --Thanks, XMedders
  6. programs = http.get("https://raw.githubusercontent.com/fishermedders/cc/master/index").readAll()
  7. --print(programs)
  8. loadstring(programs)()
  9. --print(#list)
  10. while true do
  11. print("Programs: ")
  12. for i = 1,#list do
  13. print(i..". "..list[i][1].." v"..list[i][3].." by XMedders")
  14. end
  15. print("Usable Commands: dl <num> [name], see <num>")
  16. input = read()
  17. args = {}
  18. for a in input:gmatch("%S+") do table.insert(args,a) end
  19. if args[1] == "dl" then
  20. if args[2] ~= nil then
  21. cont = http.get(list[tonumber(args[2])][4]).readAll()
  22. if args[3] ~= nil then
  23. filename = args[3]
  24. else
  25. filename = list[tonumber(args[2])][2]
  26. end
  27. file = fs.open(filename,"w")
  28. file.write(cont)
  29. file.close()
  30. end
  31. elseif args[1] == "see" then
  32. if args[2] ~= nil then
  33. cont = http.get(list[tonumber(args[2])][4]).readAll()
  34. print(cont)
  35. end
  36. end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement