Jump to content

[help] 10 best time on map


2paq

Recommended Posts

Posted (edited)

I do this:

on *:SIGNAL:mta.finish: {
 var %nick01 = $iif($readini($scriptdir $+ 10times.ini,NICK01,$mta.nick($1,$2)),$v1,n/a)
 var %nick02 = $iif($readini($scriptdir $+ 10times.ini,NICK02,$mta.nick($1,$2)),$v1,n/a)
 var %nick03 = $iif($readini($scriptdir $+ 10times.ini,NICK03,$mta.nick($1,$2)),$v1,n/a)
 var %nick04 = $iif($readini($scriptdir $+ 10times.ini,NICK04,$mta.nick($1,$2)),$v1,n/a)
 var %nick05 = $iif($readini($scriptdir $+ 10times.ini,NICK05,$mta.nick($1,$2)),$v1,n/a)
 var %nick06 = $iif($readini($scriptdir $+ 10times.ini,NICK06,$mta.nick($1,$2)),$v1,n/a)
 var %nick07 = $iif($readini($scriptdir $+ 10times.ini,NICK07,$mta.nick($1,$2)),$v1,n/a)
 var %nick08 = $iif($readini($scriptdir $+ 10times.ini,NICK08,$mta.nick($1,$2)),$v1,n/a)
 var %nick09 = $iif($readini($scriptdir $+ 10times.ini,NICK09,$mta.nick($1,$2)),$v1,n/a)
 var %nick10 = $iif($readini($scriptdir $+ 10times.ini,NICK10,$mta.nick($1,$2)),$v1,n/a)
 var %time01 = $iif($readini($scriptdir $+ 10times.ini,TOPT01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time02 = $iif($readini($scriptdir $+ 10times.ini,TOPT02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time03 = $iif($readini($scriptdir $+ 10times.ini,TOPT03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time04 = $iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time05 = $iif($readini($scriptdir $+ 10times.ini,TOPT05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time06 = $iif($readini($scriptdir $+ 10times.ini,TOPT06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time07 = $iif($readini($scriptdir $+ 10times.ini,TOPT07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time08 = $iif($readini($scriptdir $+ 10times.ini,TOPT08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time09 = $iif($readini($scriptdir $+ 10times.ini,TOPT09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time10 = $iif($readini($scriptdir $+ 10times.ini,TOPT10,$replace($mta.race($1),$chr(32),-)),$v1,-1)

 if (%time01 == -1) {
   %time01 = $mta.time($1,$2)
   %nick01 = $mta.nick($1,$2)    
 }
 elseif ($mta.time($1,$2) <= %time01) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = %time02
   %time02 = %time01
   %time01 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = %nick02
   %nick02 = %nick01
   %nick01 = $mta.nick($1,$2)
 }
 elseif ((%time02 == -1) && ($mta.nick($1,$2) != %nick01)) {
   %time02 = $mta.time($1,$2)
   %nick02 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the second time!
 }
 elseif (($mta.time($1,$2) <= %time02) && ($mta.nick($1,$2) != %nick01)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = %time02
   %time02 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = %nick02
   %nick02 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the second time!
 }
 elseif ((%time03 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02)) {
   %time03 = $mta.time($1,$2)
   %nick03 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the third time!
 }
 elseif (($mta.time($1,$2) <= %time03) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the third time!
 }
 elseif ((%time04 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03)) {
   %time04 = $mta.time($1,$2)
   %nick04 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the forth time!
 }
 elseif (($mta.time($1,$2) <= %time04) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the forth time!
 }
 elseif ((%time05 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04)) {
   %time05 = $mta.time($1,$2)
   %nick05 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the fifth time!
 }
 elseif (($mta.time($1,$2) <= %time05) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the fifth time!
 }
 elseif ((%time06 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05)) {
   %time06 = $mta.time($1,$2)
   %nick06 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the sixth time!
 }
 elseif (($mta.time($1,$2) <= %time06) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the sixth time!
 }
 elseif ((%time07 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06)) {
   %time07 = $mta.time($1,$2)
   %nick07 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the seventh time!
 }
 elseif (($mta.time($1,$2) <= %time07) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the seventh time!
 }
 elseif ((%time08 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07)) {
   %time08 = $mta.time($1,$2)
   %nick08 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the eighth time!
 }
 elseif (($mta.time($1,$2) <= %time08) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the eighth time!
 }
 elseif ((%time09 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time09 = $mta.time($1,$2)
   %nick09 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the ninth time!
 }
 elseif (($mta.time($1,$2) <= %time09) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time10 = %time09
   %time09 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = $mta.nick($1,$2)
   mta.text $1 $mta.nick($1,$2) beat the ninth time!
 }
 elseif ((%time10 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08) && ($mta.nick($1,$2) != %nick09)) {
   %time10 = $mta.time($1,$2)
   %nick10 = $mta.nick($1,$2) 
   mta.text $1 $mta.nick($1,$2) end race with the tenth time!
 }
 elseif (($mta.time($1,$2)  0) {
   var %time01mins = $int($calc(%time01 / 60000))
   var %time01sec = $int($calc((%time01 - (%time01mins * 60000)) / 1000))
   var %time01ms = $calc((%time01 - (%time01mins * 60000)) - (%time01sec * 1000))
 }
 elseif (%time01 <0> 0) {
   var %time02mins = $int($calc(%time02 / 60000))
   var %time02sec = $int($calc((%time02 - (%time02mins * 60000)) / 1000))
   var %time02ms = $calc((%time02 - (%time02mins * 60000)) - (%time02sec * 1000))
 }
 elseif (%time02 <0> 0) {
   var %time03mins = $int($calc(%time03 / 60000))
   var %time03sec = $int($calc((%time03 - (%time03mins * 60000)) / 1000))
   var %time03ms = $calc((%time03 - (%time03mins * 60000)) - (%time03sec * 1000))
 }
 elseif (%time03 <= 0) var %time03mins = --, %time03sec = --, %time03ms = --
   mta.text $1 Top time's on map $mta.race($1)
   mta.text $1 1. $iif($readini($scriptdir $+ 10times.ini,NICK01,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time01mins min %time01sec sec %time01ms ms
   mta.text $1 2. $iif($readini($scriptdir $+ 10times.ini,NICK02,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time02mins min %time02sec sec %time02ms ms
   mta.text $1 3. $iif($readini($scriptdir $+ 10times.ini,NICK03,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time03mins min %time03sec sec %time03ms ms
   if ($iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,0) > 0) {
     var %time04 = $iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time05 = $iif($readini($scriptdir $+ 10times.ini,TOPT05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time06 = $iif($readini($scriptdir $+ 10times.ini,TOPT06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     if (%time04 > 0) {
       var %time04mins = $int($calc(%time04 / 60000))
       var %time04sec = $int($calc((%time04 - (%time04mins * 60000)) / 1000))
       var %time04ms = $calc((%time04 - (%time04mins * 60000)) - (%time04sec * 1000))
     }
     elseif (%time04 <0> 0) {
       var %time05mins = $int($calc(%time05 / 60000))
       var %time05sec = $int($calc((%time05 - (%time05mins * 60000)) / 1000))
       var %time05ms = $calc((%time05 - (%time05mins * 60000)) - (%time05sec * 1000))
     }
     elseif (%time05 <0> 0) {
       var %time06mins = $int($calc(%time06 / 60000))
       var %time06sec = $int($calc((%time06 - (%time06mins * 60000)) / 1000))
       var %time06ms = $calc((%time06 - (%time06mins * 60000)) - (%time06sec * 1000))
     }
     elseif (%time06 <0> 0) {
     var %time07 = $iif($readini($scriptdir $+ 10times.ini,TOPT07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time08 = $iif($readini($scriptdir $+ 10times.ini,TOPT08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time09 = $iif($readini($scriptdir $+ 10times.ini,TOPT09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time10 = $iif($readini($scriptdir $+ 10times.ini,TOPT10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
       if (%time07 > 0) {
         var %time07mins = $int($calc(%time07 / 60000))
         var %time07sec = $int($calc((%time07 - (%time07mins * 60000)) / 1000))
         var %time07ms = $calc((%time07 - (%time07mins * 60000)) - (%time07sec * 1000))
       }
       elseif (%time07 <0> 0) {
         var %time08mins = $int($calc(%time08 / 60000))
         var %time08sec = $int($calc((%time08 - (%time08mins * 60000)) / 1000))
         var %time08ms = $calc((%time08 - (%time08mins * 60000)) - (%time08sec * 1000))
       }
       elseif (%time08 <0> 0) {
         var %time09mins = $int($calc(%time09 / 60000))
         var %time09sec = $int($calc((%time09 - (%time09mins * 60000)) / 1000))
         var %time09ms = $calc((%time09 - (%time09mins * 60000)) - (%time09sec * 1000))
       }
       elseif (%time09 <0> 0) {
         var %time10mins = $int($calc(%time10 / 60000))
         var %time10sec = $int($calc((%time10 - (%time10mins * 60000)) / 1000))
         var %time10ms = $calc((%time10 - (%time10mins * 60000)) - (%time10sec * 1000))
       }
       elseif (%time10 <= 0) var %time10mins = --, %time10sec = --, %time10ms = --
     !.timer.10.10 1 10 mta.pm $1 $2 7. $iif($readini($scriptdir $+ 10times.ini,NICK07,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time07mins min %time07sec sec %time07ms ms
     !.timer.10.12 1 12 mta.pm $1 $2 8. $iif($readini($scriptdir $+ 10times.ini,NICK08,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time08mins min %time08sec sec %time08ms ms
     !.timer.10.14 1 14 mta.pm $1 $2 9. $iif($readini($scriptdir $+ 10times.ini,NICK09,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time09mins min %time09sec sec %time09ms ms
     !.timer.10.16 1 16 mta.pm $1 $2 10. $iif($readini($scriptdir $+ 10times.ini,NICK10,$replace($mta.race($1),$chr(32),-)),$v1,N/A) - %time10mins min %time10sec sec %time10ms ms
   }
 } 
}

Edited by Guest
  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)

and it working but that script write for example:

Top time's on map 2paqDRIFT

1. [2RT]acp___(PL) - 6865756754

2. Leito.PL - 67565654

3. Leito.PL - 9098908

4. [2RT]Bodzio.PL - 9090909

5. Leito.PL - 787878

etc.

double rekord for one player - I don't wont that!!

... and I wrote this:

Edit:

I find enother bug:

exp.1 step1. - ok

Top time's on map 2paqDRIFT

1. [2RT]acp___(PL) - 6865756754

2. n/a - n/a

3. n/a - n/a

exp.2. step.2 - bug

Top time's on map 2paqDRIFT

1. n/a - 6865756754 ;nick ==> n/a ?? time - ok

2. Leito.PL - 9090909

3. n/a - n/a

exp.3. step.3 - bug

Top time's on map 2paqDRIFT

1. n/a - 6865756754

2. [2RT]Bodzio.PL - 67565654

3. n/a - 9090909 ;nick ==> n/a ?? time - ok

Edited by Guest
Posted
on *:SIGNAL:mta.startrace: {
;///////this script is for erase double rekord///////
;---------------------------------------------------
;read nick's and time's from time
 var %nick01 = $iif($readini($scriptdir $+ 10times.ini,NICK01,$mta.nick($1,$2)),$v1,n/a)
 var %nick02 = $iif($readini($scriptdir $+ 10times.ini,NICK02,$mta.nick($1,$2)),$v1,n/a)
 var %nick03 = $iif($readini($scriptdir $+ 10times.ini,NICK03,$mta.nick($1,$2)),$v1,n/a)
 var %nick04 = $iif($readini($scriptdir $+ 10times.ini,NICK04,$mta.nick($1,$2)),$v1,n/a)
 var %nick05 = $iif($readini($scriptdir $+ 10times.ini,NICK05,$mta.nick($1,$2)),$v1,n/a)
 var %nick06 = $iif($readini($scriptdir $+ 10times.ini,NICK06,$mta.nick($1,$2)),$v1,n/a)
 var %nick07 = $iif($readini($scriptdir $+ 10times.ini,NICK07,$mta.nick($1,$2)),$v1,n/a)
 var %nick08 = $iif($readini($scriptdir $+ 10times.ini,NICK08,$mta.nick($1,$2)),$v1,n/a)
 var %nick09 = $iif($readini($scriptdir $+ 10times.ini,NICK09,$mta.nick($1,$2)),$v1,n/a)
 var %nick10 = $iif($readini($scriptdir $+ 10times.ini,NICK10,$mta.nick($1,$2)),$v1,n/a)
 var %time01 = $iif($readini($scriptdir $+ 10times.ini,TOPT01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time02 = $iif($readini($scriptdir $+ 10times.ini,TOPT02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time03 = $iif($readini($scriptdir $+ 10times.ini,TOPT03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time04 = $iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time05 = $iif($readini($scriptdir $+ 10times.ini,TOPT05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time06 = $iif($readini($scriptdir $+ 10times.ini,TOPT06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time07 = $iif($readini($scriptdir $+ 10times.ini,TOPT07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time08 = $iif($readini($scriptdir $+ 10times.ini,TOPT08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time09 = $iif($readini($scriptdir $+ 10times.ini,TOPT09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time10 = $iif($readini($scriptdir $+ 10times.ini,TOPT10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
;----------------------------------------------------
;find the same nick's (double), return the number of nick wich is the same as key nick
 if (%time01 > 0) {
   var %number = $findtok(%nick02 %nick03 %nick04 %nick05 %nick06 %nick07 %nick08 %nick09 %nick10,%nick01,1,32)
   find.by.number
 }
 if (%time02 > 0) {
  var %number = $findtok(%nick03 %nick04 %nick05 %nick06 %nick07 %nick08 %nick09 %nick10,%nick02,1,32)
  %number = %number + 1
  find.by.number
 }
 if (%time03 > 0) {
  var %number = $findtok(%nick04 %nick05 %nick06 %nick07 %nick08 %nick09 %nick10,%nick03,1,32)
  %number = %number + 2
  find.by.number
 }
 if (%time04 > 0) {
  var %number = $findtok(%nick05 %nick06 %nick07 %nick08 %nick09 %nick10,%nick04,1,32)
  %number = %number + 3
  find.by.number
 }
 if (%time05 > 0) {  
  var %number = $findtok(%nick06 %nick07 %nick08 %nick09 %nick10,%nick05,1,32)
  %number = %number + 4
  find.by.number
 }
 if (%time06 > 0) {
  var %number = $findtok(%nick07 %nick08 %nick09 %nick10,%nick06,1,32)
  %number = %number + 5
  find.by.number
 }
 if (%time07 > 0) {
  var %number = $findtok(%nick08 %nick09 %nick10,%nick07,1,32)
  %number = %number + 6
  find.by.number
 }
 if (%time08 > 0) {
  var %number = $findtok(%nick09 %nick10,%nick08,1,32)
  %number = %number + 7
  find.by.number
 }
 if ((%time09 > 0) && (%nick10 == %nick09)) from.10
;-----------------------------------------------------
;this algorithm say where is the next step
 alias find.by.number {
   if (%number == 1) from.2
   elseif (%number == 2) from.3
   elseif (%number == 3) from.4
   elseif (%number == 4) from.5
   elseif (%number == 5) from.6
   elseif (%number == 6) from.7
   elseif (%number == 7) from.8
   elseif (%number ==  from.9
 }
;-----------------------------------------------------
;this put up the nick from position where is the double nick
 alias from.2 {
 %nick02 = %nick03
 %nick03 = %nick04
 %nick04 = %nick05
 %nick05 = %nick06
 %nick06 = %nick07
 %nick07 = %nick08
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time02 = %time03
 %time03 = %time04
 %time04 = %time05
 %time05 = %time06
 %time06 = %time07
 %time07 = %time08
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.3 {
 %nick03 = %nick04
 %nick04 = %nick05
 %nick05 = %nick06
 %nick06 = %nick07
 %nick07 = %nick08
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time03 = %time04
 %time04 = %time05
 %time05 = %time06
 %time06 = %time07
 %time07 = %time08
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.4 {
 %nick04 = %nick05
 %nick05 = %nick06
 %nick06 = %nick07
 %nick07 = %nick08
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time04 = %time05
 %time05 = %time06
 %time06 = %time07
 %time07 = %time08
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.5 {
 %nick05 = %nick06
 %nick06 = %nick07
 %nick07 = %nick08
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time05 = %time06
 %time06 = %time07
 %time07 = %time08
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.6 {
 %nick06 = %nick07
 %nick07 = %nick08
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time06 = %time07
 %time07 = %time08
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.7 {
 %nick07 = %nick08
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time07 = %time08
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.8 {
 %nick08 = %nick09
 %nick09 = %nick10
 %nick10 = n/a
 %time08 = %time09
 %time09 = %time10
 %time10 = -1
 }
 alias from.9 {
 %nick09 = %nick10
 %nick10 = n/a
 %time09 = %time10
 %time10 = -1
 }
 alias from.10 {
 %nick10 = n/a
 %time10 = -1
 }
;-----------------------------------------------------
;write to file
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT01 $replace($mta.race($1),$chr(32),-) %time01
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT02 $replace($mta.race($1),$chr(32),-) %time02
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT03 $replace($mta.race($1),$chr(32),-) %time03
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT04 $replace($mta.race($1),$chr(32),-) %time04
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT05 $replace($mta.race($1),$chr(32),-) %time05
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT06 $replace($mta.race($1),$chr(32),-) %time06
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT07 $replace($mta.race($1),$chr(32),-) %time07
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT08 $replace($mta.race($1),$chr(32),-) %time08
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT09 $replace($mta.race($1),$chr(32),-) %time09
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT10 $replace($mta.race($1),$chr(32),-) %time10
 !writeini " $+ $scriptdir $+ 10times.ini" NICK01 $replace($mta.race($1),$chr(32),-) %nick01
 !writeini " $+ $scriptdir $+ 10times.ini" NICK02 $replace($mta.race($1),$chr(32),-) %nick02
 !writeini " $+ $scriptdir $+ 10times.ini" NICK03 $replace($mta.race($1),$chr(32),-) %nick03
 !writeini " $+ $scriptdir $+ 10times.ini" NICK04 $replace($mta.race($1),$chr(32),-) %nick04
 !writeini " $+ $scriptdir $+ 10times.ini" NICK05 $replace($mta.race($1),$chr(32),-) %nick05
 !writeini " $+ $scriptdir $+ 10times.ini" NICK06 $replace($mta.race($1),$chr(32),-) %nick06
 !writeini " $+ $scriptdir $+ 10times.ini" NICK07 $replace($mta.race($1),$chr(32),-) %nick07
 !writeini " $+ $scriptdir $+ 10times.ini" NICK08 $replace($mta.race($1),$chr(32),-) %nick08
 !writeini " $+ $scriptdir $+ 10times.ini" NICK09 $replace($mta.race($1),$chr(32),-) %nick09
 !writeini " $+ $scriptdir $+ 10times.ini" NICK10 $replace($mta.race($1),$chr(32),-) %nick10
}

Posted

    var %number = $findtok(%nick02 %nick03 %nick04 %nick05 %nick06 %nick07 %nick08 %nick09 %nick10,%nick01,1,32)

what return this function??

is something wrong in my script??

PS. Sorry but I cant wrote this all in one post!!

Posted

thats huge :shock:

I'll let toady sort this one out for ya

be better to rewrite the whole lot tho.

The problem with having 10 names and times, is displaying them

They dont fit in the chat.

Posted

can you only tell mi what this function return (if I wrote this good):

var %number = $findtok(%nick02 %nick03 %nick04 %nick05 %nick06 %nick07 %nick08 %nick09 %nick10,%nick01,1,32)

I want to have position of the same nick as for exp. %nick01

Posted

that working

on *:SIGNAL:mta.finish: {
 var %nick01 = $iif($readini($scriptdir $+ 10times.ini,NICK01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick02 = $iif($readini($scriptdir $+ 10times.ini,NICK02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick03 = $iif($readini($scriptdir $+ 10times.ini,NICK03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick04 = $iif($readini($scriptdir $+ 10times.ini,NICK04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick05 = $iif($readini($scriptdir $+ 10times.ini,NICK05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick06 = $iif($readini($scriptdir $+ 10times.ini,NICK06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick07 = $iif($readini($scriptdir $+ 10times.ini,NICK07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick08 = $iif($readini($scriptdir $+ 10times.ini,NICK08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick09 = $iif($readini($scriptdir $+ 10times.ini,NICK09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick10 = $iif($readini($scriptdir $+ 10times.ini,NICK10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time01 = $iif($readini($scriptdir $+ 10times.ini,TOPT01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time02 = $iif($readini($scriptdir $+ 10times.ini,TOPT02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time03 = $iif($readini($scriptdir $+ 10times.ini,TOPT03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time04 = $iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time05 = $iif($readini($scriptdir $+ 10times.ini,TOPT05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time06 = $iif($readini($scriptdir $+ 10times.ini,TOPT06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time07 = $iif($readini($scriptdir $+ 10times.ini,TOPT07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time08 = $iif($readini($scriptdir $+ 10times.ini,TOPT08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time09 = $iif($readini($scriptdir $+ 10times.ini,TOPT09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time10 = $iif($readini($scriptdir $+ 10times.ini,TOPT10,$replace($mta.race($1),$chr(32),-)),$v1,-1)

 if (%time01 == -1) {
   %time01 = $mta.time($1,$2)
   %nick01 = $mta.nick($1,$2)    
 }
 elseif ($mta.time($1,$2) <= %time01) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = %time02
   %time02 = %time01
   %time01 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = %nick02
   %nick02 = %nick01
   %nick01 = $mta.nick($1,$2)
 }
 elseif ((%time02 == -1) && ($mta.nick($1,$2) != %nick01)) {
   %time02 = $mta.time($1,$2)
   %nick02 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the second time!
 }
 elseif (($mta.time($1,$2) <= %time02) && ($mta.nick($1,$2) != %nick01)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = %time02
   %time02 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = %nick02
   %nick02 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the second time!
 }
 elseif ((%time03 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02)) {
   %time03 = $mta.time($1,$2)
   %nick03 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the third time!
 }
 elseif (($mta.time($1,$2) <= %time03) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the third time!
 }
 elseif ((%time04 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03)) {
   %time04 = $mta.time($1,$2)
   %nick04 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the forth time!
 }
 elseif (($mta.time($1,$2) <= %time04) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the forth time!
 }
 elseif ((%time05 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04)) {
   %time05 = $mta.time($1,$2)
   %nick05 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the fifth time!
 }
 elseif (($mta.time($1,$2) <= %time05) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the fifth time!
 }
 elseif ((%time06 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05)) {
   %time06 = $mta.time($1,$2)
   %nick06 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the sixth time!
 }
 elseif (($mta.time($1,$2) <= %time06) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the sixth time!
 }
 elseif ((%time07 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06)) {
   %time07 = $mta.time($1,$2)
   %nick07 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the seventh time!
 }
 elseif (($mta.time($1,$2) <= %time07) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the seventh time!
 }
 elseif ((%time08 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07)) {
   %time08 = $mta.time($1,$2)
   %nick08 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the eighth time!
 }
 elseif (($mta.time($1,$2) <= %time08) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the eighth time!
 }
 elseif ((%time09 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time09 = $mta.time($1,$2)
   %nick09 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the ninth time!
 }
 elseif (($mta.time($1,$2) <= %time09) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time10 = %time09
   %time09 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the ninth time!
 }
 elseif ((%time10 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08) && ($mta.nick($1,$2) != %nick09)) {
   %time10 = $mta.time($1,$2)
   %nick10 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the tenth time!
 }
 elseif (($mta.time($1,$2) <= %time10) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08) && ($mta.nick($1,$2) != %nick09)) {
   %time10 = $mta.time($1,$2)
   %nick10 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the tenth time!
 }

 !writeini " $+ $scriptdir $+ 10times.ini" TOPT01 $replace($mta.race($1),$chr(32),-) %time01
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT02 $replace($mta.race($1),$chr(32),-) %time02
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT03 $replace($mta.race($1),$chr(32),-) %time03
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT04 $replace($mta.race($1),$chr(32),-) %time04
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT05 $replace($mta.race($1),$chr(32),-) %time05
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT06 $replace($mta.race($1),$chr(32),-) %time06
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT07 $replace($mta.race($1),$chr(32),-) %time07
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT08 $replace($mta.race($1),$chr(32),-) %time08
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT09 $replace($mta.race($1),$chr(32),-) %time09
 !writeini " $+ $scriptdir $+ 10times.ini" TOPT10 $replace($mta.race($1),$chr(32),-) %time10
 !writeini " $+ $scriptdir $+ 10times.ini" NICK01 $replace($mta.race($1),$chr(32),-) %nick01
 !writeini " $+ $scriptdir $+ 10times.ini" NICK02 $replace($mta.race($1),$chr(32),-) %nick02
 !writeini " $+ $scriptdir $+ 10times.ini" NICK03 $replace($mta.race($1),$chr(32),-) %nick03
 !writeini " $+ $scriptdir $+ 10times.ini" NICK04 $replace($mta.race($1),$chr(32),-) %nick04
 !writeini " $+ $scriptdir $+ 10times.ini" NICK05 $replace($mta.race($1),$chr(32),-) %nick05
 !writeini " $+ $scriptdir $+ 10times.ini" NICK06 $replace($mta.race($1),$chr(32),-) %nick06
 !writeini " $+ $scriptdir $+ 10times.ini" NICK07 $replace($mta.race($1),$chr(32),-) %nick07
 !writeini " $+ $scriptdir $+ 10times.ini" NICK08 $replace($mta.race($1),$chr(32),-) %nick08
 !writeini " $+ $scriptdir $+ 10times.ini" NICK09 $replace($mta.race($1),$chr(32),-) %nick09
 !writeini " $+ $scriptdir $+ 10times.ini" NICK10 $replace($mta.race($1),$chr(32),-) %nick10
}

Posted

That working!

on *:SIGNAL:mta.command: { 
 if ((($3 == !10best) || ($3 == !top10)) && (!$4)) {
 var %time01 = $iif($readini($scriptdir $+ 10times.ini,TOPT01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time02 = $iif($readini($scriptdir $+ 10times.ini,TOPT02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %time03 = $iif($readini($scriptdir $+ 10times.ini,TOPT03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick01 = $iif($readini($scriptdir $+ 10times.ini,NICK01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick02 = $iif($readini($scriptdir $+ 10times.ini,NICK02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 var %nick03 = $iif($readini($scriptdir $+ 10times.ini,NICK03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
 %nick01 = $iif(%nick01 > 0, %nick01, n/a)
 %nick02 = $iif(%nick02 > 0, %nick02, n/a)
 %nick03 = $iif(%nick03 > 0, %nick03, n/a)
 if (%time01 > 0) {
   var %time01mins = $int($calc(%time01 / 60000))
   var %time01sec = $int($calc((%time01 - (%time01mins * 60000)) / 1000))
   var %time01ms = $calc((%time01 - (%time01mins * 60000)) - (%time01sec * 1000))
 }
 elseif (%time01 <0> 0) {
   var %time02mins = $int($calc(%time02 / 60000))
   var %time02sec = $int($calc((%time02 - (%time02mins * 60000)) / 1000))
   var %time02ms = $calc((%time02 - (%time02mins * 60000)) - (%time02sec * 1000))
 }
 elseif (%time02 <0> 0) {
   var %time03mins = $int($calc(%time03 / 60000))
   var %time03sec = $int($calc((%time03 - (%time03mins * 60000)) / 1000))
   var %time03ms = $calc((%time03 - (%time03mins * 60000)) - (%time03sec * 1000))
 }
 elseif (%time03 <= 0) var %time03mins = --, %time03sec = --, %time03ms = --
   mta.text $1 Top time's on map $mta.race($1)
   mta.text $1 1. %nick01 - %time01mins min %time01sec sec %time01ms ms
   mta.text $1 2. %nick02 - %time02mins min %time02sec sec %time02ms ms
   mta.text $1 3. %nick03 - %time03mins min %time03sec sec %time03ms ms
   if ($iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,0) > 0) {
     var %time04 = $iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time05 = $iif($readini($scriptdir $+ 10times.ini,TOPT05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time06 = $iif($readini($scriptdir $+ 10times.ini,TOPT06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick04 = $iif($readini($scriptdir $+ 10times.ini,NICK04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick05 = $iif($readini($scriptdir $+ 10times.ini,NICK05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick06 = $iif($readini($scriptdir $+ 10times.ini,NICK06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
             %nick04 = $iif(%nick04 > 0, %nick04, n/a)
             %nick05 = $iif(%nick05 > 0, %nick05, n/a)
             %nick06 = $iif(%nick06 > 0, %nick06, n/a)
     if (%time04 > 0) {
       var %time04mins = $int($calc(%time04 / 60000))
       var %time04sec = $int($calc((%time04 - (%time04mins * 60000)) / 1000))
       var %time04ms = $calc((%time04 - (%time04mins * 60000)) - (%time04sec * 1000))
     }
     elseif (%time04 <0> 0) {
       var %time05mins = $int($calc(%time05 / 60000))
       var %time05sec = $int($calc((%time05 - (%time05mins * 60000)) / 1000))
       var %time05ms = $calc((%time05 - (%time05mins * 60000)) - (%time05sec * 1000))
     }
     elseif (%time05 <0> 0) {
       var %time06mins = $int($calc(%time06 / 60000))
       var %time06sec = $int($calc((%time06 - (%time06mins * 60000)) / 1000))
       var %time06ms = $calc((%time06 - (%time06mins * 60000)) - (%time06sec * 1000))
     }
     elseif (%time06 <0> 0) {
     var %time07 = $iif($readini($scriptdir $+ 10times.ini,TOPT07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time08 = $iif($readini($scriptdir $+ 10times.ini,TOPT08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time09 = $iif($readini($scriptdir $+ 10times.ini,TOPT09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %time10 = $iif($readini($scriptdir $+ 10times.ini,TOPT10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick07 = $iif($readini($scriptdir $+ 10times.ini,NICK07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick08 = $iif($readini($scriptdir $+ 10times.ini,NICK08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick09 = $iif($readini($scriptdir $+ 10times.ini,NICK09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
     var %nick10 = $iif($readini($scriptdir $+ 10times.ini,NICK10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
             %nick07 = $iif(%nick07 > 0, %nick07, n/a)
             %nick08 = $iif(%nick08 > 0, %nick08, n/a)
             %nick09 = $iif(%nick09 > 0, %nick09, n/a)
             %nick10 = $iif(%nick10 > 0, %nick10, n/a)
       if (%time07 > 0) {
         var %time07mins = $int($calc(%time07 / 60000))
         var %time07sec = $int($calc((%time07 - (%time07mins * 60000)) / 1000))
         var %time07ms = $calc((%time07 - (%time07mins * 60000)) - (%time07sec * 1000))
       }
       elseif (%time07 <0> 0) {
         var %time08mins = $int($calc(%time08 / 60000))
         var %time08sec = $int($calc((%time08 - (%time08mins * 60000)) / 1000))
         var %time08ms = $calc((%time08 - (%time08mins * 60000)) - (%time08sec * 1000))
       }
       elseif (%time08 <0> 0) {
         var %time09mins = $int($calc(%time09 / 60000))
         var %time09sec = $int($calc((%time09 - (%time09mins * 60000)) / 1000))
         var %time09ms = $calc((%time09 - (%time09mins * 60000)) - (%time09sec * 1000))
       }
       elseif (%time09 <0> 0) {
         var %time10mins = $int($calc(%time10 / 60000))
         var %time10sec = $int($calc((%time10 - (%time10mins * 60000)) / 1000))
         var %time10ms = $calc((%time10 - (%time10mins * 60000)) - (%time10sec * 1000))
       }
       elseif (%time10 <0>= 7) {
     if (!$4) mta.pm $1 $2 Error - missing parameter!
     elseif ($4 isnum) {
       if ((0 > $4 ) || ($4 > 10)) mta.pm $1 $2 Error - parameter must by a number between 1-10!
       else {
         var %nick01 = $iif($readini($scriptdir $+ 10times.ini,NICK01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick02 = $iif($readini($scriptdir $+ 10times.ini,NICK02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick03 = $iif($readini($scriptdir $+ 10times.ini,NICK03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick04 = $iif($readini($scriptdir $+ 10times.ini,NICK04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick05 = $iif($readini($scriptdir $+ 10times.ini,NICK05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick06 = $iif($readini($scriptdir $+ 10times.ini,NICK06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick07 = $iif($readini($scriptdir $+ 10times.ini,NICK07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick08 = $iif($readini($scriptdir $+ 10times.ini,NICK08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick09 = $iif($readini($scriptdir $+ 10times.ini,NICK09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %nick10 = $iif($readini($scriptdir $+ 10times.ini,NICK10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time01 = $iif($readini($scriptdir $+ 10times.ini,TOPT01,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time02 = $iif($readini($scriptdir $+ 10times.ini,TOPT02,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time03 = $iif($readini($scriptdir $+ 10times.ini,TOPT03,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time04 = $iif($readini($scriptdir $+ 10times.ini,TOPT04,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time05 = $iif($readini($scriptdir $+ 10times.ini,TOPT05,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time06 = $iif($readini($scriptdir $+ 10times.ini,TOPT06,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time07 = $iif($readini($scriptdir $+ 10times.ini,TOPT07,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time08 = $iif($readini($scriptdir $+ 10times.ini,TOPT08,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time09 = $iif($readini($scriptdir $+ 10times.ini,TOPT09,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         var %time10 = $iif($readini($scriptdir $+ 10times.ini,TOPT10,$replace($mta.race($1),$chr(32),-)),$v1,-1)
         if ($4 == 1) {
           %nick01 = %nick02
           %time01 = %time02
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT01 $replace($mta.race($1),$chr(32),-) %time01
           !writeini " $+ $scriptdir $+ 10times.ini" NICK01 $replace($mta.race($1),$chr(32),-) %nick01
         }
         if ($4 <= 2) {
           %nick02 = %nick03
           %time02 = %time03
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT02 $replace($mta.race($1),$chr(32),-) %time02
           !writeini " $+ $scriptdir $+ 10times.ini" NICK02 $replace($mta.race($1),$chr(32),-) %nick02
         }
         if ($4 <= 3) {
           %nick03 = %nick04
           %time03 = %time04
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT03 $replace($mta.race($1),$chr(32),-) %time03
           !writeini " $+ $scriptdir $+ 10times.ini" NICK03 $replace($mta.race($1),$chr(32),-) %nick03
         }
         if ($4 <= 4) {
           %nick04 = %nick05
           %time04 = %time05
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT04 $replace($mta.race($1),$chr(32),-) %time04
           !writeini " $+ $scriptdir $+ 10times.ini" NICK04 $replace($mta.race($1),$chr(32),-) %nick04
         }
         if ($4 <= 5) {
           %nick05 = %nick06
           %time05 = %time06
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT05 $replace($mta.race($1),$chr(32),-) %time05
           !writeini " $+ $scriptdir $+ 10times.ini" NICK05 $replace($mta.race($1),$chr(32),-) %nick05
         }
         if ($4 <= 6) {
           %nick06 = %nick07
           %time06 = %time07
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT06 $replace($mta.race($1),$chr(32),-) %time06
           !writeini " $+ $scriptdir $+ 10times.ini" NICK06 $replace($mta.race($1),$chr(32),-) %nick06
         }
         if ($4 <= 7) {
           %nick07 = %nick08
           %time07 = %time08
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT07 $replace($mta.race($1),$chr(32),-) %time07
           !writeini " $+ $scriptdir $+ 10times.ini" NICK07 $replace($mta.race($1),$chr(32),-) %nick07
         }
         if ($4 <=  {
           %nick08 = %nick09
           %time08 = %time09
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT08 $replace($mta.race($1),$chr(32),-) %time08
           !writeini " $+ $scriptdir $+ 10times.ini" NICK08 $replace($mta.race($1),$chr(32),-) %nick08
         }
         if ($4 <= 9) {
           %nick09 = %nick10
           %time09 = %time10
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT09 $replace($mta.race($1),$chr(32),-) %time09
           !writeini " $+ $scriptdir $+ 10times.ini" NICK09 $replace($mta.race($1),$chr(32),-) %nick09
         }
         if ($4 <= 10) {
           %nick10 = -1
           %time10 = -1
           !writeini " $+ $scriptdir $+ 10times.ini" TOPT10 $replace($mta.race($1),$chr(32),-) %time10
           !writeini " $+ $scriptdir $+ 10times.ini" NICK10 $replace($mta.race($1),$chr(32),-) %nick10 
         }
         mta.pm $1 $2 Time $4 erased!
       }
     }
     else mta.pm $1 $2 Error - parameter must by a number between 1-10!
   }
   else mta.pm $1 $2 Error - You must be level 7 to use this command. 
 }
}

Posted

Please, check:

- alias (I dont know how to use it)

- findtok (I dont know if I use it good)

  elseif ((%time02 == -1) && ($mta.nick($1,$2) != %nick01)) {
   %time02 = $mta.time($1,$2)
   %nick02 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the second time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 1
     find.by.number
   }
 }

;-----------------------------------------------------
;this algorithm say where is the next step
alias find.by.number {
 if (%number == 1) from.2
 if (%number <= 2) from.3
 if (%number <= 3) from.4
 if (%number <= 4) from.5
 if (%number <= 5) from.6
 if (%number <= 6) from.7
 if (%number <= 7) from.8
 if (%number <=  from.9
 if (%number <= 9) from.10
}

;-----------------------------------------------------
;this put up the nick from position where is the double nick
alias from.2 {
 %nick02 = %nick03
 %time02 = %time03
}
alias from.3 {
 %nick03 = %nick04
 %time03 = %time04
}
alias from.4 {
 %nick04 = %nick05
 %time04 = %time05
}
alias from.5 {
 %nick05 = %nick06
 %time05 = %time06
}
alias from.6 {
 %nick06 = %nick07
 %time06 = %time07
}
alias from.7 {
 %nick07 = %nick08
 %time07 = %time08
}
alias from.8 {
 %nick08 = %nick09
 %time08 = %time09
}
alias from.9 {
 %nick09 = %nick10
 %time09 = %time10
}
alias from.10 {
 %nick10 = -1
 %time10 = -1
}

Posted

all script

  if (%time01 == -1) {
   %time01 = $mta.time($1,$2)
   %nick01 = $mta.nick($1,$2)    
 }
 elseif ($mta.time($1,$2)  0) find.by.number
 }
 elseif ((%time02 == -1) && ($mta.nick($1,$2) != %nick01)) {
   %time02 = $mta.time($1,$2)
   %nick02 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the second time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 1
     find.by.number
   }
 }
 elseif ((%time03 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02)) {
   %time03 = $mta.time($1,$2)
   %nick03 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the third time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 2
     find.by.number
   }
 }
 elseif ((%time04 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03)) {
   %time04 = $mta.time($1,$2)
   %nick04 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the forth time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 3
     find.by.number
   }
 }
 elseif ((%time05 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04)) {
   %time05 = $mta.time($1,$2)
   %nick05 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the fifth time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 4
     find.by.number
   }
 }
 elseif ((%time06 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05)) {
   %time06 = $mta.time($1,$2)
   %nick06 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the sixth time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 5
     find.by.number
   }
 }
 elseif ((%time07 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06)) {
   %time07 = $mta.time($1,$2)
   %nick07 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the seventh time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 6
     find.by.number
   }
 }
 elseif ((%time08 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07)) {
   %time08 = $mta.time($1,$2)
   %nick08 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the eighth time!
 }
 elseif (($mta.time($1,$2)  0) { 
     %number = %number + 7
     find.by.number
   }
 }
 elseif ((%time09 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time09 = $mta.time($1,$2)
   %nick09 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the ninth time!
   if (%nick10 == $mta.nick($1,$2)) from.10
 }
 elseif (($mta.time($1,$2) <= %time09) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time10 = %time09
   %time09 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the ninth time!
 }
 elseif ((%time10 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08) && ($mta.nick($1,$2) != %nick09)) {
   %time10 = $mta.time($1,$2)
   %nick10 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the tenth time!
 }
 elseif (($mta.time($1,$2) <= %time10) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08) && ($mta.nick($1,$2) != %nick09)) {
   %time10 = $mta.time($1,$2)
   %nick10 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the tenth time!
 }
;-----------------------------------------------------
;this algorithm say where is the next step
alias find.by.number {
 if (%number == 1) from.2
 if (%number <= 2) from.3
 if (%number <= 3) from.4
 if (%number <= 4) from.5
 if (%number <= 5) from.6
 if (%number <= 6) from.7
 if (%number <= 7) from.8
 if (%number <=  from.9
 if (%number <= 9) from.10
}
;-----------------------------------------------------
;this put up the nick from position where is the double nick
alias from.2 {
 %nick02 = %nick03
 %time02 = %time03
}
alias from.3 {
 %nick03 = %nick04
 %time03 = %time04
}
alias from.4 {
 %nick04 = %nick05
 %time04 = %time05
}
alias from.5 {
 %nick05 = %nick06
 %time05 = %time06
}
alias from.6 {
 %nick06 = %nick07
 %time06 = %time07
}
alias from.7 {
 %nick07 = %nick08
 %time07 = %time08
}
alias from.8 {
 %nick08 = %nick09
 %time08 = %time09
}
alias from.9 {
 %nick09 = %nick10
 %time09 = %time10
}
alias from.10 {
 %nick10 = -1
 %time10 = -1
}

Posted

if u have no idea what ur doing, why dont u start with something easy, like top 3 times, then once u get that working, go to top 5, and so on.

i wouldnt fix this, coz it'd be quicker to make it from scratch.

Posted

You dont wont to help mi with alias ... :booty:

I made it Otherwise :bootyshake:

:wink:

  if (%time01 == -1) {
   %time01 = $mta.time($1,$2)
   %nick01 = $mta.nick($1,$2)    
 }
 elseif ($mta.time($1,$2) <= %time01) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = %time02
   %time02 = %time01
   %time01 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = %nick02
   %nick02 = %nick01
   %nick01 = $mta.nick($1,$2)
 }
 elseif ((%time02 == -1) && ($mta.nick($1,$2) != %nick01)) {
   %time02 = $mta.time($1,$2)
   %nick02 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the second time!
 }
 elseif (($mta.time($1,$2) <= %time02) && ($mta.nick($1,$2) != %nick01)) {
   %time10 = %time09
   %time09 = %time08
   %time08 = %time07
   %time07 = %time06
   %time06 = %time05
   %time05 = %time04
   %time04 = %time03
   %time03 = %time02
   %time02 = $mta.time($1,$2)
   %nick10 = %nick09
   %nick09 = %nick08
   %nick08 = %nick07
   %nick07 = %nick06
   %nick06 = %nick05
   %nick05 = %nick04
   %nick04 = %nick03
   %nick03 = %nick02
   %nick02 = $mta.nick($1,$2)
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) beat the second time!
   var %number = $findtok(%nick02 %nick03 %nick04 %nick05 %nick06 %nick07 %nick08 %nick09 %nick10,$mta.nick($1,$2),1,32)
 }
 elseif ((%time03 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02)) {
   %time03 = $mta.time($1,$2)
   %nick03 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the third time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 1
 }
 elseif ((%time04 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03)) {
   %time04 = $mta.time($1,$2)
   %nick04 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the forth time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 2
 }
 elseif ((%time05 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04)) {
   %time05 = $mta.time($1,$2)
   %nick05 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the fifth time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 3
 }
 elseif ((%time06 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05)) {
   %time06 = $mta.time($1,$2)
   %nick06 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the sixth time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 4
 }
 elseif ((%time07 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06)) {
   %time07 = $mta.time($1,$2)
   %nick07 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the seventh time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 5
 }
 elseif ((%time08 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07)) {
   %time08 = $mta.time($1,$2)
   %nick08 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the eighth time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 6
 }
 elseif ((%time09 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08)) {
   %time09 = $mta.time($1,$2)
   %nick09 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the ninth time!
 }
 elseif (($mta.time($1,$2)  0) %number = %number + 7
 }
 elseif ((%time10 == -1) && ($mta.nick($1,$2) != %nick01) && ($mta.nick($1,$2) != %nick02) && ($mta.nick($1,$2) != %nick03) && ($mta.nick($1,$2) != %nick04) && ($mta.nick($1,$2) != %nick05) && ($mta.nick($1,$2) != %nick06) && ($mta.nick($1,$2) != %nick07) && ($mta.nick($1,$2) != %nick08) && ($mta.nick($1,$2) != %nick09)) {
   %time10 = $mta.time($1,$2)
   %nick10 = $mta.nick($1,$2) 
   !.timer.time.text 1 1 mta.text $1 $mta.nick($1,$2) end race with the tenth time!
   if ((%number > 0) && (%nick10 == $mta.nick($1,$2))) var %number = 9
 }
 elseif (($mta.time($1,$2)  0) {
   if (%number == 1) {
     %nick02 = %nick03
     %time02 = %time03
   }
   if (%number <= 2) {
     %nick03 = %nick04
     %time03 = %time04
   }
   if (%number <= 3) {
     %nick04 = %nick05
     %time04 = %time05
   }
   if (%number <= 4) {
     %nick05 = %nick06
     %time05 = %time06
   }
   if (%number <= 5) {
     %nick06 = %nick07
     %time06 = %time07
   }
   if (%number <= 6) {
     %nick07 = %nick08
     %time07 = %time08
   }
   if (%number <= 7) {
     %nick08 = %nick09
     %time08 = %time09
   }
   if (%number <=  {
     %nick09 = %nick10
     %time09 = %time10
   }
   if (%number <= 9) {
     %nick10 = -1
     %time10 = -1
   }
 }

Posted

well i dont really wanna fix that for u, sorry, it looks terrible :lol:

u have the right idea, but as it stands, it has many things u dont check for. ie: if some1 holds the 8th best time then they set a new time which is 3rd best, ur script wont let them take the place coz they already hold 8th and i dont see u crosschecking. u only check the names. also, u need to compare names and times, in case a player has the best time, then improves on it. ur script wont let this happen.

all in all its a mess. i told u how to start.. try getting it to work with top 3 times, once u can do that, add a few more, and so on.

i dont think anyone could fix that for u, half is missing. :lol: im sure it could be rewritten faster than fixing.

Posted
well i dont really wanna fix that for u, sorry, it looks terrible :lol:

u have the right idea, but as it stands, it has many things u dont check for. ie: if some1 holds the 8th best time then they set a new time which is 3rd best, ur script wont let them take the place coz they already hold 8th and i dont see u crosschecking. u only check the names. also, u need to compare names and times, in case a player has the best time, then improves on it. ur script wont let this happen.

all in all its a mess. i told u how to start.. try getting it to work with top 3 times, once u can do that, add a few more, and so on.

i dont think anyone could fix that for u, half is missing. :lol: im sure it could be rewritten faster than fixing.

yeh, same here, can't even be botherd to read. I imagined a script to look up the first 10 places to be a way smaller

Posted (edited)

yes I know that this can by done eaisler but I don't have time to thinking a lot

this script working:

- replace the time when someone bit rekord

- one person can have only one time (best for him)

Edit:

me mistake I past something and dont chack it ...

I use

[code]

but it has changed code ... :shock:

top10zj1.jpg

Edited by Guest
Posted
yes I know that this can by done eaisler but I don't have time to thinking a lot

this script working:

- replace the time when someone bit rekord

- one person can have only one time (best for him)

well congrats if u finally got it to work. u should think about using while loops this can cut down on size quite a lot, also, if ur going to use an identifier lots of times in an alias, store it as a variable, it wil make the script faster and much neater to read.

if its working, u should post the finished product. in full 8)

Posted

What is the difference between:

  !writeini -n " $+ $scriptdir $+ 10times.ini" NICK10 $replace($mta.race($1),$chr(32),-) %nick10

  !writeini " $+ $scriptdir $+ 10times.ini" NICK10 $replace($mta.race($1),$chr(32),-) %nick10

-n <-- ??

Posted

if u dont use -n, after the ini fills up a bit, u will start to get errors.

in the help files is says 64k, but i got them a lot sooner than that.

If the -n switch is specified, mIRC will attempt to write to the .ini file even if it is larger than 64k.

so ur best to use it if u know the ini is going to grow.

Posted

It working :D but ... yesterday don't save one time ...

why ... ?? :shock:

If someone wont I sent script to e-mail ...

read from file

01readfromfilefy8.jpg

chack mta.time and first time from file

02time01zm6.jpg

chack mta.time and second & third time from file

03time02i03zl8.jpg

chack mta.time and fourth & fifth time from file

04time04i05bh7.jpg

chack mta.time and sisth, seventh, eight & ninght time from file

05time06i09vi4.jpg

chack mta.time and tenth time from file - chack rest rekord by findtok and number

06time10numbermh9.jpg

write to file

07writetofileer2.jpg[/b]

Posted

I know it seems noone is giving u any help here, and im sorry.

i need to mention... i still dont see enough checks for duplicte names, u need to add a lot more :lol: ise can see u do the occasional check but i dont see one for 1st place, on 2nd and 3rd, u only check 1st, etc etc.

the way ur doing ur script, after adding the checks, ur script will be 10 times the size :wink:

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...