Alright, before we get started I'd like to take a minute to say that what I have so far is more than likely a complete mess. So, don't be too harsh. I know I'm not great, that's why I'm on here asking for help :P

Secondly, I'd like to explain the "host" feature a bit and also what I'm looking to do in the end of all of this. So, the /host function is a couple months old on twitch. It basically just let's you have another streamers video up while people are in your chat or stop by your stream. I'm using this for my stream team (Grinders) page as well as a few friends of mine that I'd like to give more exposure to.

In the long run, I'd like the script to check what channels are online and add them to the list of channels to choose from, and when a channel goes offline I'd like it to remove them from the list and if they are currently being hosted by me, to switch to another channel.

So, here's what I have so far...

on *:text:!autohost*:#:{
  if ($nick isop #) {
    if ($2 == on) {
      msg # /me Auto Hosting is now enabled.
        .timerSelect 0 10 msg # searching for a channel to host.
          var %NowHosting $read(NowHosting.txt)
          .timerWho 0 13 msg # /me Now Hosting, %NowHosting
          .timerHost 0 14 msg # /host %NowHosting
    else if ($2 == off) {
      msg # /me Auto Hosting is now disabled.
      .timer 1 2 msg # /unhost
      .timerSelect off
      .timerWho off
      .timerHost off

the timer named "Select" is set to repeat every 10 seconds (so I could test it out)

I'd like for it to reply with "AutoHost is already enabled" and then return if the autohost is on.

Everything here technically "works" but I'd like for it to be a little more advanced in how it goes about checking for channels and such. Also, I'd like for it to start automatically the first time it's turned on (right now it waits for .timerSelect to be triggered the first time which, when all is said and done, I'd like to have set for every 45 minutes [2700 sec] until it's turned off)

Thanks to everyone that helps in advance.


I just realized that %NowHosting is not changing either... idk. Like I said, I'm terrible and any help would be great. If it's not possible that's not a big deal. It would just be a nice feature I suppose.