Guest User

startup

a guest
Sep 25th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. local mon = peripheral.wrap("right") -- S??lectionez le cot?? de votre ??cran :3
  2. term.redirect(mon)
  3. os.loadAPI("json")
  4. term.clear()
  5. term.setTextColor(colors.gray)
  6. print("ModFriends")
  7. term.setCursorPos(3,1)
  8. Incr = 0
  9. term.setBackgroundColor( colors.black )
  10.  
  11. while true do
  12.  
  13.   local contenu = http.get("http://theo33500.tech/toath/twitteroauth/test.php")
  14.   --Ici changer Bill par le pseudo a surveiller.
  15.   local data = contenu.readAll()
  16.  
  17.   decode = json.decode(data)
  18.   i = 10
  19.   ii = 0
  20.  
  21.     while ii <= 10 do
  22.       if decode.statuses[i] ~= null then
  23.          local text = decode.statuses[i].text
  24.          text = text:gsub("u00e9","e")
  25.          text = text:gsub("u00e0","a")
  26.          text = text:gsub("u00a0"," ")
  27.         local from = decode.statuses[i].user.name
  28.         local at = decode.statuses[i].user.screen_name
  29.         local long = string.len(from)
  30.         local I = 74 - long
  31.  
  32. --if from = ModFriends_
  33. --  color = colors.white
  34. --end
  35.                        
  36.       if Incr==0 then
  37.         color = colors.orange
  38.       elseif Incr == 1 then
  39.         color = colors.orange
  40.       elseif Incr == 2 then
  41.         color = colors.magenta
  42.       elseif Incr == 3 then
  43.         color = colors.yellow
  44.       elseif Incr == 4 then
  45.         color = colors.lime
  46.       elseif Incr == 5 then
  47.         color = colors.pink
  48.       elseif Incr == 6 then
  49.         color = colors.gray
  50.       elseif Incr == 7 then
  51.         color = colors.cyan
  52.       elseif Incr == 8 then
  53.         color = colors.purple
  54.       elseif Incr == 9 then
  55.         color = colors.blue
  56.       elseif Incr == 10 then
  57.         color  = colors.brown
  58.       elseif Incr == 11 then
  59.         color = colors.green
  60.       else
  61.         Incr = 0
  62.       end
  63.  
  64.     Incr = Incr + 1
  65. if at == "theo33500" then
  66.   color = colors.white
  67. end
  68. term.setTextColor(color)
  69.          print("----------------------------------------------------------------------------------")
  70.         print("\n "..text)
  71.         write("\n de : " ..from)
  72.         while I > 0 do
  73.             write("-")
  74.             I = I - 1
  75.         end
  76.         print("\n ")
  77.       end
  78.  
  79.     i = i - 1
  80.     ii = ii + 1
  81.     sleep(0.1)
  82.     end
  83.  
  84.     sleep(2)
  85. end
Advertisement
Add Comment
Please, Sign In to add comment