Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.56 KB | None | 0 0
  1. proc dupe:mtop {nick uhost handle chan arg} {
  2.     global db_handle mysql_ chan_ bopen bclose bdiv
  3.  
  4.     set days [expr 31 - [strftime %e]]
  5.     set days2go [expr {$days==1?"1 day":"$days days"}]
  6.     set quota_(amount) "20"
  7.     set place 0
  8.     set refine ""
  9.     if {[llength $arg] >= 1} { set refine "WHERE `crew`.`user` = '[mysqlescape [string trim [lindex $arg 0]]]'" }
  10.  
  11.     putnow "PRIVMSG $chan_(kadd) :${bopen}\00303KNOWN \00311MP3 \00303RELEASE GROUP\003${bclose} ${bopen}\00303HONOR \00311TV \00303RELEASE GROUP\003${bclose} ${bopen}\00303KNiSO \00311APPS \00303RELEASE GROUP\003${bclose}"
  12.     putnow "PRIVMSG $chan_(kadd) :This month has $days2go left to go! - Get Uploading if your failing the $quota_(amount) releases per month quota."
  13.  
  14.     if {![mysqlsel $db_handle "SELECT `crew`.`user`,IF(`count`,`count`,0) AS count FROM (SELECT DISTINCT `user` FROM `crew`) AS crew LEFT JOIN (SELECT `user`,COUNT(`user`) AS count FROM `info` WHERE `timestamp` >= UNIX_TIMESTAMP((LAST_DAY(NOW()) + INTERVAL 1 DAY) - INTERVAL 1 MONTH) GROUP BY `user`) AS info ON crew.user = info.user $refine ORDER BY `count` DESC"]} {
  15.         putnow "PRIVMSG $chan_(kadd) :No results found\."
  16.         return 0
  17.     }
  18.  
  19.     mysqlmap $db_handle {user count} {
  20.         if { $count >= $quota_(amount) } {
  21.             putnow "PRIVMSG $chan_(kadd) : \[\00314[num [incr place]]\003\] \00314$user\003 is \0033PASSiNG\003 \00314>\003 \00303$count releases this month\003"
  22.         } else {
  23.             putnow "PRIVMSG $chan_(kadd) : \[\00314[num [incr place]]\003\] \00314$user\003 is \0034FAiLiNG\003 \00314>\003 \00304$count releases this month\003"
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement