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)
}
}
}
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:
Here is a edit of the original:
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.
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
}
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.
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.
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?
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