Code: Select all
putlog "holm-news.tcl $ver by tw|ster (Stian Holm) loaded ..."
proc holm-pub_news {nick uhost handle channel text} {
global newsfile tellwho newschan
if {(([lsearch -exact [string tolower $newschan] [string tolower $channel]] != -1) || ($newschan == "*"))} {
if {![file exists "$newsfile"]} {
if {$tellwho} {
putserv "PRIVMSG $nick :.:error:. sorry, but i can't find the news file!"
} else {
putserv "NOTICE $nick :.:error:. sorry, but i can't find the news file!"
}
return 0
}
if {![file readable "$newsfile"]} {
if {$tellwho} {
putserv "PRIVMSG $nick :.:error:. sorry, but i'm not allowed to read that file!"
} else {
putserv "NOTICE $nick :.:error:. sorry, but i'm not allowed to read that file!"
}
return 0
}
set news [open "$newsfile" r]
while {![eof $news]} {
set line [gets $news]
if {$tellwho} {
putserv "PRIVMSG $channel :$line"
} else {
putserv "NOTICE $nick :$line"
}
}
close $news
}
Example:
Code: Select all
[04:59:49] -f1sh- ---
[04:59:50] -f1sh- Available Commands:
[04:59:51] -f1sh- !google <text> OR !google <country code> <text> # Desc: Searching in google
[04:59:52] -f1sh- !aq <text> # Desc: Add Quote
[04:59:54] -f1sh- !rq # Desc: Shows a random quote
[04:59:56] -f1sh- !images <image> OR !images <country code> <text> # Desc: Searching in google > images
[04:59:58] -f1sh- !imdb <movie> # Desc: Searching in imdb
[05:00:00] -f1sh- !seen <nick> # Desc: Last seen of nick
[05:00:02] -f1sh- !ip <ip> OR !ip -d <ip> OR !ip -g <ip> OR !ip -h <ip> # Desc: Information for the ip
[05:00:04] -f1sh- !news <text> OR !news <country code> <text> # Desc: Searcing news in google
[05:00:06] -f1sh- !wikipedia <text> OR !wikipedia <country code> <text> # Desc: Searching in wikipedia
[05:00:08] -f1sh- !locate <ip> OR !locate < hostmask> # Desc: Information for the ip or hostmask
[05:00:11] -f1sh- # Country codes example:
[05:00:16] -f1sh- # Greece=gr
[05:00:18] -f1sh- # United Kingdom=uk
[05:00:20] -f1sh- # France=gr
[05:00:24] -f1sh- # End
[05:00:28] -f1sh- ---
And the second tcl is incith-google from speechles. My problem there is that i want to remove this:
Code: Select all
[05:02:21] <@f1sh> 12http://en.wikipedia.org/wiki/Egg (Requested by SoUkSoU)