##### bla bla bla code
text text text text
##### bla bla bla code
text text text text
##### bla bla bla code
text text text text
##### bla bla bla code
text text text text
I have a tcl script:
#**********#
# SETTINGS #
#**********#
# set this to the full location of the news file
set newsfile "scripts/NewsMaker.txt"
# want the answer to come out in notice (0) or privmsg (1)?
set tellwho 0
# what channels do you want the script to work on?
# write "*" to disable.
set newschan "#channel"
#*******#
# BINDS #
#*******#
bind pub - !news holm-pub_news
#************************#
# DO NOT EDIT UNDERNEATH #
#************************#
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 $nick :$line"
} else {
putserv "NOTICE $nick :$line"
}
}
close $news
}
}
I modified the tcl script a bit for my own purposes... but I dont want it to read the full text! I just want it to read the lines with no ###
So, either the script ignores lines that start with #### or...
it reads like "line no, line yes, line no, line yes"
Can you guys help me out?
I know this may seem simple but I am complete newbie....
Greetz and thanks for the page and forum! Really helpfull![/quote]