ok to check if they are live i would use this json parser script
http://hawkee.com/snippet/10194/then the code you would need would be this:
replace (channel) with the variable that contains the channel you are checking
JSONOpen -u live https://api.twitch.tv/kraken/streams/ $+ (channel) $+ ?nocache= $+ $ticks
if ( $json(live,stream) != $null ) {
set %live on
JSONClose live
}
else {
unset %live
}
The rest of the script should be easy enough for you to figure out. hope i helped