Advertisement
westor

Auto upload stats for multi network channels

Nov 8th, 2014
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.16 KB | None | 0 0
  1. alias update_stats {
  2.   var %mf = C:\mircstats\mircstats.exe
  3.   if (!$isfile(%mf)) { return }
  4.   if (%upload_stats) { return }
  5.   var %t = $scon(0)
  6.   var %i = 1
  7.   while (%i <= %t) {
  8.     var %n = $scon(%i).network
  9.     var %c = $scon(%i).allchans
  10.     var %ii = 1
  11.     var %tt = $numtok(%c,44)
  12.     while (%ii <= %tt) {
  13.       var %chan = $gettok(%c,%ii,44)
  14.       var %f = %chan $+ . $+ %n $+ .log
  15.       set -e %upload_stats $addtok(%upload_stats,%f,32)
  16.       inc %ii
  17.     }
  18.     inc %i
  19.   }
  20.   if (%upload_stats) { upload_stats_start }
  21. }
  22.  
  23. alias upload_stats_start {
  24.   var %mf = C:\mircstats\mircstats.exe
  25.   if (!$isfile(%mf)) { .timer[UPLOAD_STATS] off | return }
  26.   if (!%upload_stats) { .timer[UPLOAD_STATS] off | return }
  27.   var %g = $gettok(%upload_stats,$rand(1,$numtok(%upload_stats,32)),32)
  28.   set -e %upload_stats $remtok(%upload_stats,%g,1,32)
  29.   run -nh $qt(%mf) -log $qt($logdir $+ %g) -cfg settings.cfg
  30.   .timer[UPLOAD_STATS] 1 30 upload_stats_start
  31. }
  32.  
  33. alias allchans {
  34.   var %t = $chan(0)
  35.   var %i = 1
  36.   while (%i <= %t) {
  37.     var %c = $chan(%i)
  38.     if ($me ison %c) { var %tot = $addtok(%tot,%c,44) }
  39.     inc %i
  40.   }
  41.   return $iif(%tot,$v1,0)
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement