Code: Select all
bind pub - !dic dictionary1
bind pub - !dic2 dictionary2
proc dictionary1 { nick uhost handle chan arg } {
set arg [string tolower $arg]
if {[string length $arg] == 0} {
putserv "NOTICE $nick :The right command is !trans <word>"
} {
regsub -all {( )} $arg "%20" argu
set urlduprog "http://www.kamus.net/result.php?w=en-usa&q=$argu&submit=Search&e=0"
set trucdebut [http::geturl $urlduprog -timeout 20000]
if {[::http::status $trucdebut] == "timeout"} {
putserv "PRIVMSG $chan : (TimeOut)"
}
set datadehtml [::http::data $trucdebut]
set finishhttp [http::Finish $trucdebut]
regsub -all {(\t)} $datadehtml "" datanya
regsub -all {(\n)} $datanya "" datanya
set nopage [string first "<td class=\"item\" bgcolor=\"#CDCCB1\">" $datanya 0]
set arti [string range $datanya $nopage [expr [string first "</td>" $datanya $nopage] - 1]]
regsub -all {(<.+?>)} $arti "" arti
if {![string first "Search Results" $arti 0]} {
putserv "PRIVMSG $chan :$argu tidak terdapat dalam database"
} else {
putserv "PRIVMSG $chan :Inggris ke Indonesia => $argu = $arti" }
}
}
proc dictionary2 { nick uhost handle chan arg } {
set arg [string tolower $arg]
if {[string length $arg] == 0} {
putserv "NOTICE $nick :Perintah yang benar adalah !arti <kata>"
} {
regsub -all {( )} $arg "%20" argu
set urlduprog "http://www.kamus.net/result.php?w=id-indonesia&q=$argu&&submit=Search&e=0"
set trucdebut [http::geturl $urlduprog -timeout 20000]
if {[::http::status $trucdebut] == "timeout"} {
putserv "PRIVMSG $chan : (TimeOut)"
}
set datadehtml [::http::data $trucdebut]
set finishhttp [http::Finish $trucdebut]
regsub -all {(\t)} $datadehtml "" datanya
regsub -all {(\n)} $datanya "" datanya
set nopage [string first "<td class=\"itembold\" bgcolor=\"#CDCCB1\">" $datanya 0]
set arti [string range $datanya $nopage [expr [string first "</td>" $datanya $nopage] - 1]]
regsub -all {(<.+?>)} $arti "" arti
if {![string first "Search Results" $arti 0]} {
putserv "PRIVMSG $chan :$argu tidak terdapat dalam Kamus"
} else {
putserv "PRIVMSG $chan :Indonesia Ke Inggris => $argu = $arti" }
}
}
can you solved my problem, if i type in the #chanel not shown then result
<ardan> !dic store
<ardantus> Inggris ke Indonesia => store =
<ardan> !dic2 bakar
<ardantus> Indonesia Ke Inggris => bakar =
--------------------------------------------------------------------------[/code]