Advertisement
BlueMond

MPserver

Aug 6th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. local version = 1.3
  2. local filename = "startup"
  3. local paste = "AVHacqLa"
  4.  
  5. local function update()
  6.     local url = "http://pastebin.com/raw.php?i="..paste
  7.     local temp = http.get(url)
  8.     local ver = temp.readLine()
  9.     if tonumber(string.sub(ver, 17)) ~= version then
  10.         fs.delete(filename)
  11.         shell.run("pastebin get "..paste.." "..filename)
  12.         shell.run(filename)
  13.         return true
  14.     end
  15.     return false
  16. end
  17.  
  18. local test = update()
  19. if test == true then
  20.     error()
  21. end
  22.  
  23. rednet.open("front")
  24. local discs = {}
  25. discs.blocks = "bottom"
  26. discs.far = "left"
  27. discs.mall = "top"
  28. discs.strad = "right"
  29. discs.wait = "back"
  30. --{"blocks" = "bottom", "far" = "left", "mall" = "top", "strad" = "right", "wait" = "back"}
  31.  
  32. shell.run("clear")
  33. print("~Running Music Player Server~")
  34. print("Version: "..version)
  35. while true do
  36.     id,msg = rednet.receive()
  37.     if id == 3 then
  38.         if msg == "stop" then
  39.             disk.stopAudio()
  40.         else
  41.             disk.playAudio(discs[msg])
  42.         end
  43.     end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement