i want search a source code after a string like "color=#FF0000>• ". When this string is found the bot should post THIS line (the whole) AND THE NEXT TWO LINES to a channel.
(This string is in the source code about 3-6 times)
bind pub - !test pub:econD
proc pub:econD {nick host handle chan text} {
set tok [http::geturl http://www.url.com]
set data [http::data $tok]
set var "color=#FF0000>• "
set x 0
foreach creature [split $data \n] {
if [string match *${creature}* $var] {set x 1}
if {$x > 0 && $x <= 3} {incr x
puthelp "PRIVMSG $chan : $creature"
}
}
}
But this code outputs the whole source code not only the 3 lines when "color=#FF0000>• " were found