Code: Select all
proc g_mywins {nickname hand idx args} {
  global g_winstats g_pickupchan
           if { [matchattr $idx L] } { 
 if {[llength $g_winstats]==0} {
    putserv "NOTICE $nickname :No Wins yet :)"
    return 0
  }
  set stats $g_winstats
  set results [list ]
  while {[llength $stats]!=0} {
    set match [lindex $stats 0]
    set counter 0
    set temp [list ]
    set temp [linsert $temp end $match]
    while {[lsearch -exact $stats $match]>-1} {
      incr counter
      set pos [lsearch -exact $stats $match]
      set stats [lreplace $stats $pos $pos]
    }
    set temp [linsert $temp end $counter]
    set results [linsert $results end $temp]
  }
  set results [lsort -integer -decreasing -index 1 $results]
  set counter 1
  foreach result $results {
    if { [matchattr $idx G] } {
    set admin0r 1
    } else { 
    set admin0r 0
   }
    if {$nickname == [lindex $result 0]} {
    if {$admin0r == 1} {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Wins.  Status: Admin. 7»14]"
   } else {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Wins. 0,1. Status: 4User0,1. 7»14]"
    }
    }
    incr counter
}
} else {
if {[llength $g_winstats]==0} {
    putserv "NOTICE $nickname :No Wins yet :)"
    return 0
  }
  set stats $g_winstats
  set results [list ]
  while {[llength $stats]!=0} {
    set match [lindex $stats 0]
    set counter 0
    set temp [list ]
    set temp [linsert $temp end $match]
    while {[lsearch -exact $stats $match]>-1} {
      incr counter
      set pos [lsearch -exact $stats $match]
      set stats [lreplace $stats $pos $pos]
    }
    set temp [linsert $temp end $counter]
    set results [linsert $results end $temp]
  }
  set results [lsort -integer -decreasing -index 1 $results]
  set counter 1
  foreach result $results {
    if { [matchattr $idx G] } {
    set admin0r 1
    } else { 
    set admin0r 0
   }
    if {$nickname == [lindex $result 0]} {
    if {$admin0r == 1} {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Wins. Status: Admin. 7»14]"
   } else {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Wins. 0,1. Status: 4User0,1. 7»14]"
    }
    }
    incr counter
       }
}
}<Ultralord> !mywins
-Botnick- [« You (Ultralord) have 2 Wins. . Status: User. »]
2nd part:
Code: Select all
proc g_myloses {nickname hand idx args} {
  global g_losestats g_pickupchan
           if { [matchattr $idx L] } { 
 if {[llength $g_losestats]==0} {
    putserv "NOTICE $nickname :No Looses yet :)"
    return 0
  }
  set stats $g_losestats
  set results [list ]
  while {[llength $stats]!=0} {
    set match [lindex $stats 0]
    set counter 0
    set temp [list ]
    set temp [linsert $temp end $match]
    while {[lsearch -exact $stats $match]>-1} {
      incr counter
      set pos [lsearch -exact $stats $match]
      set stats [lreplace $stats $pos $pos]
    }
    set temp [linsert $temp end $counter]
    set results [linsert $results end $temp]
  }
  set results [lsort -integer -decreasing -index 1 $results]
  set counter 1
  #  putquick "NOTICE $nickname :1,0«1,15«1,14«0,1  Top 10 gather players. 1,14»1,15»1,0»"
  foreach result $results {
    if { [matchattr $idx G] } {
    set admin0r 1
    } else { 
    set admin0r 0
   }
    if {$nickname == [lindex $result 0]} {
    if {$admin0r == 1} {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Looses. Status: Admin. 7»14]"
   } else {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Looses. 0,1. Status: 4User0,1. 7»14]"
    }
    }
    incr counter
}
} else {
if {[llength $g_losestats]==0} {
    putserv "NOTICE $nickname :No Looses yet :)"
    return 0
  }
  set stats $g_losestats
  set results [list ]
  while {[llength $stats]!=0} {
    set match [lindex $stats 0]
    set counter 0
    set temp [list ]
    set temp [linsert $temp end $match]
    while {[lsearch -exact $stats $match]>-1} {
      incr counter
      set pos [lsearch -exact $stats $match]
      set stats [lreplace $stats $pos $pos]
    }
    set temp [linsert $temp end $counter]
    set results [linsert $results end $temp]
  }
  set results [lsort -integer -decreasing -index 1 $results]
  set counter 1
  #  putquick "NOTICE $nickname :1,0«1,15«1,14«0,1  Top 10 gather players. 1,14»1,15»1,0»"
  foreach result $results {
    if { [matchattr $idx G] } {
    set admin0r 1
    } else { 
    set admin0r 0
   }
    if {$nickname == [lindex $result 0]} {
    if {$admin0r == 1} {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Looses. Status: Admin. 7»14]"
   } else {
    putquick "NOTICE $nickname :14,1\[9«4 You ([lindex $result 0]) have [lindex $result 1] Looses. 0,1. Status: 4User0,1. 7»14]"
    }
    }
    incr counter
       }
}
}
<Ultralord> !mylooses
-Botnick- [« You (Ultralord) have 4 Looses. . Status: User. »]
the winstats.txt and losestats.txt is .txt files with names inside
example: ( You (Ultralord) have 2 Wins ( my nick is two times on winstats.txt file ) and same with losestats.txt..
i want to make divide the stats like 4/2 with this stats and if the result of divide is more than 5 then the bot gives one flag +V on specific user with that stat..
if this help's:
i add points wins with that proc:
Code: Select all
proc g_addwinstats { nick uhost handle arg } {
global g_winstats g_winplayer g_winplayerstats
set g_winplayer [lindex $arg 0]
set g_winstats [linsert $g_winstats end $g_winplayer]
      set fileio [open /home/ultralord/www/dota/g_winstats.txt "w"]
      puts $fileio $g_winstats
      flush $fileio
      close $fileio
putquick "PRIVMSG $nick :14,1\[9«4 Mr. $g_winplayer : Added on WIN list 7»14]"
}plz someone help me with that..and if he goes well i pay some money.. i need it to work..
thanks !!


 
 


 but i tell you this i same example. I see you want all. Only insert this
 but i tell you this i same example. I see you want all. Only insert this
