Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias upstats {
- if ($gatherinfo(ftp)) {
- 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/")
- if (%upload.stats) || (!%url) || (($isfile(upstats.bat)) && ($isfile(upstats.txt))) || (!$isfile($gfile(upstats.html))) { return $false }
- set -z %upload.stats 2 | .timerupstats 1 30 upstats_clean
- 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,")
- 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
- 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
- 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
- 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
- var %lastgame = $gatherstats(%steamid,lastgame), %n = $numtok(%lastgame,44), %id = $gettok(%lastgame,%n,44)
- if (%id) {
- if ($readini($gfile(gatherids.ini),%id,%steamid)) {
- 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)
- 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)
- 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 }
- 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 }
- 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)
- 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))
- 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>)
- }
- 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 }
- }
- if ($gatherstats(%gstats,Lastpoints)) {
- var %pp = $remove($strip($ifmatch),+), %ii = 1, %aa = 1, %ppoints, %bb | while (%ii <= $numtok(%pp,32)) {
- 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
- if (%aa > $iif(%bb,20,18)) {
- 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 } }
- else { if (%ii <= $numtok(%pp,32)) { write %file %ppoints | var %ppoints } | else { write %file %ppoints $+(%logo,<p>) | var %ppoints } }
- }
- inc %aa
- }
- if (%ppoints) { if (!%bb) { write %file $html(%logo $html(Skill history:).bold %ppoints %logo).p } | else { write %file %ppoints $+(%logo,<p>) } }
- }
- else { write %file $html(%logo $html(Skill history:).bold $html(04,Inactive).c %logo).p }
- write %file | 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)
- 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
- 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
- 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
- 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
- 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
- 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 }
- 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
- if (!%crlf) { write %file | var %crlf = 1 } | write %file $html($html(%wep,%stat).weapon).p
- }
- window -c @wepstats | write %file | write %file $html(%logo End of stats file %s $html(Uploaded: $html($date $time).bold).strong %logo).p
- write %file <!-- end #stats --></div>
- write %file <!-- end #mainContent --></div>
- write %file
- write %file <div id="footer">
- write %file <p>Copyright © Gosu - <a href="http://www.gosu.dk" style="color:#000; text-decoration:none;">www.gosu.dk</a></p>
- write %file <!-- end #footer --></div>
- write %file <!-- end #container --></div>
- write %file
- write %file </body>
- write %file </html>
- write -c upstats.txt open %host | write upstats.txt %user | write upstats.txt %pass | write upstats.txt bin
- write upstats.txt cd %dir | write upstats.txt dele %put | write upstats.txt put %put | write upstats.txt quit
- write -c upstats.bat @echo off | write upstats.bat ftp -i -s:"upstats.txt" | write upstats.bat del %put
- write upstats.bat del upstats.txt | write upstats.bat del upstats.bat | .timer 1 0 run -hp upstats.bat
- return $+(%url,$iif($right(%url,1) != /,/),stats/,%clean)
- }
- return $false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement