Advertisement
westor

Auto upload stats for multi network channels v2.0

Nov 8th, 2014
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.22 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.   :again
  25.   var %mf = C:\mircstats\mircstats.exe
  26.   if (!$isfile(%mf)) { .timer[UPLOAD_STATS] off | return }
  27.   if (!%upload_stats) { .timer[UPLOAD_STATS] off | return }
  28.   var %g = $gettok(%upload_stats,$rand(1,$numtok(%upload_stats,32)),32)
  29.   var %file = $logdir $+ %g
  30.   set -e %upload_stats $remtok(%upload_stats,%g,1,32)
  31.   if (!$isfile(%file)) { goto again }
  32.   run -nh $qt(%mf) -log $qt(%file) -cfg settings.cfg
  33.   .timer[UPLOAD_STATS] 1 30 upload_stats_start
  34. }
  35.  
  36. alias allchans {
  37.   var %t = $chan(0)
  38.   var %i = 1
  39.   while (%i <= %t) {
  40.     var %c = $chan(%i)
  41.     if ($me ison %c) { var %tot = $addtok(%tot,%c,44) }
  42.     inc %i
  43.   }
  44.   return $iif(%tot,$v1,0)
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement