This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Horoscope help

Help for those learning Tcl or writing their own scripts.
Post Reply
a
albozz
Voice
Posts: 8
Joined: Tue Jul 12, 2016 1:40 pm
Location: Albania
Contact:

Horoscope help

Post by albozz »

Hello i need help to thith hosroscope

Code: Select all

bind pub - !h horoskopi:shqip
package require http
set webi http://top-channel.tv/horoskopi

proc horoskopi:shqip { nick host hand chan text } {
        global webi

        set shenjaUser [lindex $text 0]
        set shenja [string tolower $shenjaUser]

        #NQS nuk shkruan shenjen, por ben vetem !h
        if {$shenja == ""} {
                putserv "NOTICE $nick Komanda eshte shembull: !h dashi"
        }

        #NQS shkruan vetem shenjat e horoskopit
        if {[string match -nocase "dashi" $shenja] || [string match -nocase "demi" $shenja] || [string match -nocase "binjaket" $shenja] ||
                [string match -nocase "gaforrja" $shenja] || [string match -nocase "luani" $shenja] || [string match -nocase "virgjeresha" $shenja] ||
                [string match -nocase "peshorja" $shenja] || [string match -nocase "akrepi" $shenja] || [string match -nocase "shigjetari" $shenja] ||
                [string match -nocase "bricjapi" $shenja] || [string match -nocase "ujori" $shenja] || [string match -nocase "peshqit" $shenja]} {
                
                set c [::http::geturl $webi/[strftime "%d-%m-%Y"]/?shenja=$shenja]
                set l [split [::http::data $c] "\n"]
                ::http::cleanup $c
                set c 0
                
                foreach x $l {
                        incr c
                        switch $c {
                                283 {
                                        putnow "PRIVMSG #opers :$nick \002$shenja\002: [html $x]"
                                }
                        }
                }
        #NQS nuk shkruan shenjat e mesiperme, jepet ky errori
        } else {
                putserv "NOTICE $nick Komanda eshte shembull: !h dashi"
        }
}

proc html { text } {
regsub -all "<p>" $text "" text
regsub -all "</p>" $text "" text
return $text
}
[22:39] (Eggdrop) albozz ujori: <li id="menu-item-18527" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18527"><a href="https://top-channel.tv/artikuj/teknolog ... ji</a></li>[/quote]
Post Reply