View Single Post
Old 02-09-2006, 01:43   #2 (permalink)
caesar
Member
 
caesar's Avatar
 
Join Date: Dec 2004
Location: Under a rock!
Posts: 116
Rep Power: 33
caesar will become famous soon enough
Default

Code:
bind pub - !search search:pub

proc search:pub {n u h c a} { 
  set a *[string map {" " *} $a]* 
  putserv "PRIVMSG $n :Searching for \002$a\002.." 
  set i 0 
  set f [open "Uploads.log" r] 
  while {[gets $f b]>-1} { 
    if {[string match -nocase $a $b]} { 
      incr i 
      putserv "PRIVMSG $n :\002$i)\002 $b"
    } 
  } 
  close $f 
  if {$i} { 
    putserv "PRIVMSG $n :Search complete.. Found \002$i\002 result[expr {$i==1?"":"s"}].." 
    } { 
    putserv "PRIVMSG $n :Sorry, no matches have been found." 
  } 
}
Foloseste-l ca exemplu.
caesar is offline   Reply With Quote