TOP 10: Porovnání verzí
Z Wiki UnArt Slavičín
Skočit na navigaciSkočit na vyhledávání
Bez shrnutí editace |
Bez shrnutí editace |
||
Řádek 5: | Řádek 5: | ||
:global users 0,0 | :global users 0,0 | ||
:global userDownload 0 | :global userDownload 0 | ||
:global userUpload 0 | |||
:global maxDownload 0,0 | :global maxDownload 0,0 | ||
:global maxUpload 0,0 | |||
:global top 10 | :global top 10 | ||
:global hArray1 | :global hArray1 | ||
Řádek 13: | Řádek 15: | ||
:global c | :global c | ||
:global d | :global d | ||
:global e | |||
:global f | |||
:global hInt | :global hInt | ||
Řádek 30: | Řádek 34: | ||
:local slashPosition [:find $userBytes /]; | :local slashPosition [:find $userBytes /]; | ||
:set userDownload [:pick $userBytes ($slashPosition+1) [:len $userBytes]]; | :set userDownload [:pick $userBytes ($slashPosition+1) [:len $userBytes]]; | ||
:set userUpload [:pick $userBytes 0 $slashPosition]; | |||
:set users ($users + $x) | :set users ($users + $x) | ||
:set maxDownload ($maxDownload + $userDownload) | :set maxDownload ($maxDownload + $userDownload) | ||
:set maxUpload ($maxUpload + $userUpload) | |||
:set hArray1 $maxDownload | :set hArray1 $maxDownload | ||
:set hArray2 $users | :set hArray2 $maxUpload | ||
:set hArray3 $users | |||
:for i from 0 to=([:len $maxDownload]-2) do={ | :for i from 0 to=([:len $maxDownload]-2) do={ | ||
Řádek 41: | Řádek 48: | ||
:set hArray1 0; | :set hArray1 0; | ||
:set hArray2 0; | :set hArray2 0; | ||
:set hArray3 0; | |||
:set a [:pick $maxDownload $i ($i+1)]; | :set a [:pick $maxDownload $i ($i+1)]; | ||
:set b [:pick $maxDownload $j ($j+1)]; | :set b [:pick $maxDownload $j ($j+1)]; | ||
:set c [:pick $users $i ($i+1)]; | :set c [:pick $maxUpload $i ($i+1)]; | ||
:set | :set d [:pick $maxUpload $j ($j+1)]; | ||
:set e [:pick $users $i ($i+1)]; | |||
:set f [:pick $users $j ($j+1)]; | |||
:if ($a<$b) do={ | :if ($a<$b) do={ | ||
Řádek 54: | Řádek 64: | ||
:set c $d; | :set c $d; | ||
:set d $hInt; | :set d $hInt; | ||
:set hInt $e; | |||
:set e $f; | |||
:set f $hInt; | |||
} | } | ||
:set hArray1 ([:pick $maxDownload 0 $i] + $a); | :set hArray1 ([:pick $maxDownload 0 $i] + $a); | ||
:set hArray2 ([:pick $users 0 $i] + $ | :set hArray2 ([:pick $maxUpload 0 $i] + $c); | ||
:set hArray3 ([:pick $users 0 $i] + $e); | |||
:if (($i+1)<$j) do={ | :if (($i+1)<$j) do={ | ||
:set hArray1 ($hArray1 + [:pick $maxDownload ($i+1) $j]); | :set hArray1 ($hArray1 + [:pick $maxDownload ($i+1) $j]); | ||
:set hArray2 ($hArray2 + [:pick $users ($i+1) $j]); | :set hArray2 ($hArray2 + [:pick $maxUpload ($i+1) $j]); | ||
:set hArray3 ($hArray3 + [:pick $users ($i+1) $j]); | |||
} | } | ||
Řádek 69: | Řádek 84: | ||
:set hArray1 ($hArray1 + $b); | :set hArray1 ($hArray1 + $b); | ||
:set hArray2 ($hArray2 + $d); | :set hArray2 ($hArray2 + $d); | ||
:set hArray3 ($hArray3 + $f); | |||
:if (($j+1)<[:len $maxDownload]) do={ | :if (($j+1)<[:len $maxDownload]) do={ | ||
:set hArray1 ($hArray1 + [:pick $maxDownload ($j+1) ([:len $maxDownload])]) | :set hArray1 ($hArray1 + [:pick $maxDownload ($j+1) ([:len $maxDownload])]) | ||
:set hArray2 ($hArray2 + [:pick $users ($j+1) ([:len $users])]) | :set hArray2 ($hArray2 + [:pick $maxUpload ($j+1) ([:len $maxUpload])]) | ||
:set hArray3 ($hArray3 + [:pick $users ($j+1) ([:len $users])]) | |||
} | } | ||
:set maxDownload $hArray1 | :set maxDownload $hArray1 | ||
:set users $ | :set maxUpload $hArray2 | ||
:set users $hArray3 | |||
} | } | ||
Řádek 85: | Řádek 103: | ||
:set maxDownload [:pick $maxDownload 0 $top] | :set maxDownload [:pick $maxDownload 0 $top] | ||
:set maxUpload [:pick $maxUpload 0 $top] | |||
:set users [:pick $users 0 $top] | :set users [:pick $users 0 $top] | ||
Verze z 29. 12. 2008, 23:42
:global x 0 :global myParent "wifi" :global badParent "stahovaci" :global userBytes 0/0 :global users 0,0 :global userDownload 0 :global userUpload 0 :global maxDownload 0,0 :global maxUpload 0,0 :global top 10 :global hArray1 :global hArray2 :global a :global b :global c :global d :global e :global f :global hInt /queue simple :foreach i in=[find parent=$badParent] do={ set $i parent=$myParent; } :foreach i in=[find] do={ :if ([get $i parent]=$myParent) do={ :set userBytes [get $i bytes]; :local slashPosition [:find $userBytes /]; :set userDownload [:pick $userBytes ($slashPosition+1) [:len $userBytes]]; :set userUpload [:pick $userBytes 0 $slashPosition]; :set users ($users + $x) :set maxDownload ($maxDownload + $userDownload) :set maxUpload ($maxUpload + $userUpload) :set hArray1 $maxDownload :set hArray2 $maxUpload :set hArray3 $users :for i from 0 to=([:len $maxDownload]-2) do={ :for j from ($i+1) to=([:len $maxDownload]-1) do={ :set hArray1 0; :set hArray2 0; :set hArray3 0; :set a [:pick $maxDownload $i ($i+1)]; :set b [:pick $maxDownload $j ($j+1)]; :set c [:pick $maxUpload $i ($i+1)]; :set d [:pick $maxUpload $j ($j+1)]; :set e [:pick $users $i ($i+1)]; :set f [:pick $users $j ($j+1)]; :if ($a<$b) do={ :set hInt $a; :set a $b; :set b $hInt; :set hInt $c; :set c $d; :set d $hInt; :set hInt $e; :set e $f; :set f $hInt; } :set hArray1 ([:pick $maxDownload 0 $i] + $a); :set hArray2 ([:pick $maxUpload 0 $i] + $c); :set hArray3 ([:pick $users 0 $i] + $e); :if (($i+1)<$j) do={ :set hArray1 ($hArray1 + [:pick $maxDownload ($i+1) $j]); :set hArray2 ($hArray2 + [:pick $maxUpload ($i+1) $j]); :set hArray3 ($hArray3 + [:pick $users ($i+1) $j]); } :set hArray1 ($hArray1 + $b); :set hArray2 ($hArray2 + $d); :set hArray3 ($hArray3 + $f); :if (($j+1)<[:len $maxDownload]) do={ :set hArray1 ($hArray1 + [:pick $maxDownload ($j+1) ([:len $maxDownload])]) :set hArray2 ($hArray2 + [:pick $maxUpload ($j+1) ([:len $maxUpload])]) :set hArray3 ($hArray3 + [:pick $users ($j+1) ([:len $users])]) } :set maxDownload $hArray1 :set maxUpload $hArray2 :set users $hArray3 } } :set maxDownload [:pick $maxDownload 0 $top] :set maxUpload [:pick $maxUpload 0 $top] :set users [:pick $users 0 $top] } :set x ($x+1); } :for i from 0 to=([:len $users]-1) do={ set [:pick $users $i ($i+1)] parent=$badParent; }