bind pubm - "% * \\\?\\\?" searchhelp; proc searchtcl {word} { set path "/home/cybex/public_html/tcl/tcl/${word}.htm" set path85 "/home/cybex/public_html/tcl/tcl85/${word}.htm" set path83 "/home/cybex/public_html/tcl/tcl83/${word}.htm" set html "http://tcl.b0rk.de/tcl/${word}.htm" set html85 "http://tcl.b0rk.de/tcl85/${word}.htm" set html83 "http://tcl.b0rk.de/tcl83/${word}.htm" if {[file exist ${path}] && [file readable ${path}] && [file isfile ${path}]} { return $html } \ elseif {[file exist ${path85}] && [file readable ${path85}] && [file isfile ${path85}]} { return $html85 } \ elseif {[file exist ${path83}] && [file readable ${path83}] && [file isfile ${path83}]} { return $html85 } \ else { return "" } } set fh [open "eggcmds.dat" r]; set ::eggcmd [split [read -nonewline $fh] \n]; set fh [open "eggvars.dat" r]; set ::eggvar [split [read -nonewline $fh] \n]; set fh [open "eggbinds.dat" r]; set ::eggbind [split [read -nonewline $fh] \n]; if ![info exist ::wspecial] {set ::wspecial ""} proc searchegg {word} { set url ""; set search $word; set http "http://tcl.b0rk.de/eggdrop/" if {$word=="channel" || $word=="bind" || $word=="\?\?"} { if {$::wspecial == "channel"} {set ::wspecial ""; return "bind \037${http}#bind\037"} if {$::wspecial == "bind"} {set ::wspecial ""; return "bind \037${http}#bind\037"} set ::wspecial $word; set search "" } { switch -exact -- $::wspecial { bind { foreach l $::eggbind { if [string match -nocase "$word" $l] {lappend r "\"bind $word\" \037${http}#a$word\037"; break} } if [info exist r] {set ::wspecial ""; return [join $r " / "]} \ else {set ::wspecial ""; lappend r "\"bind\" \037${http}#bind\037"; set search $word} } channel {set search "$::wspecial $word"} \?\? {} } regsub {\\} $search {\\\\} search; regsub {\[} $search {\[} search; set search [string tolower $search] if {$search!=""} { foreach l $::eggcmd { if [string match -nocase "$search *" $l] {lappend r "\"$search\" \037${http}#$word\037"; break} } foreach l $::eggvar { if [string equal -nocase "$search" $l] {lappend r "globvar \"$search\" \037${http}#$word\037"; break} } foreach l $::eggbind { if [string equal -nocase "$search" $l] {lappend r "\"bind $search\" \037${http}#a$word\037"; break} } } set ::wspecial "" if [info exist r] {return [join $r " / "]} {return ""} }; # if word, end of else body }; # proc proc searchhelp {ni ho ha ch text} { set swords [list]; if {![string match -nocase $ch "#cybex.test"] && ![string match -nocase $ch "#bastis"] && ![string match -nocase $ch "#thommey"] && ![string match -nocase $ch "#tcl.intern"] && ![string match -nocase $ch "#tcl"]} {return} set eggs [list]; set tcls [list]; set nin $ni foreach word $text { regsub {\\} $word {\\\\} words; regsub {\[} $words {\[} words; set words [string tolower $words] if {[lsearch -exact $swords $words]==-1} { lappend swords $word } { continue } set tcl [searchtcl $word]; set egg [searchegg $word] if {$tcl!=""} {putcmdlog "$word $tcl"; lappend tcls "\"$word\" \037$tcl\037"} if {$egg!=""} {lappend eggs $egg} if {[onchan $word $ch]} {set nin $word} }; # foreach set text "" if {[join $tcls " / "]!="" || [join $eggs " / "]!=""} { set text "\002$nin:\002 " if {[join $tcls " / "]!=""} {append text "TCL: [join $tcls " / "] "; if {[join $eggs " / "]!=""} {append text " // "}} if {[join $eggs " / "]!=""} {append text "Eggdrop: [join $eggs " / "] "} putmsg $ch $text }; #if irgendwas da }; # proc