TVRage 10-Minute-Prior Quick Schedule Announcer

By Jethro on May 23, 2010

Due to responses I've received from other people, I've decided to remove the feature of reporting every single show to the channel or pm.

This script is mainly with the feature of announcing the shows that are about to be aired 10 minutes ahead of time if enabled via popups menu.

Thanks Firstmate for the contribution with the time conversion bit of code.

Update - I have made both on and off switch optionally, meaning you can either enable the switch again to overwrite the existing info or just switch it off. This also prevents a timer error caused by orphaned timers if any.

Update - Thanks to a user beni who found a bug that will result the script to pull the info for a week's worth of TV show schedules, if the months end in 31 or 30 that follow with a new month. I've corrected this matter.

alias -l setautofiles {
  if $isfile(autotimetoday.txt) { 
    var %x 1 | while ($read(autotimetoday.txt,%x)) { $+(.timer,$v1) off | inc %x }
  }
  if $isfile(autotimetoday.txt) { 
    echo 4 -a * Auto 10-Minute-Prior TV Show Announcer Has Been Turned On!
    var %x 1 | while ($read(autotimetoday.txt,%x)) {
      $+(.timer,$v1) $v1 1 1 .play $+(-t,$v1) # autoshowtoday.txt
      inc %x
    } 
  }
}
on *:sockopen:tvqauto:{
  var %tvqauto sockwrite -n tvqauto
  %tvqauto GET /quickschedule.php HTTP/1.1 
  %tvqauto Host: www.tvrage.com
  %tvqauto $crlf
}
on *:sockread:tvqauto:{
  var %tvqinfoauto | sockread %tvqinfoauto
  if $regex(%tvqinfoauto,/\[TIME\](.*)\[\/TIME\]/i) { 
    var %time $asctime($calc($ctime($date $regml(1)) - 600),HH:nn)
    write autoshowtoday.txt $+([,%time,])
    write autotimetoday.txt %time
  }
  elseif $regex(%tvqinfoauto,/\[SHOW\](.*)\[\/SHOW\]/i) {
    write autoshowtoday.txt *** TV Show(s) Airing in 10 Minutes:
    write autoshowtoday.txt $replace($regml(1),$chr(94),$+($chr(32),<>,$chr(32)))
  }
  elseif $regex(%tvqinfoauto,/\[DAY\](.*)\[\/DAY\]/i) {
    write autoshowtoday.txt $regml(1) 
    write $+(-d,$lines(autoshowtoday.txt)) autoshowtoday.txt
    if (($date(dd) = 30 && $chr(44) 31 !isin %xauto)) { set %xauto , 01 }
    $iif(%xauto isin %tvqinfoauto,sockclose tvqauto) 
  }
}
menu * {
  -
  Enable Auto Announcer {
    $iif($isfile(autotimetoday.txt),write -c autotimetoday.txt)
    $iif($isfile(autoshowtoday.txt),write -c autoshowtoday.txt)
    sock $+ $iif($sock(tvqauto),close,open) tvqauto www.tvrage.com 80
    if ($date(dd) = 31) set -u5 %xauto , 01
    else {
      set -u5 %xauto $right($date(dd),1) 
      set -u5 %xauto $+($left($date(mm),1),$calc(%xauto +1))
      .timerxauto 1 1 setautofiles
    }
  }
  Disable Auto Announcer {
    if $isfile(autotimetoday.txt) { 
      echo 4 -a * Auto Announcer Has Been Switched Off!
      var %x 1 | while ($read(autotimetoday.txt,%x)) { 
        $+(.timer,$v1) off | inc %x
      }
      $iif($isfile(autoshowtoday.txt),.remove autoshowtoday.txt)
      $iif($isfile(autotimetoday.txt),.remove autotimetoday.txt)
    }
  } 
}

Comments

Sign in to comment.
MashhitDK   -  Oct 29, 2011

The edited script posted should work if it creates the files...
Not sure if it's a version problem... but it will not "work" / announce anything besides 10 minutes before show(s) airs

Also you should note that times will be jacked if the bot time isn't GMT-5 ( and even their some times will be of.. like UK and Aussie shows )

EDiT:
Just tested and working here... ( Running mIRC Version. 6.35 )
How-2:

  1. ( In the channel you wanna activate it for ) Right click ( to get menu )
  2. Click Enable Auto Announcer to enable it...After a few secs ( depending on your setup ) it will echo Auto 10-Minute-Prior TV Show Announcer Has Been Turned On!
  3. Enjoy / Wait for it... ;D
 Respond  
jasonh   -  Oct 29, 2011

any clue on how to get this working? not working for me at all. i created the files [autoshowtoday.txt],etc as well

using mirc v7.19

 Respond  
Jethro   -  Oct 24, 2011

Keep up the good work, MashhitDK.

 Respond  
MashhitDK   -  Oct 24, 2011

Here is a edit of the original:
Image
Pastebin

alias -l setautofiles {
  if $isfile(AutoTimeToday.txt) { var %x 1 | while ($read(AutoTimeToday.txt,%x)) { $+(.timer,$v1) off | inc %x } }
  if $isfile(AutoTimeToday.txt) {  echo 4 -a * Auto 10-Minute-Prior TV Show Announcer Has Been Turned On!
    var %x 1 | while ($read(AutoTimeToday.txt,%x)) { $+(.timer,$v1) $v1 1 1 .play $+(-t,$v1) # AutoShowToday.txt | inc %x } 
  }
}
;**********************************************************************************************************************************
on *:sockopen:tvqauto:{
  var %tvqauto sockwrite -n tvqauto
  %tvqauto GET /tools/quickschedule.php HTTP/1.1
  %tvqauto Host: services.tvrage.com
  %tvqauto $crlf
}
;**********************************************************************************************************************************
on *:sockread:tvqauto:{ var %tvqinfoauto | sockread %tvqinfoauto
  ;**********************************************************************************************************************************
  if $regex(%tvqinfoauto,/\[TIME\](.*)\[\/TIME\]/i) { set -u7 %sTiME $asctime($ctime($date $regml(1)),HH:nn)
    var %time $asctime($calc($ctime($date $regml(1)) - 600),HH:nn)
    write AutoShowToday.txt $+([,%time,])
    write AutoShowToday.txt 5Airing in the next 10 minutes ->
    write AutoTimeToday.txt %time
  }
  ;**********************************************************************************************************************************
  elseif $regex(%tvqinfoauto,/\[SHOW\](.*)\[\/SHOW\]/i) {
    ;**********************************************************************************************************************************
    set -u3 %tvqinfoauto_NetW $remove($mid(%tvqinfoauto,$pos(%tvqinfoauto,]),$calc($pos(%tvqinfoauto,^,1) -$pos(%tvqinfoauto,],1))),])
    set -u3 %tvqinfoauto_TiTLE $remove($mid(%tvqinfoauto,$pos(%tvqinfoauto,^,1),$calc($pos(%tvqinfoauto,^,2) -$pos(%tvqinfoauto,^,1))),^)
    set -u3 %tvqinfoauto_EP $remove($mid(%tvqinfoauto,$pos(%tvqinfoauto,^,2),$calc($pos(%tvqinfoauto,^,3) -$pos(%tvqinfoauto,^,2))),^)
    set -u3 %tvqinfoauto_LiNK $remove($mid(%tvqinfoauto,$pos(%tvqinfoauto,^,3),$calc($pos(%tvqinfoauto,[,2) -$pos(%tvqinfoauto,^,3))),^)
    ;**********************************************************************************************************************************
    ;*** Output / How it spits out the iNFO
    set -u3 %tvqinfoauto_SHOW $iif(%sTiME,$+(4,[14,$v1,4])) $+(15,%tvqinfoauto_TiTLE,) 14-4#14- $+(14,$replace(%tvqinfoauto_EP,x,15x14),) 14-4#14- $+(8,%tvqinfoauto_NetW,) $+(,$chr(40),2,%tvqinfoauto_LiNK,,$chr(41),)
    ;**********************************************************************************************************************************
    write AutoShowToday.txt %tvqinfoauto_SHOW
  }
  ;**********************************************************************************************************************************
  elseif $regex(%tvqinfoauto,/\[DAY\](.*)\[\/DAY\]/i) { write AutoShowToday.txt $regml(1) 
    write $+(-d,$lines(AutoShowToday.txt)) AutoShowToday.txt
    if (($date(dd) = 30 && $chr(44) 31 !isin %xauto)) { set %xauto , 01 }
    $iif(%xauto isin %tvqinfoauto,sockclose tvqauto) 
  }
  ;**********************************************************************************************************************************
}
menu * {
  -
  Enable Auto Announcer {
    $iif($isfile(AutoTimeToday.txt),write -c AutoTimeToday.txt)
    $iif($isfile(AutoShowToday.txt),write -c AutoShowToday.txt)
    sock $+ $iif($sock(tvqauto),close,open) tvqauto services.tvrage.com 80
    if ($date(dd) = 31) set -u5 %xauto , 01
    else {
      set -u5 %xauto $right($date(dd),1) 
      set -u5 %xauto $+($left($date(mm),1),$calc(%xauto +1))
      .timerxauto 1 1 setautofiles
    }
  }
  Disable Auto Announcer {
    if $isfile(AutoTimeToday.txt) { echo 4 -a * Auto Announcer Has Been Switched Off!
      var %x 1 | while ($read(AutoTimeToday.txt,%x)) { $+(.timer,$v1) off | inc %x }
      $iif($isfile(AutoShowToday.txt),.remove AutoShowToday.txt)
      $iif($isfile(AutoTimeToday.txt),.remove AutoTimeToday.txt)
    }
  }
  -
}

Changed the output a bit as you can see.

EDIT:
Hehe... had forgot to change the links under sockopen in the first one I posted.
But it's fixed now... same goes with the pastebin.

 Respond  
jasonh   -  Oct 23, 2011

 Respond  
MashhitDK   -  Sep 04, 2011

BiG THANKs \o/

Finally got it working here...

 Respond  
beni   -  Jul 04, 2011

You can check if it works. Just right click in a channel and enable it.

Check your mirc folder for one of the 3 files it creates, or you can also check by using /timers and see if it makes any timers.

 Respond  
MashhitDK   -  Jul 04, 2011

Spanks for the reply Beni.... much appreciated... ooO( Tried Myself but failed... :P )

Gonna report in if this works... ooO( But might be a while before anything airs )

 Respond  
beni   -  Jul 03, 2011

The script works fine if you change it to the new link.

replace this

sock $+ $iif($sock(tvqauto),close,open) tvqauto www.tvrage.com 80

to this:

sock $+ $iif($sock(tvqauto),close,open) tvqauto services.tvrage.com 80

and replace this:

on *:sockopen:tvqauto:{
  var %tvqauto sockwrite -n tvqauto
  %tvqauto GET /quickschedule.php HTTP/1.1 
  %tvqauto Host: www.tvrage.com
  %tvqauto $crlf
}

to this:

on *:sockopen:tvqauto:{
  var %tvqauto sockwrite -n tvqauto
  %tvqauto GET /tools/quickschedule.php HTTP/1.1 
  %tvqauto Host: services.tvrage.com
  %tvqauto $crlf
}
 Respond  
MashhitDK   -  Jul 03, 2011

Any fix for this ? / Anyone got a working version of this ?

 Respond  
MashhitDK   -  May 27, 2011

Thanks for the quick respond...
and I tried changing the link in the script and that isn't working for Me ooO( But I might be doing it wrong )

EDiT:
So I'm not the only one who can't get it working with the link posted above, or... ?

 Respond  
beni   -  May 27, 2011
Jethro   -  May 27, 2011

MashhitDK, I think they have a website revamp recently. The URL has been removed. When I checked it, I got a page saying, "Opps, I can't find what you're looking for."

 Respond  
MashhitDK   -  May 27, 2011

This isn't working here... is it just Me that's having problems... or ?

 Respond  
imzadi   -  Nov 04, 2010

Love the script, was just wondering if it would be possible to add some coding to change time zones?
or would that need to be done from the tvrage.mrc end?

sorry, I dont script, so hence the (probable) silly question :P

thanks again :)

 Respond  
Jethro   -  May 31, 2010

I updated the script to correct a bug reported to me by a user named beni. The bug is mentioned in my description above.

 Respond  
Jethro   -  May 28, 2010

I have updated and made both on and off switch optionally, meaning you can either enable the switch again to overwrite the existing info or just switch it off. This also prevents a timer error caused by orphaned timers if any.

I also forgot to make an increment for the %x in the while loop under the switch, causing it to have one timer to be turned off only. That has been corrected.

 Respond  
henbone11   -  May 28, 2010

its awesome Jethro_. thanks again.

 Respond  
StonaJakey   -  May 28, 2010

thanks jethro_ this script is awesome! one thing im still not sure on...i can only make it one color so i cant make individual things different colors? like the show name, the time and those things? sorry for so many questions, but im just trying to make it POP in the my channel.

 Respond  
joelp53   -  May 27, 2010

Ahh i see now nice ::)

 Respond  
Jethro   -  May 27, 2010

joelp53, this bit of code is where you add the color codes:> write autoshowtoday.txt $replace($regml(1),$chr(94),$+($chr(32),<>,$chr(32))) Let's say you want to make it red, then you could do:

write autoshowtoday.txt $+($chr(3),04,$replace($regml(1),$chr(94),$+($chr(32),<>,$chr(32))))

This should come out red in the show report.

 Respond  
joelp53   -  May 27, 2010

lol wasn't that like 5 lines you had to edit, I think it is fine how it is TBH Jethro_ very nice script.

Just wondering though where i would add color codes to make it post as color OFC :-)

 Respond  
Jethro   -  May 27, 2010

henbone11 and StonaJakey, I've managed to make the output come out like this horizontally in one line:> Bravo<>The Real Housewives of New York City<>03x13 TLC<>Mall Cops<>01x02 Playboy TV<>Dropout Delinquents<>01x08 History Channel<>Sliced<>01x11 MTV<>The Dudesons in America<>01x04 VH1<>The OCD Project<>01x01 WE<>20/20 Medical Mysteries<>01x02Can you two live with that?

 Respond  
henbone11   -  May 27, 2010

im pretty sure the color codes would go on the "write autoshowtoday.txt" lines, but how to implement them...im not sure.

 Respond  
StonaJakey   -  May 27, 2010

i like the idea above a lot!
what i mean by channel name is the TV channel name, so i want to make the tv channels one color, the brackets another, show names a dif color and so on.... where would i put the color codes?

 Respond  
henbone11   -  May 27, 2010

Jethro_, everything works great, and thanks again for making this. Is there any way to condense the output a little? Instead of each show on its own line? I know that you did it this way to prevent flooding, but is there a way to set a character limit per output until the schedule has been announced?

An example of the output is:

[19:50.10]-(Bot): Airing in 10 minutes: A&E - First 48 10x08 <> CBS - CSI: Crime Scene Investigation 10x15 <> ABC - Grey's Anatomy 06x17 <> NBC - The Office 06x17 <> Bravo - The Real Housewives Of Orange County 05x17 <> FOX - Kitchen Nightmares 03x07 <> truTV - The Smoking Gun Presents: World's Dumbest 06x22 <> TLC - Police
[19:50.10]-(Bot): Women of Maricopa 02x03 <> History Channel - Food Tech 01x07 <> Discovery Channel - Surviving Death 01x02

 Respond  
Jethro   -  May 25, 2010

What do you mean by channel names?
Yes, you can add color codes to the show name. What color do you want it to be?

 Respond  
StonaJakey   -  May 25, 2010

just out of curiosity where would i place the color codes to change colors for the channel names and the show names...?

 Respond  
Jethro   -  May 25, 2010

Firstmate, I thought I would clean up the comment section a bit, as I've converted this script into just a 10-minute TV show announcer. I did mention you in the description for the helpful contribution. :-)> Thanks Firstmate for the contribution with the time conversion bit of code.

 Respond  
Firstmate   -  May 25, 2010

Deleting posts is never cool =(

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.