TVRage

By SRU on May 25, 2012

Image
[size=14]TVRage[/size]

  • Will work in any channel the BOT is OP'eD on...
  • It's written ( and working ) in mIRC Ver. 6.35
  • Works on !SHOW, !TODAY, !TOMORROW, !TV, !EP + !N & !L as in !NEXT & !LAST
    and will pull "plot" and/or "summary" when checking a specific EP or SHOW (See Screenshots below)

[size=14]Screenshots[/size]
!TV "SHOW"
Image
!TV "SHOW" "SxE"
Image
!Last & !Next "SHOW"
Image
!TV "SHOW" (Preview)
Image
!SHOW "SHOW"
Image
!TODAY
Image
Schedule
Image

[size=14]NOTE:[/size]
As you might be able to see I've used TVRage Addon (<www.mirc.net/projects.php?go=1204694830>) by @Gecko321
And would like the time to say; thanks for sharing... I really appreciate it... and I know I'm the only one who have enjoyed your script <3
Would also like to thanks @hxck - I've "ripped" a bit from your script (http://www.hawkee.com/snippet/8822)
Also using BetterDuration and Text Overflow Limiting in this script... both added but neither originally made by Me...
Again... thanks for sharing <3 I really appreciate it

[size=14]Install[/size]

  1. ALT+R ( - in mIRC / Goto Remote )
  2. Copy and paste the code below ( into a new file unless you know what you are doing )
  3. Run setup... simply right click in a channel to get the menu (See pic below)
  4. Enjoy ?

[size=14]Setup[/size]
Image
Image

  • If you find any problems... let Me know and I'll get right on it ;)

[size=14]Update(s):[/size]
Added input event so it will work on the host (/BOT) running the script.
Fixed a "small" error that made the script search on !NEXT / !LAST every time you did a !/@/. CMD that started with N / L
Added a "fix" for when site is down... will now show you site is down instead of just doing noting.
Fixed trigger "error" to show the trigger used instead of ! no mater what.

;****
If you are... A fellow stoner... Danish... Cultivator... Crazy about weed...
Got any pictures of your own strain / lovely females...
Got free weed... Want to chill... Wanna hang out...
Found bugs... Need help with one of My script...

The most advanced TVRage script out there for mIRC...

;*** TVRage - "Original" code by Gecko321 (www.mirc.net/projects.php?go=1204694830) *** SRU EDiT - Downloaded from: http://www.hawkee.com/snippet/9506/
on *:LOAD:dialog -m TVSettings TVSettings -4
on *:UNLOAD:.unset %TV_*
menu Channel,Status,Menubar,Query {
  -
  $iif(%TV_Rage = 1,$style(1)) TVRage $+($chr(40),$iif(%TV_Rage = 1,Enabled,Disabled),$chr(41))
  .Settings:dialog -m TVSettings TVSettings -4
  .Self Search:dialog -m SelfSearch SelfSearch -4
  .-
  .Turn $iif(%TV_Rage != 1,on,off) :$iif(%TV_Rage != 1,%TV_Rage = 1,%TV_Rage = 0) | $iif(!%TV_Where,%TV_Where = 1) | $iif(!%TV_Where2,%TV_Where2 = 0) | $iif(!%TV_Color,%TV_Color = 1) | echo -at 14TVRage Has been $iif(%TV_Rage = 1,9enabled,4disabled)
  -
}
on @*:TEXT:*:#: { if ($left($strip($1),1) == !) || ($left($strip($1),1) == .) || ($left($strip($1),1) == @) && (($mid($strip($1),2,4) == SHOW && $len($strip($1)) == 5) || ($mid($strip($1),2,5) == TODAY && $len($strip($1)) == 6) || ($mid($strip($1),2,8) == TOMORROW && $len($strip($1)) == 9) || ($mid($strip($1),2,2) == TV && $len($strip($1)) == 3) || ($mid($strip($1),2,2) == EP && $len($strip($1)) == 3) || ($mid($strip($1),2,1) == N && $len($strip($1)) == 2) || ($mid($strip($1),2,4) == Next && $len($strip($1)) == 5) || ($mid($strip($1),2,1) == L && $len($strip($1)) == 2) || ($mid($strip($1),2,4) == Last && $len($strip($1)) == 5)) && (!$timer($+(SPAM,$network,$nick))) { .timer $+ $+(SPAM,$network,$nick) 1 3 noop | mTVRage $strip($1-) } }
on @*:INPUT:#: {
  if ($left($strip($1),1) == !) || ($left($strip($1),1) == .) || ($left($strip($1),1) == @) && (($mid($strip($1),2,4) == SHOW && $len($strip($1)) == 5) || ($mid($strip($1),2,5) == TODAY && $len($strip($1)) == 6) || ($mid($strip($1),2,8) == TOMORROW && $len($strip($1)) == 9) || ($mid($strip($1),2,2) == TV && $len($strip($1)) == 3) || ($mid($strip($1),2,2) == EP && $len($strip($1)) == 3) || ($mid($strip($1),2,1) == N && $len($strip($1)) == 2) || ($mid($strip($1),2,1) == L && $len($strip($1)) == 2)) && (%TV_Rage == 1) { var %num = $trnum
    if ($2 = Schedule) { set %TVRage_Target. [ $+ [ %num ] ] $iif(%TV_Where2 = 1,$me,$Target) }
    elseif ($Target !ischan) { set %TVRage_Target. [ $+ [ %num ] ] $me | set %TVRage_Query. [ $+ [ %num ] ] 1 }
    else { set %TVRage_Target. [ $+ [ %num ] ] $iif(%TV_Where = 1,$Target,$me) }
    set %TVRage_Chan. [ $+ [ %num ] ] $chan | set %TVRage_Nick. [ $+ [ %num ] ] $me
    TVRage.Load %num $1-
  } 
}
alias mTVRage { 
  ;*** Not turned on
  if (%TV_Rage == 0) { halt }
  ;************************************************************
  var %num = $trnum | set -u17 %TVRage_TargetC. [ $+ [ %num ] ] # | set %TVRage_Nick. [ $+ [ %num ] ] $nick | set %TVRage_Chan. [ $+ [ %num ] ] $chan
  ;************************************************************************************************************************************
  if ($Target !ischan) || ($2 == Schedule) || ($mid($strip($1),2,5) == TODAY) || ($mid($strip($1),2,8) == TOMORROW) || (Trigger isin $1-2) { set %TVRage_Target. [ $+ [ %num ] ] $nick | set %TVRage_Query. [ $+ [ %num ] ] 1 }
  else { set -u17 %TVRage_Target. [ $+ [ %num ] ] $iif(%TV_Where = 1,$chan,$nick) }
  ;************************************************************************************************************************************
  ;*** !TV TRiGGER / CMDS / HELP / COMMANDs
  if (($2 = TRIGGERs) || ($2 == CMDS) || ($2 == HELP) || ($2 == COMMANDs)) && (!$3) { var %X $r(1,2), %O $left($strip($1),1) | var %Y $iif($r(1,2) == 1,Dexter,$iif($r(1,2) == 1,House,$iif($r(1,2) == 1,Black Books,$iif($r(1,2) == 1,Blue Mountain State,$iif($r(1,2) == 1,Ideal,$iif($r(1,2) == 1,Community,$iif($r(1,2) == 1,The IT Crowd,$iif($r(1,2) == 1,My Name is Earl,$iif($r(1,2) == 1,Chuck,$iif($r(1,2) == 1,FlashForward,$iif($r(1,2) == 1,White Collar,$iif($r(1,2) == 1,Heroes,$iif($r(1,2) == 1,MythBusters,$iif($r(1,2) == 1,Top Gear,$iif($r(1,2) == 1,Psych,$iif($r(1,2) == 1,Breaking Bad,$iif($r(1,2) == 1,Weeds,$iif($r(1,2) == 1,HiMYM,How I Met Your Mother)))))))))))))))))) | var %Z $iif($r(1,2) == 1,Black Books,$iif($r(1,2) == 1,Blue Mountain State,$iif($r(1,2) == 1,Community,$iif($r(1,2) == 1,Ideal,$iif($r(1,2) == 1,Dexter,$iif($r(1,2) == 1,House,$iif($r(1,2) == 1,The IT Crowd,$iif($r(1,2) == 1,My Name is Earl,$iif($r(1,2) == 1,Chuck,$iif($r(1,2) == 1,FlashForward,$iif($r(1,2) == 1,White Collar,$iif($r(1,2) == 1,Heroes,$iif($r(1,2) == 1,MythBusters,$iif($r(1,2) == 1,Top Gear,$iif($r(1,2) == 1,Psych,$iif($r(1,2) == 1,Breaking Bad,$iif($r(1,2) == 1,Weeds,$iif($r(1,2) == 1,HiMYM,How I Met Your Mother)))))))))))))))))) | var %C $iif($r(1,2) == 1,Ideal,$iif($r(1,2) == 1,The IT Crowd,$iif($r(1,2) == 1,My Name is Earl,$iif($r(1,2) == 1,Chuck,$iif($r(1,2) == 1,FlashForward,$iif($r(1,2) == 1,White Collar,$iif($r(1,2) == 1,Heroes,$iif($r(1,2) == 1,MythBusters,$iif($r(1,2) == 1,Top Gear,$iif($r(1,2) == 1,Psych,$iif($r(1,2) == 1,Breaking Bad,$iif($r(1,2) == 1,Dexter,$iif($r(1,2) == 1,House,$iif($r(1,2) == 1,Black Books,$iif($r(1,2) == 1,Blue Mountain State,$iif($r(1,2) == 1,Community,$iif($r(1,2) == 1,Weeds,$iif($r(1,2) == 1,HiMYM,How I Met Your Mother)))))))))))))))))) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,%O,SHOW) 4<3Show4> 5EX: $+(%O,SHOW) %Y 15ooO( Get show description 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,$iif(%X == 1,$+(%O,NEXT) 15/ $+(3,%O,LAST),$+(,%O,N) 15/ $+(3,%O,L)) 4<3Show4>) 5EX: $iif(%X == 1,$+(%O,NEXT) %Z 15/ $+(%O,LAST),$+(%O,N) %Z 15/ $+(%O,L)) %Z 15ooO( Get information for next 15/ last episode 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,$iif($1 == $+(%O,EP),$v2,$+(%O,TV))) 4<3Show4> (3Season and Episode4) 5EX: $iif($1 == $+(%O,EP),$v2,$+(%O,TV)) %C $+($r(1,3),x0,$r(1,5)) 15ooO( Get general show information and episode summary (if season and episode is given) 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- $+(3,$iif($1 == !EP,$v2,!TV)) Schedule 4<3Day of Week4> (3Time4) (3Country4) 5EX: $iif($1 == !EP,$v2,!TV) Schedule Fri 10 $iif(%X == 1,GB,$iif(%X == 1,UK,AU)) 5Country: 3GB14, 3UK 14and 3AU (4US by default) 15ooO( Get program schedule for the requested day (Time and/or Country) 15) | msg %TVRage_Target. [ $+ [ %num ] ] 4- 4NOTE: Options in 4( ) are optional... and options in 4< > are required. | .unset %Y %Z %C %TVRage* [ $+ [ %num ] ] | halt }
  ;************************************************************************************************************************************
  ;*** !N / !NEXT
  elseif ($1 == !N) || ($1 == !NEXT) { set -u17 %TVRage_ONLY. [ $+ [ %num ] ] NEXT }
  ;*** !L / !LAST
  elseif ($1 == !L) || ($1 == !LAST) { set -u17 %TVRage_ONLY. [ $+ [ %num ] ] LAST }
  ;*** !SHOW / !SUMMARY
  elseif ($1 == !SHOW) { set -u17 %TVRage_ONLY. [ $+ [ %num ] ] SHOW }
  ;*** !TODAY / !TOMORROW
  elseif ($1 == !TODAY) || ($1 == !TOMORROW) { set %TVRage_Schedule. [ $+ [ %num ] ] !TV Schedule $remove($1-,!) }
  ;************************************************************************************************************************************
  TVRage.Load %num $iif(%TVRage_Schedule. [ $+ [ %num ] ],$v1,$replace($1-,BMS,Blue Mountain State,HiMYM,How I Met Your Mother,TUT,The Ultimate Fighter,DH,Desperate Housewives,A23,Don't Trust the B---- in Apartment 23))
}
alias -l TVRage.Load { var %num = $1
  if ($3 == Schedule) { set %TVRage_Type. [ $+ [ %num ] ] $v1
    var %temp $GetTok($2-,$numtok($2-,32),32)
    if ((%Temp = GB) || (%Temp = UK) || (%Temp = US) || (%Temp = AU)) { set %TVRage_Country. [ $+ [ %num ] ] $v1 | set %TVRage_Type. [ $+ [ %num ] ] Country }
    set %TVRage_Time_Schedule. [ $+ [ %num ] ] $iif($5 !isnum,$null,$Int($5)) | set %TVRage_Date. [ $+ [ %num ] ] $FullDate($4)
    if (%TVRage_Date. [ $+ [ %num ] ] = $null) { msg %TVRage_Target. [ $+ [ %num ] ] You need to pick a 4Day of the Week $iif(!%TVRage_Country. [ $+ [ %num ] ],or 4Country) | unset %TVRage_*. [ $+ [ %num ] ] %Check_*. [ $+ [ %num ] ] }
    TVRage %Num Schedule
  }
  else { $iif($CheckEP(%num,$3-) = 1,set %TVRage_Type. [ $+ [ %num ] ] EPSpec,$iif($2 == !SHOW,set %TVRage_Type. [ $+ [ %num ] ] SHOW,set %TVRage_Type. [ $+ [ %num ] ] Ep)) | TVRage %num $3- }
}
alias -l TVRage { 
  if ((%TVRage_Type. [ $+ [ $1 ] ] != Schedule) && (!$2)) { msg %TVRage_Target. [ $+ [ $1 ] ] Hmmm... you actually need to search for a TV-Show you know! 5Type: !TV Triggers 5for more help | .unset %TVRage_*. [ $+ [ $1 ] ] | return }
  elseif (%TVRage_Type. [ $+ [ $1 ] ] = EPSpec) { %tvshow. [ $+ [ $1 ] ] = $+($replace($GetTok($2-,1- [ $Calc($numtok($2-,32)-1) ] ,32),$chr(32),% $+ 20),&ep=,%Check_Season. [ $+ [ $1 ] ],x,%Check_EP. [ $+ [ $1 ] ]) }
  else { %TVShow. [ $+ [ $1 ] ] = $replace($2-,$chr(32),% $+ 20) }
  sockopen TVRage. [ $+ [ $1 ] ] services.tvrage.com 80
}
;*** BetterDuration (renamed LongTime+ here) *** Downloaded from: http://www.nealirc.org/IRC/mIRC.html
alias LongTime+ { var %lifeseconds = $abs($1) | var %age, %years, %days, %hours, %minutes, %seconds, %temp | %years = $int($calc(%lifeseconds / 31557600)) | if (%years != 0) { %age = $+(15,%years,14year,$iif(%years > 1,s)) } | %temp = $calc(%lifeseconds - (%years * 31557600)) | %days = $int($calc(%temp / 86400)) | if (%days != 0) { %age = %age $+(15,%days,14day,$iif(%days > 1,s)) } | %temp = $calc(%temp - (%days * 86400)) | %hours = $int($calc(%temp / 3600)) | if (%hours != 0) { %age = %age $+(15,%hours,14hour,$iif(%hours > 1,s)) } | %temp = $calc(%temp - (%hours * 3600)) | %minutes = $int($calc(%temp / 60)) | if (%minutes != 0) { %age = %age $+(15,%minutes,14minute,$iif(%minutes > 1,s)) } | %seconds = $calc(%temp % 60) | if (%seconds != 0) { %age = %age $+(15,%seconds,14second,$iif(%seconds > 1,s)) } | return $iif($right(%age, 1) == $chr(44),$left(%age, -1),%age) }
;*****************************************************************************************************************************************************************************************************************************************************************
alias replaceLiNK { return $replace($remove($1, ),Ã??Ã?©,Ã?©,&aring;,Ã?Â¥,&#39;,',&quot;,",&amp,&,&#x27;,',&#39;,',&ndash;,â??,&middot;,Ã?·,&raquo;,Ã?»,&laquo;,Ã?«,&Uuml;,Ã??,&uuml;,Ã?¼,&Aacute;,Ã?Â,&aacute;,Ã?¡,&Eacute;,Ã??,&eacute;,Ã?©,&Iacute;,Ã?Â,&iacute;,Ã?­,&Oacute;,Ã??,&oacute;,Ã?³,&Ntilde;,Ã??,&ntilde;,Ã?±,&Uacute;,Ã??,&uacute;,Ã?º,&nbsp;,$chr(32),&#8221;,â?Â,&#8220;,â??,#8220;,â??,#8221;,â?Â,&#230;,Ã?¦,&#229;,Ã?Â¥,&#197;,Ã??,&#248;,Ã?¸,&#216;,Ã??,Ã?¢â?‰?Â+a,$+($chr(32),â??,$chr(32)),Ã?¢â?‰?Â,$chr(32),Ã??Ã?¡,Ã?¡,Ã??Ã?®,Ã?®,Ã?¢â??Ã?¢,â?¢,Ã??Ã?©,Ã?©,&#xE5;,Ã?Â¥,&#8230;,â?¦,&mdash;,-,&#039;,',&#8216;,â??,Ã??â?°,Ã??,&#34;,",&#8217;,',&#8211;,-,Ã??Ã?©,Ã?©,&aelig;,Ã?¦,&quot;,",Ã??Ã?¦,Ã?¦, Ã??Ã?¸ ,Ã?¸,Ã??Ã?Â¥,Ã?Â¥,Ã??â? ,Ã??,Ã??Ã??,Ã??,Ã??,Ã??,&#39;,',Ã?¢â?‰?¢,',188.114.142.12,HiDDEN,&apos;,',#8217;,â??,&micro;,Ã?³,#8211;,-,&oslash;,Ã?¸,&#8212;,a,Ã?¢â?¬Ã??,â??,Ã??Ã?¤,Ã?¤,-&#160;,-,&#8242;,',Ã??Ã?¼,Ã?¼,Ã??Ã?©,Ã?©,Ã??Ã?©,Ã?©,Ã??Ã?¶,Ã?¶,&#252;,Ã?¼,&#198;,Ã??,Ã??â?¦,Ã??,&#233;,Ã?©,\u0027,',Ã?¢â?¬Ã??,â??,Ã?¢â?¬,â?Â,&#38;,&,|,|) }
alias -l trnum { var %trnum $base($calc($base(%trnum,36,10) +1),10,36) | return %trnum }
alias -l noHTML { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,&nbsp;) | return %x }
alias -l LongTime { return $+(15,$replacex($1,wks,14weeks15,wk,14week15,days,14days15,day,14day15,hrs,14hours15,hr,14hour15,mins,14minutes15,min,14minute15,sec,14second),14) }
alias -l FullDate { return $iif($Mid($1,1,3) == Tom,$replacex($day,Sun,Mon,Mon,Tues,Tues,Wednes,Wednes,Thurs,Thurs,Fri,Fri,Satur,Satur,Sun),$iif($Mid($1,1,3) == Yes,$replace($day,Mon,Sun,Tues,Mon,Wednes,Tues,Thurs,Wednes,Fri,Thurs,Satur,Fri,Sun,Satur),$iif($Mid($1,1,3) == Tod,$day,$iif($Mid($1,1,3) == Mon,Monday,$iif($Mid($1,1,3) == Tue,Tuesday,$iif($Mid($1,1,3) == Wed,Wednesday,$iif($Mid($1,1,3) == Thu,Thursday,$iif($Mid($1,1,3) == Fri,Friday,$iif($Mid($1,1,3) == Sat,Saturday,$iif($Mid($1,1,3) == Sun,Sunday,$null)))))))))) }
alias -l SetMonth { return $replace($1,Jan,1,Feb,2,Mar,3,Apr,4,May,5,Jun,6,Jul,7,Aug,8,Sep,9,Oct,10,Nov,11,Dec,12) }
;*** Text Overflow Limiting *** Downloaded from: http://www.hawkee.com/snippet/7305/
alias mCuttext { var %ch $1,%str $2-,%max $calc(498 - $len(%ch) - $len($address($me,5)))
  while (%str) { var %cut $limtok(%str,%max,32) | msg %ch %cut | var %str $gettok(%str,$+($calc($numtok(%cut,32) + 1),-),32) }
}
alias mCuttextN { var %ch $1,%str $2-,%max $calc(498 - $len(%ch) - $len($address($me,5)))
  while (%str) { var %cut $limtok(%str,%max,32) | .notice %ch %cut | var %str $gettok(%str,$+($calc($numtok(%cut,32) + 1),-),32) }
}
alias limtok { if ($len($gettok($1,1,$3)) >= $2) { return $left($1,$2) } | var %x 1,%str,%c | while ($gettok($1,%x,$$3)) { var %c $v1 | if ($calc($len(%c) + $len(%str)) <= $2) { var %str $+(%str,$chr($3),%c) } | else { break } | inc %x } | return $mid(%str,2) }
;*****************************************************************************************************************************************************************************************************************************************************************
alias -l Check.Settings {
  if ($1 = Ep) || ($1 = Sch) {
    if (%TV_Where == $null) || (%TV_Where2 == $null) { $iif($1 = Sch,set -u17 %TV_Where,set -u17 %TV_Where2) 0 }
    if (%TV_Where == 1) || (%TV_Where2 == 1) { set -u17 %TVRage_Target. [ $+ [ $2 ] ] %TVRage_Chan. [ $+ [ $2 ] ] }
    elseif (%TV_Where == 0) || (%TV_Where2 == 0) { set -u17 %TVRage_Target. [ $+ [ $2 ] ] %TVRage_Nick. [ $+ [ $2 ] ] } 
    if (%TVRage_Query. [ $+ [ $2 ] ] == 1) { set -u17 %TVRage_Target. [ $+ [ $2 ] ] %TVRage_Nick. [ $+ [ $2 ] ] } 
  }
}
alias -l CheckEP {
  var %temp $GetTok($2-,$numtok($2-,32),32)
  $iif(e isin %Temp,%Temp = $replace(%Temp,e,x))
  set %Check_Season. [ $+ [ $1 ] ] $Mid(%Temp,1,$Calc($pos(%Temp,x)-1))
  set %Check_EP. [ $+ [ $1 ] ] $Mid(%Temp,$Calc($pos(%Temp,x)+1))
  if ($mid(%Check_Season. [ $+ [ $1 ] ],1,1) = s) { Set %Check_Season. [ $+ [ $1 ] ] $Mid(%Check_Season. [ $+ [ $1 ] ],2) }
  if ((%Check_season. [ $+ [ $1 ] ] isnum) && (%Check_EP. [ $+ [ $1 ] ] isnum)) { Return 1 }
  else { Return 0 }
}
alias -l msg {
  if (%TV_Color = 0) { var %Temp = $strip($1-) | tokenize 32 %Temp }
  if ($Show) { $iif($1 !ischan,!.msg $1 $iif(%TV_Color == 0,$strip($2-),$2-),!msg $1 $iif(c isincs $chan($1).mode,$strip($2-),$iif(%TV_Color == 0,$strip($2-),$2-))) } 
  else { !.msg $1 $iif(c isincs $chan($1).mode,$strip($2-),$iif(%TV_Color == 0,$strip($2-),$2-)) }
}
on *:sockopen:TVRage.*: { var %num = $Mid($sockname,$calc($Pos($sockName,.,1) + 1))
  if ($sockerr > 0) return 
  ;**************************
  elseif (%TVRage_Type. [ $+ [ %num ] ] == Schedule) || (%TVRage_Type. [ $+ [ %num ] ] == Country) { msg %TVRage_TargetC. [ $+ [ %num ] ] 5PM14'5iNG $+(13,%TVRage_Target. [ $+ [ %num ] ],) the program schedule for $+(3,%TVRage_Date. [ $+ [ %num ] ],) $+(15,$chr(40),7,$iif(%TVRage_Country. [ $+ [ %num ] ],$v1,US),$iif(%TVRage_Time_Schedule. [ $+ [ %num ] ],$+($chr(32),14-4#14-) $+(15,$v1) 14PM),15,$chr(41),) | sockwrite -n $SockName GET $+(/tools/quickschedule.php,$iif(%TVRage_Type. [ $+ [ %num ] ] == Country,$+(?country=,%TVRage_Country. [ $+ [ %num ] ]))) HTTP/1.1 }
  ;*******************************************************************************************************
  elseif (%TVRage_ONLY. [ $+ [ %num ] ] == SHOW) && (%show_ID. [ $+ [ %num ] ] != $null) { if (!%show_ID. [ $+ [ %num ] ]) { echo -at Sorry... unknown error... this option might not be implemented anymore | halt } | set %show_ID+. [ $+ [ %num ] ] %show_ID. [ $+ [ %num ] ] | sockwrite -n $sockname GET $+(/myfeeds/showinfo.php?key=sqsTSaJG4qJagM6ldpKZ&sid=,%show_ID+. [ $+ [ %num ] ]) HTTP/1.1 }
  ;****************************************************************************************
  elseif ((%TVRage_Type. [ $+ [ %num ] ] == SHOW) || (%TVRage_Type. [ $+ [ %num ] ] = EP) || (%TVRage_Type. [ $+ [ %num ] ] = EPSpec)) { sockwrite -n $sockname GET $+(/tools/quickinfo.php?show=,%tvshow. [ $+ [ %num ] ]) HTTP/1.0 }
  ;************************************
  set %TVRage_Day. [ $+ [ %num ] ] 0
  ;************************************
  sockwrite -n $sockname Host: $iif(%HOST,$v1,services.tvrage.com)
  sockwrite -n $sockname Connection: keep-alive
  sockwrite $sockname $crlf
}
on *:sockread:TVRage.*: { var %num = $Mid($sockname,$calc($Pos($sockName,.,1) + 1))
  if ($sockerr) { return }
  var %TVRead | sockread %TVRead
  ;************************************************************************************************************************************
  if (*Accept-Ranges:* iswm %TVRead) || (*X-Src-Webcache:* iswm %TVRead) || (*Connection:* iswm %TVRead) || (*TCN:* iswm %TVRead) || (*Content-Type:* iswm %TVRead) || (*Keep-Alive:* iswm %TVRead) || (*Date:* iswm %TVRead) || (*Server:* iswm %TVRead) || (*X-Powered-By:* iswm %TVRead) || (*Vary:* iswm %TVRead) || (*Content-Length:* iswm %TVRead) || (*Expires:* iswm %TVRead) || (*Cache-Control:* iswm %TVRead) || (*Pragma:* iswm %TVRead) || (*Set-Cookie:* iswm %TVRead) || (*Transfer-Encoding:* iswm %TVRead) || (*HTTP/1.1 200 OK* iswm %TVRead) || (*HTTP/1.1 501 Invalid Request* iswm %TVRead) || (*HTTP/1.1 404* iswm %TVRead) { $iif(*HTTP/1.1 404* iswm %TVRead,$iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) $remove(%TVRead,HTTP/1.1 404),$iif(*HTTP/1.1 501 Invalid Request* iswm %TVRead,$iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) Sorry... bad request... try again)) | $iif(*HTTP/1.1 404* iswm %TVRead,sockclose $sockname,$iif(*HTTP/1.1 501 Invalid Request* iswm %TVRead,sockclose $sockname)) | return }
  ;*** Testing
  ;  $iif(%TVRead != $null,echo -at $+(5,$replace($remove($v1,<pre>),@,15@14)))
  ;***********************************************************************************
  ;*** Show summary
  if (%show_ID+. [ $+ [ %num ] ]) {
    if (<image> isin %TVRead) { set %show_PiC [ $+ [ %num ] ] $nohtml(%TVRead) }
    elseif (<summary> isin %TVRead) { %X = $replaceLiNK($remove(%TVRead,<summary>,  )) | $iif(*</summary>* iswm %TVRead,set %X $mid(%X,1,$calc($pos(%X,</summary>) -1))) | write tvrage.txt %X | unset %X }
    elseif ($regex(%TVRead,<[^<>]+>) == 0) { $iif(%TVRead != $null,write tvrage.txt $replaceLiNK($v1)) }
    if (</summary> isin %TVRead) { sockclose $sockname | $iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) [ $+(05,%show_name. [ $+ [ %num ] ]) ] $iif(%show_Ended. [ $+ [ %num ] ] != $null,$+(,%show_Status. [ $+ [ %num ] ],) 14-4#14- $LongTime+($calc($cTime -$cTime($SetMonth(%show_Ended. [ $+ [ %num ] ])))) ago $+($chr(40),15,$replace(%show_Ended. [ $+ [ %num ] ],/,14/15),,$chr(41)),$iif(%show_Airtime. [ $+ [ %num ] ],$+(4,$v1,))) $iif(%show_Class. [ $+ [ %num ] ],$+(,$chr(40),15,$v1,,$chr(41),)) $iif(%show_Genre. [ $+ [ %num ] ],$+(14,$replace($v1,|,15/14),)) $iif(!%show_Ended. [ $+ [ %num ] ],since,from) $+(7,%show_Started. [ $+ [ %num ] ],$iif($len(%show_Ended. [ $+ [ %num ] ]) == 11 && %show_Started. [ $+ [ %num ] ] !isin %show_Ended. [ $+ [ %num ] ],$+(14-07,$gettok($v2,3,47))),) $iif(!%show_Ended. [ $+ [ %num ] ],$+(,$chr(40),%show_Status. [ $+ [ %num ] ],,$chr(41),)) $iif(%show_Network. [ $+ [ %num ] ] != $null,$iif(!%show_Ended. [ $+ [ %num ] ],airs,aired) on $+(7,$iif(%show_Country. [ $+ [ %num ] ] !isin %show_Network. [ $+ [ %num ] ],$v2 $+(15,$chr(40),07,$v1,15,$chr(41)),$replace($v2,$chr(40),$+(15,$chr(40),07),$chr(41),$+(15,$chr(41)))),)) $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,15,$chr(41),))) $iif(%show_PiC [ $+ [ %num ] ],5Show images: $+(2,$v1,))
    if ($lines(tvrage.txt) >= 1) { var %x 1 | while (%x <= $lines(tvrage.txt)) { $iif(%TVRage_Target. [ $+ [ %num ] ],$iif($lines(tvrage.txt) <= 1,mCuttext %TVRage_Target. [ $+ [ %num ] ],mCuttextN %TVRage_Nick. [ $+ [ %num ] ]),echo -at) $iif(%x == 1,5Description:) $read(tvrage.txt,%x) | inc %x } | .remove tvrage.txt } | goto ENDiTNOW }
    return
  }
  ;************************************************************************************************************************************
  ;*** Schedule
  elseif (%TVRage_Type. [ $+ [ %num ] ] = Schedule) || (%TVRage_Type. [ $+ [ %num ] ] = Country) {
    ;*** DAY
    if ($mid(%TVRead,1,5) = [DAY]) { if ($Fopen(%TVRage_Day. [ $+ [ %num ] ])) { .fclose %TVRage_Day. [ $+ [ %num ] ] } | set -u17 %TVRage_Day. [ $+ [ %num ] ] $GetTok($Mid(%TVRead,6,$calc($pos(%TVRead,[/,1) - 6)),1,44) | if (%TVRage_Day. [ $+ [ %num ] ] = %TVRage_Date. [ $+ [ %num ] ]) { .fopen -no %TVRage_Day. [ $+ [ %num ] ] [ %TVRage_Day. [ $+ [ %num ] ] ] [ $+ [ %num ] ] $+ .txt | .fwrite -n %TVRage_Day. [ $+ [ %num ] ] $Mid(%TVRead,6,$calc($pos(%TVRead,[/,1) - 6)) } }
    ;*** TiME
    if ($regex(%TVRead,/\[TIME\](.*)\[\/TIME\]/i)) { set -u7 %sTiME $ascTime($cTime($date $regml(1)),HH:nn) }
    ;*** SHOW
    if ($regex(%TVRead,/\[SHOW\](.*)\[\/SHOW\]/i)) && (%TVRage_Day. [ $+ [ %num ] ] = %TVRage_Date. [ $+ [ %num ] ]) { set -u2 %TVRead_NetW $strip($remove($mid(%TVRead,$pos(%TVRead,]),$calc($pos(%TVRead,^,1) -$pos(%TVRead,],1))),])) | set -u2 %TVRead_TiTLE $strip($remove($mid(%TVRead,$pos(%TVRead,^,1),$calc($pos(%TVRead,^,2) -$pos(%TVRead,^,1))),^)) | set -u2 %TVRead_EP $strip($remove($mid(%TVRead,$pos(%TVRead,^,2),$calc($pos(%TVRead,^,3) -$pos(%TVRead,^,2))),^)) | set -u2 %TVRead_LiNK $strip($remove($mid(%TVRead,$pos(%TVRead,^,3),$calc($pos(%TVRead,[,2) -$pos(%TVRead,^,3))),^)) | set -u2 %TVRead_SHOW $+(4,[14,%sTiME,4]) $+(15,%TVRead_TiTLE,) 14-4#14- $+(14,$replace(%TVRead_EP,x,15x14),) 14-4#14- $+(8,%TVRead_NetW,) $+(,$chr(40),2,%TVRead_LiNK,,$chr(41),) | .fwrite -n %TVRage_Day. [ $+ [ %num ] ] %TVRead_SHOW }
    return
  }
  if (!$sockbr) return
  ;************************************************************************************************************************************
  ;*** !TV / !EP / !SHOW / !NEXT / !N / !LAST / !L
  elseif ($regex($strip(%TVRead),/Show ID@(.*)/)) { set %show_ID. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Show Name@(.*)/)) { set %show_Name. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Show URL@(.*)/)) { set %show_Link. [ $+ [ %num ] ] $remove($regml(1),http://) }
  elseif ($regex($strip(%TVRead),/Premiered@(.*)/)) { set %show_Started. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Started@(.*)/)) { set %show_Started+. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Ended@(.*)/)) { set %show_Ended. [ $+ [ %num ] ] $regml(1) }
  ;  elseif ($regex($strip(%TVRead),/Episode Info@(.*)/)) { set %show_EP. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Episode URL@(.*)/)) { set %show_URL. [ $+ [ %num ] ] $remove($regml(1),http://) }
  ;  elseif ($regex($strip(%TVRead),/Latest Episode@(.*)/)) { set %show_Last. [ $+ [ %num ] ] $regml(1) }
  ;  elseif ($regex($strip(%TVRead),/Next Episode@(.*)/)) { set %show_Next. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/RFC3339@(.*)/)) { set %show_RFC. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/GMT+0 NODST@(.*)/)) { set %show_GMT. [ $+ [ %num ] ] $regml(1) }
  ;* ^ set %tvr.airnextepcmt $calc($gettok($regml(1),2,64) - $ctime + 3600) | echo -at %tvr.airnextepcmt vs $calc($gettok(%show_GMT. [ $+ [ %num ] ],2,64) - $ctime + 3600)
  elseif ($regex($strip(%TVRead),/Country@(.*)/)) { set %show_Country. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Status@(.*)/)) { set %show_Status. [ $+ [ %num ] ] $replace($regml(1),Return,9Return,Final,3Final,Canceled/Ended,4Canceled,New,8New) }
  elseif ($regex($strip(%TVRead),/Classification@(.*)/)) { set %show_Class. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Genres@(.*)/)) { set %show_Genre. [ $+ [ %num ] ] $regml(1) }
  elseif ($regex($strip(%TVRead),/Network@(.*)/)) { set %show_Network. [ $+ [ %num ] ] $regml(1) }
  ;  elseif ($regex($strip(%TVRead),/Airtime@(.*)/)) { set %show_Airtime. [ $+ [ %num ] ] $replace($regml(1),day,days,pm,PM,am,AM) }
  ;  elseif ($regex($strip(%TVRead),/Runtime@(.*)/)) { set %show_Runtime. [ $+ [ %num ] ] $regml(1) }
  ;************************************************************************************************************************************
  ;*** Episode iNFO
  elseif ($regex($strip(%TVRead),/Episode Info@(.*)/)) { set %show_EP. [ $+ [ %num ] ] $regml(1) | set -u3 %TVRead+ $gettok(%TVRead,2,64) | set -u3 %TVRead_DATE $gettok(%TVRead+,3,94) | set %TVRead_EP $gettok(%TVRead+,1,94) | set %TVRead_TiTLE $gettok(%TVRead+,2,94) | set %show_Spec. [ $+ [ %num ] ] $+(14,$replace(%TVRead_EP,x,15x14)) $iif(%TVRead_TiTLE,14-4#14- $+(15,$v1)) | set %show_Spec_Title. [ $+ [ %num ] ] %TVRead_TiTLE | set %show_Spec_EP. [ $+ [ %num ] ] %TVRead_EP | set %show_Spec_Airdate. [ $+ [ %num ] ] %TVRead_DATE | set %show_Spec_Airdate+. [ $+ [ %num ] ] $replace(%show_Spec_Airdate. [ $+ [ %num ] ],Jan,01,Feb,02,Mar,03,Apr,04,May,05,Jun,06,Jul,07,Aug,08,Sep,09,Oct,10,Nov,11,Dec,12) }
  ;**********************************************************************************************************************************
  ;*** Last + Next
  elseif ($regex($strip(%TVRead),/Latest Episode@(.*)/)) || ($regex($strip(%TVRead),/Next Episode@(.*)/)) { set -u3 %TVRead+ $gettok(%TVRead,2,64) | set -u3 %TVRead_DATE $gettok(%TVRead+,3,94) | set -u3 %TVRead_EP $gettok(%TVRead+,1,94) | set -u3 %TVRead_TiTLE $gettok(%TVRead+,2,94) | $iif(Latest Episode@ isin %TVRead,set %show_Last. [ $+ [ %num ] ],set %show_Next. [ $+ [ %num ] ]) $+(14,$replace(%TVRead_EP,x,15x14)) $iif(%TVRead_TiTLE,14-4#14- $+(15,$v1)) | $iif(Latest Episode@ isin %TVRead,set %show_Last_Title. [ $+ [ %num ] ],set %show_Next_Title. [ $+ [ %num ] ]) %TVRead_TiTLE | $iif(Latest Episode@ isin %TVRead,set %show_Last_EP. [ $+ [ %num ] ],set %show_Next_EP. [ $+ [ %num ] ]) %TVRead_EP | $iif(Latest Episode@ isin %TVRead,set %show_Last_Airdate. [ $+ [ %num ] ],set %show_Next_Airdate. [ $+ [ %num ] ]) $+($GetTok(%TVRead_DATE,2,47),/,$GetTok(%TVRead_DATE,1,47),/,$GetTok(%TVRead_DATE,3,47)) | $iif(Latest Episode@ isin %TVRead,set %show_Last_Airdate+. [ $+ [ %num ] ],set %show_Next_Airdate+. [ $+ [ %num ] ]) $replace($iif(Latest Episode@ isin %TVRead,%show_Last_Airdate. [ $+ [ %num ] ],%show_Next_Airdate. [ $+ [ %num ] ]),Jan,01,Feb,02,Mar,03,Apr,04,May,05,Jun,06,Jul,07,Aug,08,Sep,09,Oct,10,Nov,11,Dec,12)) | $iif(%show_Ended. [ $+ [ %num ] ] != $null,$iif(Latest Episode@ isin %TVRead && $len(%show_Ended. [ $+ [ %num ] ]) >= 11,set %show_Ended. [ $+ [ %num ] ] $+($gettok(%show_Ended. [ $+ [ %num ] ],2,47),/,$gettok(%show_Ended. [ $+ [ %num ] ],1,47),/,$gettok(%show_Ended. [ $+ [ %num ] ],3,47)),set %show_Ended. [ $+ [ %num ] ] %show_Last_Airdate. [ $+ [ %num ] ]),unset %show_Ended. [ $+ [ %num ] ]) }
  ;**********************************************************************************************************************************
  ;*** Airtime (cTime)
  elseif ($regex($strip(%TVRead),/Airtime@(.*)/)) { set %show_Airtime. [ $+ [ %num ] ] $replace($regml(1),day,days,pm,PM,am,AM) | $iif(%show_Spec_Airdate+. [ $+ [ %num ] ],set %show_Spec_cTime. [ $+ [ %num ] ] $cTime($v1 $GetTok(%Show_Airtime. [ $+ [ %num ] ],3-4,32))) | $iif(%show_Last_Airdate+. [ $+ [ %num ] ],set %show_Last_cTime. [ $+ [ %num ] ] $cTime($v1 $GetTok(%Show_Airtime. [ $+ [ %num ] ],3-4,32))) | $iif(%show_Next_Airdate+. [ $+ [ %num ] ],set %show_Next_cTime. [ $+ [ %num ] ] $cTime($v1 $GetTok(%Show_Airtime. [ $+ [ %num ] ],3-4,32))) }
  ;**********************************************************************************************************************************
  ;*** Runtime ( sockclose )
  elseif ($regex($strip(%TVRead),/Runtime@(.*)/)) { set %show_Runtime. [ $+ [ %num ] ] $regml(1) | sockclose $sockname | Check.Settings Ep %Num
    ;*** !SHOW
    if (%TVRage_ONLY. [ $+ [ %num ] ] == SHOW) && (%show_ID. [ $+ [ %num ] ]) { $iif(%show_ID. [ $+ [ %num ] ] != $null,TVRage %num $v1) | halt }
    ;**********************************************************************************************************************************
    ;*** ERROR - $iif(%show_Last_Airdate+. [ $+ [ %num ] ],$+($chr(40),15,$replace($v1,/,14/15),,$chr(41))))
    elseif (!%show_Next. [ $+ [ %num ] ]) && (%TVRage_ONLY. [ $+ [ %num ] ] == NEXT) { goto TVRage_iNFO }
    elseif (!%show_Next. [ $+ [ %num ] ]) && (%TVRage_ONLY. [ $+ [ %num ] ] == NEXT) { msg %TVRage_Target. [ $+ [ %num ] ] No information available for $+(5,%show_name. [ $+ [ %num ] ],) $+(15,$chr(40),14,$left(%show_Last_EP. [ $+ [ %num ] ],2),15x14,$calc($mid(%show_Last_EP. [ $+ [ %num ] ],4,2) +1),15,$chr(41),) 14-4#14- 5Reason: $iif(!%show_Ended. [ $+ [ %num ] ],Unknown... might not be schedule yet $+(15,$chr(40),%show_Status. [ $+ [ %num ] ],15,$chr(41),),$iif(%show_Last_cTime. [ $+ [ %num ] ],The show sadly ended $+(15,$replacex($duration($calc($cTime -$v1)),wks,14weeks15,wk,14week15,days,14days15,day,14day15,hrs,14hours15,hr,14hour15,mins,14minutes15,min,14minute,secs,14seconds,sec,14second) 14ago),Sadly this show has either ended or been canceled)) $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,15,$chr(41),)) | goto ENDiTNOW }
    elseif (%TVRage_Type. [ $+ [ %num ] ] == EPSpec) && ((%Check_Season. [ $+ [ %num ] ]) || (%Check_EP. [ $+ [ %num ] ])) && (!%show_Spec_EP. [ $+ [ %num ] ]) { msg %TVRage_Target. [ $+ [ %num ] ] No information available for $+(5,%show_name. [ $+ [ %num ] ],) $+(15,$chr(40),14,$iif($len(%Check_Season. [ $+ [ %num ] ]) == 1,0),%Check_Season. [ $+ [ %num ] ],15x14,$iif($len(%Check_EP. [ $+ [ %num ] ]) == 1,0),%Check_EP. [ $+ [ %num ] ],15,$chr(41),) 14-4#14- 5Reason: Not that many episodes in the $+(14,$ord(%Check_Season. [ $+ [ %num ] ]),) season $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,/episode_list/,%Check_Season. [ $+ [ %num ] ],15,$chr(41),)) | goto ENDiTNOW }
    ;**********************************************************************************************************************************
    ;*** EPSpecs
    elseif (%show_Spec_EP. [ $+ [ %num ] ] != $null) { msg %TVRage_Target. [ $+ [ %num ] ] $+(05,%show_name. [ $+ [ %num ] ],) 14-4#14- %show_Spec. [ $+ [ %num ] ] $iif(%show_Spec_cTime. [ $+ [ %num ] ] > $cTime,5Airing in:,5Aired:) $iif(%show_Spec_cTime. [ $+ [ %num ] ] != $null,$LongTime+($calc($cTime -$cTime(%show_Spec_Airdate+. [ $+ [ %num ] ])))) $iif(%show_Spec_cTime. [ $+ [ %num ] ] < $cTime,ago) $+($chr(40),15,$replace(%show_Spec_Airdate+. [ $+ [ %num ] ],/,14/15),,$chr(41)) $iif(%show_URL. [ $+ [ %num ] ] != $null,$+(15,$chr(40),2,$v1,15,$chr(41),))) | $iif(%show_URL. [ $+ [ %num ] ] != $null,TVPlot %TVRage_Target. [ $+ [ %num ] ] %show_URL. [ $+ [ %num ] ]) | goto ENDiTNOW }
    ;*** SHOW iNFO / MSG
    elseif (!%TVRage_ONLY. [ $+ [ %num ] ]) { :TVRage_iNFO | $iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) [ $+(05,%show_name. [ $+ [ %num ] ]) ] $iif(%show_Ended. [ $+ [ %num ] ] != $null,Ended and/or canceled 14-4#14- $LongTime+($calc($cTime -$cTime($SetMonth(%show_Ended. [ $+ [ %num ] ])))) ago $+($chr(40),15,$replace(%show_Ended. [ $+ [ %num ] ],/,14/15),,$chr(41)),$iif(%show_Airtime. [ $+ [ %num ] ],$+(4,$v1,))) $iif(%show_Class. [ $+ [ %num ] ],$+(,$chr(40),15,$v1,,$chr(41),)) $iif(%show_Genre. [ $+ [ %num ] ],$+(14,$replace($v1,|,15/14),)) $iif(!%show_Ended. [ $+ [ %num ] ],since,from) $+(7,%show_Started. [ $+ [ %num ] ],$iif($len(%show_Ended. [ $+ [ %num ] ]) == 11 && %show_Started. [ $+ [ %num ] ] !isin %show_Ended. [ $+ [ %num ] ],$+(14-07,$gettok($v2,3,47))),) $iif(!%show_Ended. [ $+ [ %num ] ],$+(,$chr(40),%show_Status. [ $+ [ %num ] ],,$chr(41),)) $iif(%show_Network. [ $+ [ %num ] ] != $null,$iif(!%show_Ended. [ $+ [ %num ] ],airs,aired) on $+(7,$iif(%show_Country. [ $+ [ %num ] ] !isin %show_Network. [ $+ [ %num ] ],$v2 $+(15,$chr(40),07,$v1,15,$chr(41)),$replace($v2,$chr(40),$+(15,$chr(40),07),$chr(41),$+(15,$chr(41)))),)) $iif(%Show_link. [ $+ [ %num ] ],$+(15,$chr(40),2,$v1,15,$chr(41),))) | $iif(!%show_Next. [ $+ [ %num ] ] && %TVRage_ONLY. [ $+ [ %num ] ] == NEXT,goto TVRage_LAST) }
    ;*** !LAST
    if ((!%TVRage_ONLY. [ $+ [ %num ] ]) || (%TVRage_ONLY. [ $+ [ %num ] ] == LAST)) && (%show_Last. [ $+ [ %num ] ] != $null) { :TVRage_LAST | msg %TVRage_Target. [ $+ [ %num ] ] $iif(%TVRage_ONLY. [ $+ [ %num ] ] == LAST,$+(5,%show_name. [ $+ [ %num ] ],) 14-4#14-,5Last Episode) %show_Last. [ $+ [ %num ] ] $iif(%show_Last_cTime. [ $+ [ %num ] ],5Aired: $+(15,$LongTime+($calc($cTime -$v1)) 14ago)) $iif(%show_Last_Airdate+. [ $+ [ %num ] ],$+($chr(40),15,$replace($v1,/,14/15),,$chr(41))) $iif(%TVRage_ONLY. [ $+ [ %num ] ] == LAST && %Show_link. [ $+ [ %num ] ] != $null,$+(15,$chr(40),2,%Show_link. [ $+ [ %num ] ],15,$chr(41),))) }
    ;*** !NEXT
    if (%show_Next. [ $+ [ %num ] ] != $null) && ((!%TVRage_ONLY. [ $+ [ %num ] ]) || (%TVRage_ONLY. [ $+ [ %num ] ] == NEXT)) { msg %TVRage_Target. [ $+ [ %num ] ] $iif(%TVRage_ONLY. [ $+ [ %num ] ] == NEXT,$+(5,%show_name. [ $+ [ %num ] ]) 14-4#14-,5Next Episode) $+(%show_Next. [ $+ [ %num ] ],) $iif(%show_Next_cTime. [ $+ [ %num ] ] > $cTime,5Airing in: $+($LongTime+($calc($v1 -$cTime)),),5Aired: $+($LongTime+($calc($cTime -$v1)),)) $iif(%show_Next_Airdate+. [ $+ [ %num ] ],$+($chr(40),15,$replace($v1,/,14/15),,$chr(41))) $iif(%TVRage_ONLY. [ $+ [ %num ] ] == NEXT && %Show_link. [ $+ [ %num ] ] != $null,$+(15,$chr(40),2,%Show_link. [ $+ [ %num ] ],15,$chr(41),)))) }
    :ENDiTNOW
    unset %TVRead* %tvshow* [ $+ [ %num ] ] %show_* [ $+ [ %num ] ] %TVRage_* [ $+ [ %num ] ] %Check_* [ $+ [ %num ] ] %next_* [ $+ [ %num ] ] %show_* [ $+ [ %num ] ]
  }
}
on *:sockclose:TVRage.*:{ var %num = $Mid($sockname,$calc($Pos($sockName,.,1) + 1))
  ;**** !TODAY / !TOMORROW ( As in program schedule )
  if ((%TVRage_Type. [ $+ [ %num ] ] = Schedule) || (%TVRage_Type. [ $+ [ %num ] ] = Country)) { Check.Settings Sch %Num | if (%TVRage_Date. [ $+ [ %num ] ] != $null) { .fopen %TVRage_Date. [ $+ [ %num ] ] [ %TVRage_Date. [ $+ [ %num ] ] ] [ $+ [ %num ] ] $+ .txt | set -u17 %TVRage_DATE+ [ $+ [ %num ] ] $+(15,$fread(%TVRage_Date. [ $+ [ %num ] ])) | while ($Feof != 1) { set -u2 %TVRage_Tmp. [ $+ [ %num ] ] $Fread(%TVRage_Date. [ $+ [ %num ] ]) | set -u2 %TVRage_Time_Temp. [ $+ [ %num ] ] $remove(%TVRage_Tmp. [ $+ [ %num ] ],$GetTok(%TVRage_Tmp. [ $+ [ %num ] ],2,93),[,]) | if (!%NOTHiNGFOUD) { set -u17 %NOTHiNGFOUD 1 | .TiMER-TV-SCHEDULE 1 3 $iif(%TVRage_Target. [ $+ [ %num ] ],msg $v1,echo -at) [4ERROR] 14There are no new TV Shows Scheduled for $+(04,%TVRage_Time_Schedule. [ $+ [ %num ] ],15:0400 $iif(%TVRage_Time_Schedule. [ $+ [ %num ] ] < 12,14PM,14AM),) } | if (%TVRage_Time_Schedule. [ $+ [ %num ] ] == $null) || ((%TVRage_Time_Schedule. [ $+ [ %num ] ] != $null) && ($mid($strip(%TVRage_Time_Temp. [ $+ [ %num ] ]),1,2) == $int($replacex($mid(%TVRage_Time_Schedule. [ $+ [ %num ] ],1,2),5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,00)))) { .TiMER-TV-SCHEDULE OFF | $iif(%NOTHiNGFOUD == 1,$iif(%TVRage_Target. [ $+ [ %num ] ],.msg $v1,echo -at) 05Schedule for %TVRage_DATE+ [ $+ [ %num ] ] $iif(%TVRage_Time_Schedule. [ $+ [ %num ] ],5at $+(15,$replacexcs($v1,5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,00),14:1500) $iif($replacexcs(%TVRage_Time_Schedule. [ $+ [ %num ] ],5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,00) > 12,14PM,14AM))) | $iif(%TVRage_Target. [ $+ [ %num ] ],.msg $v1,echo -at) $replaceLiNK(%TVRage_Tmp. [ $+ [ %num ] ]) | inc -u3 %NOTHiNGFOUD } } } | .fclose %TVRage_Date. [ $+ [ %num ] ] | .remove [ %TVRage_Date. [ $+ [ %num ] ] ] [ $+ [ %num ] ] $+ .txt }
  .unset %tvshow* [ $+ [ %num ] ] %show_* [ $+ [ %num ] ] %TVRage_* [ $+ [ %num ] ] %Check_* [ $+ [ %num ] ] %next_* [ $+ [ %num ] ]
}
;**********************************************************************************************************************************
;*** TVPlot
alias TVPlot { set -u5 %CHAN $1 | $iif($2,set %TVPlot-Link $remove($2,www.tvrage.com,http://)) | sockClose TVPlot | sockOpen TVPlot www.tvrage.com 80 } 
on *:SockOpen:TVPlot: { sockwrite -nt TVPlot GET $iif(%TVPlot-Link,$v1,/House/episodes/1064858782) HTTP/1.1 | sockwrite -nt TVPlot Host: www.tvrage.com | sockwrite -nt TVPlot $crlf | unset %TVPlot-Link }
on *:SockRead:TVPlot: { tokenize 32 $sock($sockname).mark | var %read | sockRead %read | if (<span class="addthis_toolbox addthis_default_style "> isin %read) { set -u1 %Plot $noHTML($v2) | $iif(Source: isin %Plot,set -u1 %Plot $mid($noHTML(%read),1,$pos($noHTML(%read),.Source:))) | $iif(%Plot != $null,$iif(%CHAN,mCuttext $v1,echo -at) 5Summary: $iif(Click Here To Add isin %Plot,Not availible for this episode,%Plot)) } }
;**********************************************************************************************************************************
;*** Dialog section
dialog -l TVSettings {
  title "TVRage Settings"
  size -1 -1 264 217
  option pixels
  box "", 1, 8 8 249 60
  box "", 2, 8 67 249 60
  box "", 3, 8 126 249 43
  box "", 12, 8 168 249 43
  text "Select where you want the Schedule Displayed", 4, 16 21 225 17
  radio "Channel", 5, 32 45 65 13, group
  radio "Private Message", 6, 128 45 105 13,
  text "Select where you want the Replys Displayed", 7, 16 80 225 17
  radio "Channel", 8, 32 104 65 13, group
  radio "Private Message", 9, 128 104 105 13,
  check "Enable TVRage", 10, 32 188 113 13
  button "&Save Settings", 11, 144 182 89 25, ok
  check "Enable Colors", 13, 32 145 113 13
}
on *:dialog:TVSettings:*:*:{
  if ($Devent == init) {
    if (%TV_Where = 1) { did -c $dname 8 }
    else { did -c $dname 9 }
    if (%TV_Where2 = 1) { did -c $dname 5 }
    else { did -c $dname 6 }
    if (%TV_Rage = 1) { did -c $dname 10 }
    else { did -u $dname 10 }
    if (%TV_Color = 1) { did -c $dname 13 }
    else { did -u $dname 13 }
  }
  elseif ($devent == Close) {
    set %TV_Where $iif($Did($Dname,8).state = 1,1,0)
    set %TV_Where2 $iif($Did($Dname,5).state = 1,1,0)      
    set %TV_Rage $iif($Did($Dname,10).state = 1,1,0)
    set %TV_Color $iif($Did($Dname,13).state = 1,1,0)
    echo -at 14TVRage Settings have been saved.
  }
}
dialog -l SelfSearch {
  title "TVRage Search"
  size -1 -1 500 202
  option pixels
  box "", 1, 8 8 486 145
  box "", 2, 8 152 486 43
  text "Search Options:", 3, 16 16 462 17
  text "<Show> (Season and Episode) EX: House 2x05", 4, 30 33 462 17
  text "Schedule <Day of Week> EX: Schedule Fri", 5, 30 50 462 17
  text "Schedule <Day of Week> (Time)  EX: Schedule Wed 10", 6, 30 67 462 17
  text "Schedule <Day of Week> (Time) (Country:US,GB,UK,AU) EX: Schedule Saturday 10 GB", 7, 30 84 462 17
  text "Option in ( ) are Optional. Options in < > are Required.", 8, 30 101 462 17
  edit "", 9, 16 125 462 17, autohs 
  button "Search", 10, 335 165 65 25
  button "Cancel", 11, 414 165 65 25, cancel
}
on *:dialog:SelfSearch:sclick:*:{
  if ($Did = 10) && ($Did(9) = $null) && ($dialog(error,error,-4)) { did -f $Dname 9 }
  elseif ($Did = 10)  { var %Num = $trnum | set %TVRage_Target. [ $+ [ %num ] ] $me | set %TVRage_Nick. [ $+ [ %num ] ] $me | set %TVRage_Chan. [ $+ [ %num ] ] $me | TVRage.Load %num !ep $did(9).text | echo -at Check you Private Message for the infomation that you requested | dialog -x $dname }
}
dialog -l error {
  title "Error"
  size -1 -1 228 90
  option pixels
  box "", 2, 8 8 214 33 
  box "", 3, 8 40 214 43
  button "&Ok", 4, 160 52 50 25, ok
  text "DOH! - You must type something to search for!", 5, 20 20 190 17
}
;*** END TVRage section ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

Comments

Sign in to comment.
SRU   -  Apr 14, 2017

Let Me know if this is something people are still interested in...

 Respond  
commy   -  Sep 23, 2015

So like most people, I've loved using this for years. Alas, tvrage seems to have come to an end. Anyone know of any similar scripts that are working using a different site?

James405  -  Sep 23, 2015

Same here, seems unlikely tvrage will be returning in the near future. Would be amazing to see this ported over to the tvdb

SRU  -  Apr 10, 2016

First of all... sorry for the late reply... haven't really done any coding the last couple of years

Anyways... haven't had a look at TVDB's api... but have made one for TVMaze's api...
Not something I currently wanna share tho... since it's not really user friendly
but will have a look now and see if anything else is out...
if not I might give My script some makeup on and upload a version that's a bit more user friendly then what I'm using

ovelayer  -  May 08, 2017

currently tvmaze is the only working script out as tvrage went down

Sign in to comment

Adjust   -  Mar 10, 2015

Great script. How can I switch this on and off per channel, e.g I don't watch it running for certain channels, But I do want running for others?

ovelayer  -  Mar 10, 2015

on line 13 change
on @:TEXT::#:
to on @:TEXT::#channel1,#channel2,#channel3:
ect..

Adjust  -  Mar 10, 2015

Brilliant, Thanks

Sign in to comment

ovelayer   -  Aug 02, 2014

any chance we can get you to update this for current version of mirc?
perty please =)

SRU  -  Sep 22, 2014

Since I'm most likely never gonna go away from 6.35 I wouldn't count on it... not from Me anyways... sorry

Sign in to comment

xbox_gamer1   -  Jul 12, 2014

SRU can you please add directory / writer and display the airdate like July 12, 2014?

SRU  -  Sep 22, 2014

Well adding the director and writer could be done... but thinking it would slow down the script.
But getting air date format listed the way you want shouldn't be too hard

Sign in to comment

SRU   -  Mar 31, 2013

Here the schedule is completely removed

Sorry for the late reply... let Me know if this fixed your problem or you still having issues @stone

ovelayer  -  Apr 02, 2013

you didnt remove it from the triggers command lol :P

SRU  -  Apr 02, 2013

Yes I did ?

ovelayer  -  Apr 02, 2013

[4:36pm] - !SHOW EX: !SHOW House ooO( Get show description )
[4:36pm] - !N / !L EX: !N Ideal / !L Ideal ooO( Get information for next / last episode )
[4:36pm] - !EP (Season and Episode) EX: !EP The IT Crowd 3x05 ooO( Get general show information and episode summary (if season and episode is given) )
[4:36pm] - !EP Schedule (Time) (Country) EX: !EP Schedule Fri 10 AU Country: GB, UK and AU (US by default) ooO( Get program schedule for the requested day (Time and/or Country) )
[4:36pm] - NOTE: Options in ( ) are optional... and options in < > are required.

SRU  -  Apr 02, 2013

FiXeD

Sign in to comment

stone   -  Mar 08, 2013

Ok so I am using mIRC 7.22, this works well BUT, the moment I type !today and it pm's the schedule... any command after that keeps saying the same message. !tv arrow (pm'ing schedule to so and so regardless of the command). I also got this error:

  • /fopen: name 'Saturday' in use (line 202, tvrage.ini)

Hope that helps

SRU  -  Mar 10, 2013

Might be version error... I can't replicate your error... just tried and everything working like it should.
!Today (The command typed in channel and the PM from the BOT afterwards)
Image
!TV Arrow
Image
Both working like they should here

Sign in to comment

ovelayer   -  Mar 07, 2013

when i do !tv schedule or !ep schedule it will work the first time but if i try to use them again i get
fopen: name 'Thursday' in use (line 202, tv2.mrc)
if i do !today or !tomorrow i get

  • /fclose: invalid parameters (line 138, tv2.mrc)

thought you should know..
everything else works perfectly!

 Respond  
ovelayer   -  Feb 24, 2013

dont know if its the script or tvrage.com but i get
Last Episode 03x10 -#- Home Aired: Ãysdays ago (17/02/2013)
its not displaying correctly like 6ays 7hours 6secs anymore

ovelayer  -  Feb 25, 2013

had to be the script went back to the one you had just before this update and now it works fine again

SRU  -  Feb 26, 2013

Sorry for that... forgot to test everything before I posted trigger fix and apparently got error when I copy/pasted it from here to edit.
But should be fixed now... was %days that for some reason had changed to Ã?YS but fixed now... working here anyways :D

ovelayer  -  Feb 26, 2013

thank you all better now!

Sign in to comment

ovelayer   -  Feb 24, 2013

what about just using tvguide.com?

SRU  -  Feb 26, 2013

Might be possible... but can't seem to find the correct link for pulling iNFO but will look into it later on.

Sign in to comment

SRU   -  Feb 23, 2013

I don't know but don't think so since all the scripts I've seen is running on TVRage and they only list TV-Shows not movies.
I like the idea... but not something I'll be coding unless you know of a site that has movie listing and/or offers both ?

ovelayer  -  Feb 23, 2013

i sure don't ..was just an idea

Sign in to comment

ovelayer   -  Feb 23, 2013

has anyone ever made an option in the tv schedule where it could output the movies showing on channels?..
i like that it only shows new episodes but if it would also show any movies that are showing on the network would be epic

 Respond  
SRU   -  Feb 23, 2013

Updated
I fixed the trigger "error" showing the "wrong" triggers.
Will now show the trigger used to activate instead of ! no mater what

ovelayer  -  Feb 23, 2013

thanks alot!

Sign in to comment

ovelayer   -  Feb 18, 2013

any chance on an update for this script? it is one of the better rage scripts but it will cause bot to ping out if people want schedules and the help triggers doesn't show the correct triggers that this script uses..

SRU  -  Feb 23, 2013

I'll get on triggers error right now.

But there isn't much I can do about the schedule...
I personally only use the schedule on the servers My bot is a oper on.

Sign in to comment

SRU   -  Aug 27, 2012

@jasonh iDK... am running 6.35 Myself... but have been told it's working on 7.20... so a update might fix your problem
@James405 Must be version issue... I get only next when doing !N and I got show info when doing !SHOW... neither anything like !TV
@hxck Thanks :D
@x714x This must be because you have aliaes named the same... darkengine doesn't activate it here anyways

 Respond  
x714x   -  Aug 07, 2012

Script is randomly triggered from other stuff, i.e. system info script.

Here darkengine triggers it... http://picpit.net/images/A4cbV.jpg

 Respond  
hxck   -  Jul 20, 2012

Looks good man, nice job.

 Respond  
James405   -  Jul 10, 2012

just an update... the problem occurs when using the script from the client its loaded from! if I get someone else to type !show dexter for example it works as described but if I type !show dexter it acts as if I typed !tv dexter

 Respond  
James405   -  Jul 10, 2012

working fine for me! only issue I've just noticed is that no matter what command I use (!tv !show !n etc) I get the response of !tv. I only noticed as I wanted to use the !show command to show the summary but could not get it to work!

Also how would you feel about a !sum command to just respond with the show summary?

Thanks for the script! :)

 Respond  
jasonh   -  Jul 08, 2012

still not working on mirc 7.19

not sure if this is because of the tvrage API issue or the script's issue.
i used another less robust script and it could pull the info.

now whenever i do a command it spits out PM'iNG #chat the program schedule for Sunday (US)

 Respond  
SRU   -  Jun 27, 2012

Working again :D

 Respond  
Demolution   -  Jun 26, 2012

Another update...

We're expecting to be back in the next couple of days.

TVR

 Respond  
Demolution   -  Jun 23, 2012

damn site is still down for maintenance!! feel naked without the script

 Respond  
SRU   -  Jun 21, 2012

Narh... "just" site that's currently down...
If they are doing updates and current script isn't working afterwards I'll post new as soon as I've re-coded it ;)

 Respond  
chachin   -  Jun 21, 2012

well it looks like script stopped working :(

 Respond  
SRU   -  Jun 17, 2012

Today's schedule, or... ?

Just tried today's schedule without any problems... ooO( Am using Ver. 6.35 )

 Respond  
jasonh   -  Jun 17, 2012

i get this error msg when trying to display the schedule.
subsequent attempts at any of the commands tells me it is pming the channel the schedule even though i dont use the schedule command

http://i.imgur.com/nvHXY.png

 Respond  
SRU   -  Jun 11, 2012

Glad you like it @unforgiving
And I use a "slightly" edited version of the IMDB snippet posted here by @FordLawnmower
But what you mean exactly ?

 Respond  
unforgiving   -  Jun 10, 2012

Dude thanks for the script, its awesome, but I've request, can you make a updated IMDB script that really works like the your tvrage script ?

 Respond  
SRU   -  Jun 06, 2012

Thanks @chachin and thanks for the like
Am glad you finding it useful ;)

 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.