Advertisement
Guest User

Untitled

a guest
Jan 6th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 8.79 KB | None | 0 0
  1. alias upstats {
  2.   if ($gatherinfo(ftp)) {
  3.     var %ftp = $ifmatch, %host = $gettok(%ftp,1,32), %user = $gettok(%ftp,2,32), %pass = $gettok(%ftp,3,32), %dir = $gettok(%ftp,4,32), %url = $gettok(%ftp,5,32), %dir = $+(",$iif($left(%dir,1) != /,/),%dir,$iif($right(%dir,1) != /,/),stats/")
  4.     if (%upload.stats) || (!%url) || (($isfile(upstats.bat)) && ($isfile(upstats.txt))) || (!$isfile($gfile(upstats.html))) { return $false }
  5.     set -z %upload.stats 2 | .timerupstats 1 30 upstats_clean
  6.     var %gstats = $1, %steamid = $1, %auth = $gauth(%steamid), %nick = $gnick(%steamid), %clean = $+(%auth,.html), %file = $+(%clean), %put = %file, %s = $html(split).color, %logo = $html(logo).color | .copy -o $+(",$gfile(upstats.html),") $+(",%file,")
  7.     write %file $html(%logo $html(Stats on: $html(%nick).bold).strong %s $html(Auth: $html(%auth).bold).strong %s $html(Steamid: $html(%steamid).bold).strong %logo).p | write %file  
  8.     write %file $html(%logo $html(Rank:).bold $gatherstats(%gstats,Rank) $+ / $+ $lines($gfile(gatherusers.dat)) %s $html(Points:).bold $round($iif($gatherstats(%gstats,Points),$ifmatch,1000),2) %s $html(Man of the Match:).bold $gatherstats(%gstats,motm) %s $html(Best K/D's:).bold $gatherstats(%gstats,bestkds) %s $html(Newb of the Match:).bold $gatherstats(%gstats,notm) %logo).p
  9.     write %file $html(%logo $html(Games:).bold $gatherstats(%gstats,Played) %s $html(Started:).bold $gatherstats(%gstats,Started) %s $html(Substitute:).bold $gatherstats(%gstats,Subs) %s $html(Won:).bold $gatherstats(%gstats,Wins) %s $html(Draw:).bold $gatherstats(%gstats,Draw) %s $html(Lost:).bold $gatherstats(%gstats,Loss) %s $html(Bans:).bold $gatherstats(%gstats,Bans) %s $html(Leavebans:).bold $gatherstats(%gstats,Leavebans) %logo).p
  10.     write %file $html(%logo $html(Entrykills:).bold $gatherstats(%gstats,Entrykills) %s $html(Kills:).bold $gatherstats(%gstats,Kills) %s $html(Deaths:).bold $gatherstats(%gstats,Deaths) %s $html(Plants:).bold $gatherstats(%gstats,Plants) %s $html(Defuses:).bold $gatherstats(%gstats,Defs) %s $html(K/D:).bold $round($calc($gatherstats(%gstats,Kills) / $gatherstats(%gstats,Deaths)),2) %s $html(Assists:).bold $gatherstats(%gstats,Assists) %s $html(Aces:).bold $gatherstats(%gstats,Aces) %logo).p
  11.     var %lastgame = $gatherstats(%steamid,lastgame), %n = $numtok(%lastgame,44), %id = $gettok(%lastgame,%n,44)
  12.     if (%id) {
  13.       if ($readini($gfile(gatherids.ini),%id,%steamid)) {
  14.         var %stats = $ifmatch, %k = $gettok($gettok(%stats,1,32),2,58), %d = $gettok($gettok(%stats,2,32),2,58), %a = $gettok($gettok(%stats,3,32),2,58), %p = $round($gettok($gettok(%stats,4,32),2,58),2), %kd = $round($calc(%k / $iif(%d,$ifmatch,1)),2)
  15.         set -u60 %gatherid. [ $+ [ $+(%id,.,%steamid) ] ] 1 | var %ct = $readini($gfile(gatherids.ini),%id,CT), %t = $readini($gfile(gatherids.ini),%id,TERRORIST), %teamwon = $readini($gfile(gatherids.ini),%id,TeamWon), %winloss = $iif(%teamwon == Draw,$html(08,Draw).c,$html(04,Lost).c)
  16.         if ($istok(%ct,%auth,32)) { var %team = CT } | if ($istok(%t,%auth,32)) { var %team = TERRORIST } | if ($readini($gfile(gatherids.ini),%id,TeamWon) == %team) { var %winloss = $html(09,Won).c }
  17.         if ($readini($gfile(gatherids.ini),%id,bestkd) == %steamid) { var %bestkd = 1 } | if ($readini($gfile(gatherids.ini),%id,MotM) == %steamid) { var %motm = 1 } | elseif ($readini($gfile(gatherids.ini),%id,NotM) == %steamid) { var %notm = 1 }
  18.         var %1on1 = $gettok($gettok(%stats,5,32),2,58), %1on2 = $gettok($gettok(%stats,6,32),2,58), %1on3 = $gettok($gettok(%stats,7,32),2,58), %1on4 = $gettok($gettok(%stats,8,32),2,58), %1on5 = $gettok($gettok(%stats,9,32),2,58), %x1 = $gettok(%1on1,2,47), %x2 = $gettok(%1on2,2,47), %x3 = $gettok(%1on3,2,47), %x4 = $gettok(%1on4,2,47), %x5 = $gettok(%1on5,2,47)
  19.         write %file $+(<p>,%logo $html(Lastgame:).bold $+($chr(35),%id) %s $gettok($readini($gfile(gatherids.ini),%id,Ended),1,32) %s $html(Type:).bold $readini($gfile(gatherids.ini),%id,Type) %s $html(Points:).bold $iif(%p >= 0,$html(09,$+(+,%p)).c,$html(04,%p).c) %s $html(K/D:).bold %kd $+($html(14,$chr(91)).c,%k,/,%d,$html(14,$chr(93)).c))
  20.         write %file $+($iif(%x1,%s $html(1on1:).bold %1on1) $iif(%x2,%s $html(1on2:).bold %1on2) $iif(%x3,%s $html(1on3:).bold %1on3) $iif(%x4,%s $html(1on4:).bold %1on4) $iif(%x5,%s $html(1on5:).bold %1on5) %s $html(Status:).bold %winloss $iif(%motm,%s $html(07,Man of the Match).c,$iif(%notm,%s $html(04,Newb of the Match).c)) $iif(%bestkd,%s $html(07,Best K/D).c) %logo,<p>)
  21.       }
  22.       else { write %file $html(%logo $html(Lastgame:).bold $+($chr(35),%id) %s $gettok($readini($gfile(gatherids.ini),%id,Ended),1,32) %s $html(Type:).bold $readini($gfile(gatherids.ini),%id,Type) %s $html(Points:).bold $html(04,-39).c %s $html(Status:).bold $html(04,Leaver).c %logo).p }
  23.     }
  24.     if ($gatherstats(%gstats,Lastpoints)) {
  25.       var %pp = $remove($strip($ifmatch),+), %ii = 1, %aa = 1, %ppoints, %bb | while (%ii <= $numtok(%pp,32)) {
  26.         var %xx = $round($gettok(%pp,%ii,32),1), %nn = $iif(%xx < 0,$html(04,%xx).c,$html(09,$+(+,%xx)).c), %ppoints = %ppoints %nn | inc %ii
  27.         if (%aa > $iif(%bb,20,18)) {
  28.           if (!%bb) { if (%ii <= $numtok(%pp,32)) { write %file $+(<p>,%logo) $html(Skill history:).bold %ppoints | var %bb = 1, %ppoints } | else { write %file $html(%logo $html(Skill history:).bold %ppoints %logo).p | var %bb = 1, %ppoints } }
  29.           else { if (%ii <= $numtok(%pp,32)) { write %file %ppoints | var %ppoints } | else { write %file %ppoints $+(%logo,<p>) | var %ppoints } }
  30.         }
  31.         inc %aa
  32.       }
  33.       if (%ppoints) { if (!%bb) { write %file $html(%logo $html(Skill history:).bold %ppoints %logo).p } | else { write %file %ppoints $+(%logo,<p>) } }
  34.     }
  35.     else { write %file $html(%logo $html(Skill history:).bold $html(04,Inactive).c %logo).p }
  36.     write %file &nbsp; | var %1on1 = $clutchstats(%gstats,1on1), %fon1 = $clutchstats(%gstats,fail_1on1), %1on2 = $clutchstats(%gstats,1on2), %fon2 = $clutchstats(%gstats,fail_1on2), %1on3 = $clutchstats(%gstats,1on3), %fon3 = $clutchstats(%gstats,fail_1on3), %1on4 = $clutchstats(%gstats,1on4), %fon4 = $clutchstats(%gstats,fail_1on4), %1on5 = $clutchstats(%gstats,1on5), %fon5 = $clutchstats(%gstats,fail_1on5)
  37.     write %file $html(%logo $html(1on1:).bold %1on1 out of $calc(%1on1 + %fon1) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on1 + %fon1) * %1on1),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
  38.     write %file $html(%logo $html(1on2:).bold %1on2 out of $calc(%1on2 + %fon2) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on2 + %fon2) * %1on2),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
  39.     write %file $html(%logo $html(1on3:).bold %1on3 out of $calc(%1on3 + %fon3) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on3 + %fon3) * %1on3),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
  40.     write %file $html(%logo $html(1on4:).bold %1on4 out of $calc(%1on4 + %fon4) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on4 + %fon4) * %1on4),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
  41.     write %file $html(%logo $html(1on5:).bold %1on5 out of $calc(%1on5 + %fon5) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on5 + %fon5) * %1on5),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
  42.     var %x = 1 | window -eh1 @wepstats | while (%x <= $ini($gfile(wepstats.ini),%gstats,0)) { var %wep = $ini($gfile(wepstats.ini),%gstats,%x) | aline @wepstats %wep $ex_nr($readini($gfile(wepstats.ini),%gstats,%wep)) | inc %x }
  43.     filter -twce 2 32 @wepstats @wepstats | var %x = 1, %crlf | while (%x <= $line(@wepstats,0)) { var %wep = $upleft($gettok($line(@wepstats,%x),1,32)), %stat = $round($gettok($line(@wepstats,%x),2,32),0) | inc %x
  44.       if (!%crlf) { write %file &nbsp; | var %crlf = 1 } | write %file $html($html(%wep,%stat).weapon).p
  45.     }
  46.     window -c @wepstats | write %file &nbsp; | write %file $html(%logo End of stats file %s $html(Uploaded: $html($date $time).bold).strong %logo).p
  47.     write %file <!-- end #stats --></div>
  48.     write %file <!-- end #mainContent --></div>
  49.     write %file &nbsp;
  50.     write %file <div id="footer">
  51.     write %file <p>Copyright &copy; Gosu - <a href="http://www.gosu.dk" style="color:#000; text-decoration:none;">www.gosu.dk</a></p>
  52.     write %file <!-- end #footer --></div>
  53.     write %file <!-- end #container --></div>
  54.     write %file &nbsp;
  55.     write %file </body>
  56.     write %file </html>
  57.     write -c upstats.txt open %host | write upstats.txt %user | write upstats.txt %pass | write upstats.txt bin
  58.     write upstats.txt cd %dir | write upstats.txt dele %put | write upstats.txt put %put | write upstats.txt quit
  59.     write -c upstats.bat @echo off | write upstats.bat ftp -i -s:"upstats.txt" | write upstats.bat del %put
  60.     write upstats.bat del upstats.txt | write upstats.bat del upstats.bat | .timer 1 0 run -hp upstats.bat
  61.     return $+(%url,$iif($right(%url,1) != /,/),stats/,%clean)
  62.   }
  63.   return $false
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement