Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- delete {topPLN::*}
- wait 2 ticks
- set {topPLN} to the database "mysql://145.239.133.205:3306/hypersi_strona?user=mateulusz&password=PQ76MAPSWN&useSSL=false"
- refreshTopPLN()
- every 30 minutes:
- refreshTopPLN()
- function refreshTopPLN():
- set {_t} to "%now%"
- set {_o} to last 7 characters of {_t}
- replace all "%{_o}%" with "" in {_t}
- replace all " " with "" in {_t}
- set {_m} to first 2 characters of {_t}
- replace all "/" with "" in {_m}
- set {_y} to last 2 characters of {_t}
- set {_date} to "%%%{_m}%-20%{_y}%%%"
- 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::*}
- wait 0.5 second
- loop 5 times:
- if {_output::nick::%loop-number%} is not set:
- set {topPLN::top::%loop-number%} to "&e##%loop-number% &bBrak &7(0 zl)"
- else:
- set {topPLN::top::%loop-number%} to "&e##%loop-number% &b%{_output::nick::%loop-number%}% &7(%{_output::SUM(kwota)::%loop-number%}% zl)"
- execute console command "hd setline toppln 1 &c&lTOP PLN"
- execute console command "hd setline toppln 2 &f(Biezacy miesiac)"
- loop 5 times:
- execute console command "hd setline toppln %loop-number+2% %{topPLN::top::%loop-number%}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement