egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Kamus.net english indonesian dictionary help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ardantus
Voice


Joined: 09 Apr 2008
Posts: 8

PostPosted: Wed Apr 09, 2008 7:27 pm    Post subject: Kamus.net english indonesian dictionary help Reply with quote

Code:
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]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber