I'm trying to make a bot that auto unhosts when a chanel goes online. I think I have everything down exept for actually checking the channel.
I want to use the api "https://api.twitch.tv/kraken/streams/username"
to check. If the page displays
Quote:
"_links":{"self":"https://api.twitch.tv/kraken/streams/username","channel":"https://api.twitch.tv/kraken/channels/username"},"stream":null}
i know its offline. Sockets baffle me though, so I'm not sure how to pull this info. My code so far is down below.

Code:
on *:TEXT:!check:#: { 
  /timerCheck1 0 60 check
}

on *:TEXT:!esd:#: {
  /timerCheck1 off
  msg $chan Timer off
}

alias host {
  msg # .host $read(target.txt)
  set %h = 1
}

alias unhost {
  msg # .unhost
  set %h = 0
}

alias justhosted {
set %jht = 1
/timerJht 1 60 set %jht = 0
}

on *:TEXT:!host*:#:{
  .write target.txt $2
  host
  justhosted
}

on *:TEXT:!unhost:#:{
  unhost
}

alias auh {
  if (%host = 1) {
    if (%online = 1) {
      if (%jht = 0) {
        unhost
      }
    }
  }
}

;check will be the alias for checking to see if stream is online, if it is online it will set %onlin to 1.


Any help will be much appreciated.

Last edited by Anubisxhades; 05/11/14 11:59 PM.