Advertisement
Guest User

Untitled

a guest
May 7th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. on load:
  2. delete {topPLN::*}
  3. wait 2 ticks
  4. set {topPLN} to the database "mysql://145.239.133.205:3306/hypersi_strona?user=mateulusz&password=PQ76MAPSWN&useSSL=false"
  5. refreshTopPLN()
  6.  
  7. every 30 minutes:
  8. refreshTopPLN()
  9.  
  10.  
  11. function refreshTopPLN():
  12. set {_t} to "%now%"
  13. set {_o} to last 7 characters of {_t}
  14. replace all "%{_o}%" with "" in {_t}
  15. replace all " " with "" in {_t}
  16.  
  17. set {_m} to first 2 characters of {_t}
  18. replace all "/" with "" in {_m}
  19.  
  20. set {_y} to last 2 characters of {_t}
  21.  
  22.  
  23. set {_date} to "%%%{_m}%-20%{_y}%%%"
  24.  
  25. execute "SELECT nick, SUM(kwota) FROM logi WHERE data LIKE %{_date}% GROUP BY nick ORDER BY SUM(kwota) DESC LIMIT 5" in {topPLN} and store the result in {_output::*}
  26. wait 0.5 second
  27. loop 5 times:
  28. if {_output::nick::%loop-number%} is not set:
  29. set {topPLN::top::%loop-number%} to "&e##%loop-number% &bBrak &7(0 zl)"
  30. else:
  31. set {topPLN::top::%loop-number%} to "&e##%loop-number% &b%{_output::nick::%loop-number%}% &7(%{_output::SUM(kwota)::%loop-number%}% zl)"
  32.  
  33. execute console command "hd setline toppln 1 &c&lTOP PLN"
  34. execute console command "hd setline toppln 2 &f(Biezacy miesiac)"
  35. loop 5 times:
  36. execute console command "hd setline toppln %loop-number+2% %{topPLN::top::%loop-number%}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement