while {[gets $sock html] >= "0"} {
if {[string match -nocase "*<tr valign=top*>*" $html] == "1"} {
set x "0"
set line ""
set color "$html"
} elseif {[string match -nocase "*<td nowrap>*" $html] == "1"} {
set line "${line}[lrange [gets $sock] 0 1] "
if {[incr x] >= "2"} {
gets $sock html
gets $sock html
while {[gets $sock html] >= "0"
[string match -nocase "*>Forecast<*" $html] == "0"} {
if {[string match -nocase "*<br>*" $html] == "1" || [string match -nocase "*</td>*" $html] == "1"} {
regexp {.html">(.+)</a>} $html match html
regexp {(.+)<br>} $html match html
regexp {(.+) </td>} $html match html
set line "${line} ${html}."
}
}
nextmatch:line $nick $color $line
}
}
}
I think here is the error, can you check what could possibily be wrong in that code, something here is missing:
Also a hint, the decoding done by KrzychuG in your other thread is flawed, and will cause this error.
Doing a proper decoding would reveal that the conditionals "[gets $sock html] >= 0" and "[string match -nocase "*>Forecast<*" $html] == 0" should be combined using logical AND (&&), creating a proper if-clause.
Also a hint, the decoding done by KrzychuG in your other thread is flawed, and will cause this error.
Doing a proper decoding would reveal that the conditionals "[gets $sock html] >= 0" and "[string match -nocase "*>Forecast<*" $html] == 0" should be combined using logical AND (&&), creating a proper if-clause.
Thanks alot nml for pointing the mistake out I have now modified my script but I got some errors take a look please:
while {[gets $sock html] >= "0"} {
if {[string match -nocase "*<tr valign=top*>*" $html] == "1"} {
set x "0"
set line ""
set color "$html"
} elseif {[string match -nocase "*<td nowrap>*" $html] == "1"} {
set line "${line}[lrange [gets $sock] 3 4] "
if {[incr x] >= "2"} {
gets $sock html
gets $sock html
while {[gets $sock html] >= "0"} {
if {[string match -nocase "*>Forecast<*" $html] == "0"} {
if {[string match -nocase "*<br>*" $html] == "1" || [string match -nocase "*</td>*" $html] == "1"} {
regexp {.html">(.+)</a>} $html match html
regexp {(.+)<br>} $html match html
regexp {(.+) </td>} $html match html
set line "${line} ${html}."
}
}
nextmatch:line $nick $color $line
}
}
}
}
[23:07] <Cricket`-> Forthcoming Live Coverage
[23:07] <Cricket`-> Date Time Match
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>. </td>. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>. </td>. </td>. Dolphins v Titans at Durban.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>. </td>. </td>. Dolphins v Titans at Durban. SuperSport Series.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>. </td>. </td>. Dolphins v Titans at Durban. SuperSport Series. </td>.
[23:07] <Cricket`-> 17</span> India v Australia at Mumbai. 7th ODI. </td>. </td>. </td>. Pakistan v South Africa at Lahore. 1st ODI. </td>. </td>. </td>. Dolphins v Titans at Durban. SuperSport Series. </td>. </td>.
[00:38] <Cricket`-> Forthcoming Live Coverage
[00:38] <Cricket`-> Date Time Match
[00:38] <Cricket`-> <span style=\"vertical-align: 06:30 GMT Namibia v Canada at Windhoek. ICC Intercontinental Cup.
[00:38] <Cricket`-> <span style=\"vertical-align: 08:00 GMT Border v South Western Districts at East London. SAA Provincial Three-Day Challenge.
[00:38] <Cricket`-> <span style=\"vertical-align: 08:00 GMT Eastern Province v Western Province at Port Elizabeth. SAA Provincial Three-Day Challenge.
[00:38] <Cricket`-> <span style=\"vertical-align: 08:00 GMT Gauteng v Free State at Dobsonville. SAA Provincial Three-Day Challenge.
[00:38] <Cricket`-> <span style=\"vertical-align: 08:00 GMT North West v Easterns at Potchefstroom. SAA Provincial Three-Day Challenge.
[00:38] <Cricket`-> <span style=\"vertical-align: 08:30 GMT South African Invitation XI v New Zealanders at Bloemfontein. Tour Match.
[00:38] <Cricket`-> <span style=\"vertical-align: 08:30 GMT Pakistan v South Africa at Multan. 4th ODI.
[00:38] <Cricket`-> <span style=\"vertical-align: 09:00 GMT India Red v India Green at Ahmedabad. NKP Salve Challenger Trophy.
[00:39] <Cricket`-> <span style=\"vertical-align: 06:30 GMT Kenya v Bermuda at Nairobi (Gym).
[00:39] <Cricket`-> <span style=\"vertical-align: 06:00 GMT Pakistan v South Africa at Lahore. 5th ODI.
[00:39] <Cricket`-> <span style=\"vertical-align: 08:00 GMT Griqualand West v North West at Kimberley. SAA Provincial Three-Day Challenge.
[00:39] <Cricket`-> <span style=\"vertical-align: 08:00 GMT Northerns v Free State at Centurion. SAA Provincial Three-Day Challenge.
[00:39] <Cricket`-> <span style=\"vertical-align: 08:30 GMT South Africa A v New Zealanders at Potchefstroom. Tour Match.
[00:39] <Cricket`-> Current Date: Fri, 26 Oct 2007 12:38:46
You see it's not showing date in the first place but showing: