Advertisement
krzys_h

Zegar a'la Wykluczony v1.01

Aug 22nd, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function piszCyfre(str, licz)
  2.  local o = 0
  3.  if licz == 0 then o = 119 end -- 1110111
  4.  if licz == 1 then o = 36 end -- 0100100
  5.  if licz == 2 then o = 93 end -- 1011101
  6.  if licz == 3 then o = 109 end -- 1101101
  7.  if licz == 4 then o = 46 end -- 0101110
  8.  if licz == 5 then o = 107 end -- 1101011
  9.  if licz == 6 then o = 123 end -- 1111011
  10.  if licz == 7 then o = 37 end -- 0100101
  11.  if licz == 8 then o = 127 end -- 1111111
  12.  if licz == 9 then o = 111 end -- 1101111
  13.  rs.setBundledOutput(str, o)
  14. end
  15.  
  16. local function piszLiczbe(liczba)
  17.  local cyfra1 = (liczba-(liczba%10))/10 --liczba/10 zaokraglone w dol
  18.  local cyfra2 = liczba%10
  19.  piszCyfre("left", cyfra1)
  20.  piszCyfre("right", cyfra2)
  21. end
  22.  
  23.  
  24. while true do
  25.  while not rs.testBundledInput("front", colors.white) do
  26.   rs.setBundledOutput("left", colors.lightBlue)
  27.   rs.setBundledOutput("right", colors.lightBlue)
  28.   sleep(0.5)
  29.   rs.setBundledOutput("left", 0)
  30.   rs.setBundledOutput("right", 0)
  31.   sleep(0.5)
  32.  end
  33.  rs.setBundledOutput("left", 0)
  34.  rs.setBundledOutput("right", 0)
  35.  rs.setBundledOutput("front", colors.magenta)
  36.  local czas = 35
  37.  local sek = 60
  38.  while czas > 1 do
  39.   piszLiczbe(czas)
  40.   rs.setBundledOutput("front", colors.combine(colors.magenta, colors.orange))
  41.   sleep(0.1)
  42.   rs.setBundledOutput("front", colors.magenta)
  43.   sleep(59.9)
  44.   czas = czas - 1
  45.  end
  46.  rs.setBundledOutput("front", colors.combine(colors.magenta, colors.orange))
  47.  sleep(0.1)
  48.  rs.setBundledOutput("front", colors.magenta)
  49.  while sek > 0 do
  50.   piszLiczbe(sek)
  51.   rs.setBundledOutput("front", 0)
  52.   sleep(0.5)
  53.   rs.setBundledOutput("front", colors.magenta)
  54.   sleep(0.5)
  55.   sek = sek - 1
  56.  end
  57.  rs.setBundledOutput("front", 0)
  58.  rs.setBundledOutput("left", 0)
  59.  rs.setBundledOutput("right", 0)
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement