SHARE
TWEET

SimSoft Yellow - Random Background Program

Simlor_GER Jun 17th, 2017 (edited) 221 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Program by Simlor (http://www.computercraft.info/forums2/index.php?/user/55655-simlor/)
  2.  
  3. function Download(CodePB, Pfad)
  4.    
  5.     local datei = http.get("http://pastebin.com/raw/"..CodePB)
  6.     datei = datei.readAll()
  7.    
  8.     local file = fs.open(Pfad, "w")
  9.     file.write(datei)
  10.     file.close()
  11.    
  12. end
  13.  
  14. --Random Background
  15.  
  16. BC(128)
  17. Clear()
  18.  
  19. TC(SystemColor)
  20.  
  21. CP(1,1)
  22. print("Random Background Program!")
  23.  
  24. TC(1)
  25.  
  26. CP(1,3)
  27. print("Generate a number...")
  28.  
  29. sleep(1)
  30.  
  31. Download("JTBbFypQ", "BacklisteTEMP")
  32.  
  33. file = fs.open("BacklisteTEMP","r")
  34. local fileData = {}
  35. local line = file.readLine()
  36. repeat
  37. table.insert(fileData,line)
  38. line = file.readLine()
  39. until line == nil
  40. file.close()
  41.  
  42. MAXC = fileData[1]
  43.  
  44. MAXC = (MAXC+0)
  45.  
  46. number = math.random(3,MAXC)
  47.  
  48. CP(1,4)
  49. print("You got the number... "..(number-2).."!")
  50.  
  51. CP(1,5)
  52. print("Downloading Background...")
  53.  
  54. fs.delete("SimSoft/Data/Background")
  55.  
  56. Download((fileData[number]),"SimSoft/Data/Background")
  57.  
  58. TC(SystemColor)
  59. CP(1,7)
  60. print("Here is your 'new' background!")
  61.  
  62. sleep(2)
  63.  
  64. --end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top