Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- ;script !nfl Script
- ;version 27NOV2014 Turkey Day Edition!
- ;author mruno
- ;email mruno@ircN.org
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- ;
- ;to disable team colors, change alias -l NFL.team.colors return 0
- ;to enable team colors, change alias -l NFL.team.colors return 1
- ;
- ;to enable !scorealert, change alias -l NFL.scorealert.enable return 1
- ;to disable !scorealert, change alias -l NFL.scorealert.enable return 0
- ;
- ;
- ;to show !scorealert like:
- ; [!ScoreAlert] NFL Philadelphia Eagles scored 6 points on Dallas Cowboys!
- ; Philadelphia Eagles at Dallas Cowboys New Score: 27 to 7 Status: Halftime
- ;change alias -l NFL.scorealert.two.lines return 1
- ;
- ;to show !scorealert like:
- ; [!ScoreAlert] NFL Philadelphia Eagles at Dallas Cowboys New Score: 27 to 7 Status: Halftime
- ;change alias -l NFL.scorealert.two.lines return 0
- ;
- ;######################################################
- ;
- alias -l NFL.team.colors return 0
- alias -l NFL.scorealert.enable return 1
- alias -l NFL.scorealert.two.lines return 1
- ;
- ;######################################################
- ;
- ;
- alias -l set.correct.network {
- if ($1) {
- var %loop 0
- while ($scon(0) > %loop) {
- inc %loop
- if ($scon(%loop).network == $1) {
- scon %loop
- break
- }
- }
- }
- }
- on 1:PART:#:{
- if ($hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))) {
- hdel NFL.get.scores.nfl.alert $+($nick,.,$network,.,$chan)
- msg $nick Your NFL ScoreAlert has been deleted for parting.
- }
- }
- on 1:JOIN:#:if ($timer(NFL.get.scores.nfl.remove.alert. $+ $+($nick,.,$network,.,$chan))) .timerNFL.get.scores.nfl.remove.alert. $+ $+($nick,.,$network,.,$chan) off
- on 1:KICK:#:if ($hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))) .timerNFL.get.scores.nfl.remove.alert. $+ $+($nick,.,$network,.,$chan) 1 120 hdel NFL.get.scores.nfl.alert $+($nick,.,$network,.,$chan)
- on 1:QUIT:if ($hget(NFL.get.scores.nfl.alert)) hdel -w NFL.get.scores.nfl.alert $nick $+ .*
- on 1:NICK:{
- if ($hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))) {
- hadd NFL.get.scores.nfl.alert $newnick $+ . $+ $chan $hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))
- hdel NFL.get.scores.nfl.alert $+($nick,.,$network,.,$chan)
- }
- }
- on 1:TEXT:?scorealert*:#:{
- if ($chr(36) isin $2-) return
- if (!$NFL.scorealert.enable) return
- if ($2 != NFL) {
- .timerscorealertNFL 1 2 .notice $nick For NFL scorealerts, Type !scorealert NFL <team>
- halt
- }
- if ($3 == off) {
- if ($hget(NFL.get.scores.NFL.alert $+($nick,.,$network,.,$chan))) hdel NFL.get.scores.NFL.alert $+($nick,.,$network,.,$chan)
- .notice $nick Deleted your ScoreAlert.
- return
- }
- if ($4 == off) {
- if ($hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))) || ($nick isop $chan) {
- if ($team.lookup($3)) {
- if ($hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))) {
- hdel NFL.get.scores.nfl.alert $+($nick,.,$network,.,$chan)
- .notice $nick Deleted your ScoreAlert for $3
- return
- }
- if ($nick isop $chan) {
- var %a = 0
- while (%a < $hfind(NFL.get.scores.nfl.alert,* $+ $team.lookup($3) $+ *,0,w).data) {
- inc %a
- if ($gettok($hfind(NFL.get.scores.nfl.alert,* $+ $team.lookup($3) $+ *,%a,w).data,2,46) == $chan) {
- hdel NFL.get.scores.nfl.alert $hfind(NFL.get.scores.nfl.alert,* $+ $team.lookup($3) $+ *,%a,w).data
- .notice $nick Deleted ScoreAlert for $3
- return
- }
- }
- }
- }
- else .notice $nick Invalid team name.
- }
- return
- }
- else {
- if (%NFL.get.scores.nfl.ON) || ($hget(NFL.get.scores)) {
- .timerNFL. $+ $nick 1 3 .notice $nick Please try again in 1 minute.
- if (!$timer(NFL.get.scores.nfl.Timeout)) .timerNFL.get.scores.nfl.Timeout 1 15 NFL.get.scores.nfl.Timeout 1
- halt
- }
- if ($3) {
- if ($team.lookup($3)) {
- if ($hget(NFL.get.scores.nfl.alert,$+($nick,.,$network,.,$chan))) .notice $nick Your current scorealert $paren($gettok($v1,1,187)) will be overwritten.
- set %NFL.get.scores.nfl.TEMP.info scorealert
- set %NFL.get.scores.nfl.TEMP.search $team.lookup($3)
- set %NFL.get.scores.nfl.TEMP.chan $chan
- set %NFL.get.scores.nfl.TEMP.nick $nick
- NFL.get.scores
- }
- else .notice $nick Invalid team name.
- }
- else .notice $nick Please specify a team.
- }
- }
- on 1:TEXT:?nfl*:#:{
- if ($chr(36) isin $2-) return
- set %NFL.get.scores.nfl.TEMP.chan $chan
- set %NFL.get.scores.nfl.TEMP.nick $nick
- if (%NFL.get.scores.nfl.ON) || ($hget(NFL.get.scores)) {
- .timerNFL.spam. $+ nick 1 3 .notice %NFL.get.scores.nfl.TEMP.nick Please try again in 1 minute.
- if (!$timer(NFL.get.scores.nfl.Timeout)) .timerNFL.get.scores.nfl.Timeout 1 15 NFL.get.scores.nfl.Timeout 1
- }
- else {
- if ($2 == all) || ($2 == final) || ($2 == current) || ($2 == upcoming) || ($2 == now) set %NFL.get.scores.nfl.TEMP.info $iif($2 == now,current,$2)
- elseif ($2 == Sunday) || ($2 == Monday) || ($2 == Tuesday) || ($2 == Wednesday) || ($2 == Thursday) || ($2 == Friday) || ($2 == Saturday) || ($2 == Today) || ($2 == Tomorrow) || ($2 == Yesterday) {
- set %NFL.get.scores.nfl.TEMP.info search
- if ($2 == today) set %NFL.get.scores.nfl.TEMP.search $asctime($ctime,dddd)
- elseif ($2 == tomorrow) set %NFL.get.scores.nfl.TEMP.search $asctime($calc(86400 + $ctime),dddd)
- elseif ($2 == yesterday) set %NFL.get.scores.nfl.TEMP.search $asctime($calc($ctime - 86400),dddd)
- else set %NFL.get.scores.nfl.TEMP.search $2
- }
- elseif ($team.lookup($2)) {
- set %NFL.get.scores.nfl.TEMP.info search
- set %NFL.get.scores.nfl.TEMP.search $ifmatch
- }
- elseif (search isin $2) {
- if ($3) {
- if ($3 == Sunday) || ($3 == Monday) || ($3 == Tuesday) || ($3 == Wednesday) || ($3 == Thursday) || ($3 == Friday) || ($3 == Saturday) || ($3 == Today) || ($3 == Tomorrow) || ($3 == Yesterday) {
- set %NFL.get.scores.nfl.TEMP.info search
- if ($3 == today) set %NFL.get.scores.nfl.TEMP.search $asctime($ctime,dddd)
- elseif ($3 == tomorrow) set %NFL.get.scores.nfl.TEMP.search $asctime($calc(86400 + $ctime),dddd)
- elseif ($3 == yesterday) set %NFL.get.scores.nfl.TEMP.search $asctime($calc($ctime - 86400),dddd)
- else set %NFL.get.scores.nfl.TEMP.search $3
- }
- elseif ($team.lookup($3)) {
- set %NFL.get.scores.nfl.TEMP.info search
- set %NFL.get.scores.nfl.TEMP.search $team.lookup($3)
- }
- else { .notice $nick Invalid search item. Try a team name or the day of the week. | halt }
- }
- }
- elseif ($2) { .notice $nick Invalid option, team name, or day of the week. Try $1 Current or $1 Final or $1 Search <team> or $1 Search <day> or $1 Upcoming | halt }
- if (!$2) {
- .timer 1 3 .notice $nick You can also use the following options: Current, Final, Search <team>, and Upcoming. Example: $1 Search 49ers
- .timer 1 3 .notice $nick Or you can have scores messaged to the channel by using: !ScoreAlert NFL <team>
- }
- if (!%NFL.get.scores.nfl.TEMP.info) set %NFL.get.scores.nfl.TEMP.info $iif($2,$2,all)
- set %NFL.get.scores.nfl.TEMP.chan $chan
- set %NFL.get.scores.nfl.TEMP.nick $nick
- NFL.get.scores
- }
- }
- alias NFL.get.scores.nfl.msg {
- if (%NFL.get.scores.nfl.TEMP.chan) msg %NFL.get.scores.nfl.TEMP.chan $1-
- }
- alias NFL.get.scores {
- if (%NFL.get.scores.nfl.TEMP.nick) .notice %NFL.get.scores.nfl.TEMP.nick !NFL by mruno gathering data, please wait...
- if ($sock(NFL.get.scores)) sockclose NFL.get.scores
- set -u45 %NFL.get.scores.nfl.ON 1
- if (!$hget(NFL.get.scores)) hmake NFL.get.scores
- sockopen NFL.get.scores scores.covers.com 80
- .timerNFL.get.scores.nfl.Timeout 1 30 NFL.get.scores.nfl.Timeout
- }
- alias NFL.get.scores.nfl.Timeout {
- if (%NFL.get.scores.nfl.TEMP.info != alert.check) && (!$1) NFL.get.scores.nfl.msg Error: The NFL request timed out. Please try again later. :(
- NFL.get.scores.nfl.Close
- }
- alias NFL.get.scores.nfl.alert.check {
- if (!$hget(NFL.get.scores.nfl.options)) hmake NFL.get.scores.nfl.options
- if (!$hget(NFL.get.scores.nfl.options,alert.check)) hadd NFL.get.scores.nfl.options alert.check 1
- else {
- if ($hget(NFL.get.scores.nfl.options,alert.check) > 2) && (!%NFL.get.scores.nfl.ON) {
- ;check for updated scores
- set %NFL.get.scores.nfl.TEMP.info alert.check
- hadd NFL.get.scores.nfl.options alert.check 0
- NFL.get.scores
- }
- else hinc NFL.get.scores.nfl.options alert.check
- }
- if (!$hget(NFL.get.scores.nfl.alert,0).item) {
- .timerNFL.get.scores.nfl.alert off
- hfree NFL.get.scores.nfl.alert
- hfree NFL.get.scores.nfl.options
- }
- }
- alias NFL.get.scores.nfl.scorealert {
- if (!$1) return
- if (!$hget(NFL.get.scores.nfl.alert)) hmake NFL.get.scores.nfl.alert
- if ($hget(NFL.get.scores.nfl.alert,%NFL.get.scores.nfl.TEMP.nick)) NFL.get.scores.nfl.msg %NFL.get.scores.nfl.TEMP.nick $+ $chr(44) You can only can track one NFL team at a time.
- else {
- ;team»Current»Today»Now»Oakland at Denver»Pre-game »null:null
- hadd NFL.get.scores.nfl.alert %NFL.get.scores.nfl.TEMP.nick $+ . $+ %NFL.get.scores.nfl.TEMP.chan $+($gettok($1-,1,187),$chr(187),$gettok($1-,7,187))
- NFL.get.scores.nfl.msg 0,2 NFL Now monitoring:12 $gettok($1-,5,187) Score:12 $replace( $+ $gettok($1-,7,187),:,$chr(32) to $chr(32),null,0)
- ;.notice %NFL.get.scores.nfl.TEMP.nick If you leave this channel, score alerts will be disabled.
- if (!$timer(NFL.get.scores.nfl.alert)) .timerNFL.get.scores.nfl.alert 0 60 NFL.get.scores.nfl.alert.check
- }
- }
- alias NFL.get.scores.nfl.End {
- var %a = 0, %item, %items, %team1, %team2, %data
- ;scorealert
- if ($hget(NFL.get.scores.nfl.alert)) {
- while ($hget(NFL.get.scores.nfl.alert,0).item > %a) {
- inc %a
- set %item $hget(NFL.get.scores.nfl.alert,%a).item
- set %data $hget(NFL.get.scores.nfl.alert,%a).data
- var %newdata $hget(NFL.get.scores,$hfind(NFL.get.scores,* $+ $gettok(%data,1,187) $+ *,1,w).data)
- if (%newdata) {
- if ($gettok(%newdata,1,187) == final) {
- ;msg final score here
- ;check and see if score alert is still needed
- ;Current»Today»Now»Oakland at Denver»Pre-game »null:null
- var %sep $iif(vs isin $gettok(%newdata,4,187),vs,at)
- var %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%newdata,4,187),1- $+ $calc($findtok($gettok(%newdata,4,187),%sep,1,32) - 1),32))
- var %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%newdata,4,187),$calc($findtok($gettok(%newdata,4,187),%sep,1,32) + 1) $+ -,32))
- if (%team isin %team1) var %team0 %team1
- else var %team0 %team2
- set %team1 $remove($strip(%team1),[,],)
- set %team2 $remove($strip(%team2),[,],)
- var %teams, %winner
- if ($gettok($replace($gettok(%newdata,5,187),null,0),1,58) > $gettok($replace($gettok(%newdata,5,187),null,0),2,58)) {
- set %teams $+ %team1 $+ at %team2 $+
- set %winner $strip(%team1)
- }
- elseif ($gettok($replace($gettok(%newdata,5,187),null,0),1,58) < $gettok($replace($gettok(%newdata,5,187),null,0),2,58)) {
- set %teams %team1 at %team2 $+
- set %winner $strip(%team2)
- }
- else set %teams %team1 at %team2
- var %rand $rand(1,10)
- .timerScoreAlert. $+ $gettok(%item,2,46) $+ . $+ $replace(%Teams,$chr(32),.) 1 %rand msg $gettok(%item,2,46) 0,2 NFL 4Final: %teams 12Score:2 $replace( $+ $gettok(%newdata,5,187),:,$chr(32) to $chr(32),null,0)
- .msg $gettok(%item,1,46) 0,2 NFL 4Final: %teams 12Score:2 $replace( $+ $gettok(%newdata,5,187),:,$chr(32) to $chr(32),null,0)
- hdel NFL.get.scores.nfl.alert %item
- }
- else {
- if ($gettok(%newdata,6,187) != $gettok(%data,2,187)) {
- var %sep $iif(vs isin $gettok(%newdata,4,187),vs,at)
- var %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%newdata,4,187),1- $+ $calc($findtok($gettok(%newdata,4,187),%sep,1,32) - 1),32))
- var %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%newdata,4,187),$calc($findtok($gettok(%newdata,4,187),%sep,1,32) + 1) $+ -,32))
- if (%team isin %team1) var %team0 %team1
- else var %team0 %team2
- set %team1 $remove($strip(%team1),[,],)
- set %team2 $remove($strip(%team2),[,],)
- var %team1.old.score $gettok($gettok(%data,2,187),1,58)
- var %team1.new.score $gettok($gettok(%newdata,6,187),1,58)
- var %team2.old.score $gettok($gettok(%data,2,187),2,58)
- var %team2.new.score $gettok($gettok(%newdata,6,187),2,58)
- var %teams
- if (%team1.new.score > %team2.new.score) set %teams $+ %team1 $+ at %team2
- elseif (%team2.new.score > %team1.new.score) set %teams %team1 at $+ %team2 $+
- else set %teams %team1 at %team2
- ;.timerScoreAlert. $+ $gettok(%item,2,46) $+ . $+ $replace(%Teams,$chr(32),.) 1 $timer(0) msg $gettok(%item,2,46)
- if ($NFL.scorealert.two.lines) {
- if (%team1.old.score != %team1.new.score) .timerScoreAlert.1. $+ $gettok(%item,2,46) $+ . $+ $replace(%Teams,$chr(32),.) 1 $timer(0) msg $gettok(%item,2,46) 4[!ScoreAlert] 0,2 NFL %team1 scored $+ $calc(%team1.new.score - %team1.old.score) $iif($calc(%team1.new.score - %team.old.score) == 1,point,points) on the %team2 $+ !
- else .timerScoreAlert.1. $+ $gettok(%item,2,46) $+ . $+ $replace(%Teams,$chr(32),.) 1 $timer(0) msg $gettok(%item,2,46) 4[!ScoreAlert] 0,2 NFL %team2 scored $+ $calc(%team2.new.score - %team2.old.score) $iif($calc(%team2.new.score - %team2.old.score) == 1,point,points) on the %team1 $+ !
- }
- ;.timerScoreAlert.2. $+ $gettok(%item,2,46) $+ . $+ $replace(%Teams,$chr(32),.) 1 $timer(0) msg $gettok(%item,2,46) 4[!ScoreAlert] 0,2 NFL %teams 12 New Score:2 $replace( $+ $gettok(%newdata,6,187),:,$chr(32) to $chr(32),null,0) 14 Status:3 $gettok(%newdata,5,187)
- .timerScoreAlert.2. $+ $gettok(%item,2,46) $+ . $+ $replace(%Teams,$chr(32),.) 1 $timer(0) msg $gettok(%item,2,46) $iif(!$NFL.scorealert.two.lines, 4[!ScoreAlert] 2 NFL ) %teams 12 New Score:2 $replace( $+ $gettok(%newdata,6,187),:,$chr(32) to $chr(32),null,0) 14 Status:3 $gettok(%newdata,5,187)
- hadd NFL.get.scores.nfl.alert %item $gettok(%data,1,187) $+ $chr(187) $+ $gettok(%newdata,6,187)
- }
- }
- }
- }
- }
- if (%NFL.get.scores.nfl.TEMP.info == alert.check) {
- if ($hget(NFL.get.scores)) hfree NFL.get.scores
- unset %NFL.get.scores*
- sockclose NFL.get.scores
- return
- }
- if (%NFL.get.scores.nfl.TEMP.info == scorealert) && (%NFL.get.scores.nfl.TEMP.search) {
- if ($hget(NFL.get.scores,$hfind(NFL.get.scores,*current* $+ %NFL.get.scores.nfl.TEMP.search $+ *,1,w).data)) {
- NFL.get.scores.nfl.scorealert %NFL.get.scores.nfl.TEMP.search $+ $chr(187) $+ $ifmatch
- .notice %NFL.get.scores.nfl.TEMP.nick Your ScoreAlert will be disabled if you leave %NFL.get.scores.nfl.TEMP.chan or by typing 12!ScoreAlert NFL off
- }
- else NFL.get.scores.nfl.msg %NFL.get.scores.nfl.TEMP.nick $+ $chr(44) please choose an NFL game that is currently playing. $iif($hfind(NFL.get.scores,*upcoming* $+ %NFL.get.scores.nfl.TEMP.search $+ *,1,w).data,%NFL.get.scores.nfl.TEMP.search plays on12 $gettok($hget(NFL.get.scores,$ifmatch),2,187) at $gettok($hget(NFL.get.scores,$ifmatch),3,187))
- }
- ;team search
- if (%NFL.get.scores.nfl.TEMP.info == search) && (%NFL.get.scores.nfl.TEMP.search) {
- var %a = 0, %item, %items, %team0, %team1, %team2, %team = %NFL.get.scores.nfl.TEMP.search
- set %item $hget(NFL.get.scores,$hfind(NFL.get.scores,* $+ %team $+ *,1,w).data)
- if (!%item) {
- NFL.get.scores.nfl.msg Sorry, there are no NFL games found for: %team
- NFL.get.scores.nfl.Close
- return
- }
- if (%team == Sunday) || (%team == Monday) || (%team == Tuesday) || (%team == Wednesday) || (%team == Thursday) || (%team == Friday) || (%team == Saturday) || (%team == Today) || (%team == Tomorrow) || (%team == Yesterday) {
- ;Day Search
- var %a = 0, %games, %temp
- while ($hfind(NFL.get.scores,* $+ %team $+ *,0,w).data > %a) {
- inc %a
- if (%a == 1) NFL.get.scores.nfl.msg 0,2 NFL $gettok(%item,2,187) $+ :
- set %temp $gettok($hfind(NFL.get.scores,* $+ %team $+ *,%a,w).data,2,46)
- if ($len(%temp) == 1) set %temp 0 $+ %temp
- set %games $addtok(%temp,%games,32)
- }
- set %games $sorttok(%games,32)
- set %a 0
- var %game
- while ($gettok(%games,0,32) > %a) {
- inc %a
- set %game NFL. $+ $iif($left($gettok(%games,%a,32),1) == 0,$right($gettok(%games,%a,32),1),$gettok(%games,%a,32))
- set %item $hget(NFL.get.scores,%game)
- if ($gettok(%item,1,187) == Upcoming) NFL.get.scores.nfl.upcoming %item
- elseif ($gettok(%item,1,187) == Final) {
- NFL.get.scores.nfl.final %item
- }
- elseif ($gettok(%item,1,187) == Current) {
- NFL.get.scores.nfl.current %item
- }
- }
- ;end of loop
- }
- elseif ($gettok(%item,1,187) == upcoming) {
- set %team %NFL.get.scores.nfl.TEMP.search
- var %sep $iif(vs isin $gettok(%item,4,187),vs,at)
- set %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),1- $+ $calc($findtok($gettok(%item,4,187),%sep,1,32) - 1),32))
- set %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),$calc($findtok($gettok(%item,4,187),%sep,1,32) + 1) $+ -,32))
- if (%team isin %team1) set %team0 %team1
- else set %team0 %team2
- var %consensus
- if ($chr(37) isin $remove($gettok(%item,7,187),$chr(32))) {
- if ($remove($gettok(%item,7,187),$chr(32)) == $remove($gettok(%item,9,187),$chr(32))) set %consensus Dead Even
- elseif ($remove($gettok(%item,7,187),$chr(37)) > $remove($gettok(%item,9,187),$chr(37))) set %consensus $+ $remove($gettok($strip(%team1),$iif(!$team.colors,-1,-2),32),]) $+ $paren($remove($gettok(%item,7,187),$chr(32))) 14over $remove($gettok($strip(%team2),$iif(!$team.colors,-1,-2),32),]) $paren($remove($gettok(%item,9,187),$chr(32)))
- elseif ($remove($gettok(%item,7,187),$chr(37)) < $remove($gettok(%item,9,187),$chr(37))) set %consensus $+ $remove($gettok($strip(%team2),$iif(!$team.colors,-1,-2),32),]) $+ $paren($remove($gettok(%item,9,187),$chr(32))) 14over $remove($gettok($strip(%team1),$iif(!$team.colors,-1,-2),32),]) $paren($remove($gettok(%item,7,187),$chr(32)))
- }
- NFL.get.scores.nfl.msg 0,2 NFL %team0 14Record:12 $iif($gettok($gettok(%item,$iif($gettok(%team,0,32) == 1,4,4-5),187),1,32) isin $strip(%team0),$gettok(%item,6,187),$gettok(%item,$iif(%consensus,8,7),187))
- NFL.get.scores.nfl.msg 14Next game:12 $gettok(%item,4,187) 14 $paren( $+ $gettok(%item,2,187) @ $gettok(%item,3,187) $+ 14) $iif(%consensus,14Consensus: %consensus)
- }
- elseif ($gettok(%item,1,187) == final) {
- var %sep $iif(vs isin $gettok(%item,4,187),vs,at)
- set %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),1- $+ $calc($findtok($gettok(%item,4,187),%sep,1,32) - 1),32))
- set %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),$calc($findtok($gettok(%item,4,187),%sep,1,32) + 1) $+ -,32))
- if (%team isin %team1) set %team0 %team1
- else set %team0 %team2
- set %team1 $remove($strip(%team1),[,],)
- set %team2 $remove($strip(%team2),[,],)
- var %teams
- if ($gettok($replace($gettok(%item,5,187),null,0),1,58) > $gettok($replace($gettok(%item,5,187),null,0),2,58)) set %teams $+ %team1 $+ at %team2 $+
- elseif ($gettok($replace($gettok(%item,5,187),null,0),1,58) < $gettok($replace($gettok(%item,5,187),null,0),2,58)) set %teams %team1 at %team2 $+
- else set %teams %team1 at %team2
- NFL.get.scores.nfl.msg 0,2 NFL %team0 Last game:12 $gettok(%item,2,187)
- NFL.get.scores.nfl.msg %teams - Score: $replace($gettok(%item,5,187),null,0,:,$chr(32) to $chr(32)) - $paren(12FINAL)
- }
- elseif ($gettok(%item,1,187) == current) {
- set %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),1- $+ $calc($findtok($gettok(%item,4,187),%sep,1,32) - 1),32))
- set %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),$calc($findtok($gettok(%item,4,187),%sep,1,32) + 1) $+ -,32))
- if (%team isin %team1) set %team0 %team1
- else set %team0 %team2
- set %team1 $remove($strip(%team1),[,],)
- set %team2 $remove($strip(%team2),[,],)
- var %teams
- if ($gettok($replace($gettok(%item,5,187),null,0),1,58) > $gettok($replace($gettok(%item,5,187),null,0),2,58)) set %teams $+ %team1 $+ at %team2 $+
- elseif ($gettok($replace($gettok(%item,5,187),null,0),1,58) < $gettok($replace($gettok(%item,5,187),null,0),2,58)) set %teams %team1 at %team2 $+
- else set %teams %team1 at %team2
- NFL.get.scores.nfl.msg 0,2 NFL %team0 14Currently playing: $replace($gettok(%item,4,187),at,14@)
- NFL.get.scores.nfl.msg 14Score:12 $replace($gettok(%item,6,187),null,0,:,$chr(32) to $chr(32)) 14Status:12 $gettok(%item,5,187) $iif(%NFL.get.scores.nfl.TEMP.GameStatus,- %NFL.get.scores.nfl.TEMP.GameStatus)
- }
- }
- if (%NFL.get.scores.nfl.TEMP.info == all) || (%NFL.get.scores.nfl.TEMP.info == current) {
- ;gathers all the CURRENT games
- while (%a < $hget(NFL.get.scores,0).item) {
- inc %a
- set %item $hget(NFL.get.scores,%a).item
- if ($gettok($hget(NFL.get.scores,%item),1,187) == Current) set %items $addtok(%items,%item,44)
- }
- ;echoes all the CURRENT games
- ;Current»Today»Now»Oakland at Denver»Pre-game »null:null
- set %a 0
- set %item
- if (%items) {
- NFL.get.scores.nfl.msg 0,2 NFL Games 12currently playing:
- while (%a < $gettok(%items,0,44)) {
- inc %a
- ;if (%a == 1) NFL.get.scores.nfl.msg 0,2 NFL
- set %item $hget(NFL.get.scores,$gettok(%items,%a,44))
- NFL.get.scores.nfl.current %item
- }
- }
- else {
- if (%NFL.get.scores.nfl.TEMP.info == current) NFL.get.scores.nfl.msg There are currently no NFL games being played.
- }
- }
- if (%NFL.get.scores.nfl.TEMP.info == all) || (%NFL.get.scores.nfl.TEMP.info == final) {
- ;gathers all the FINAL games
- ;Final»Thursday September 19 2013»0»Kansas City at Philadelphia »26:16
- set %a 0
- set %item
- set %items
- while (%a < $hget(NFL.get.scores,0).item) {
- inc %a
- set %item $hget(NFL.get.scores,%a).item
- if ($gettok($hget(NFL.get.scores,%item),1,187) == FINAL) set %items $addtok(%items,%item,44)
- }
- ;echoes all the FINAL games
- set %a 0
- set %item
- if (%items) {
- while (%a < $gettok(%items,0,44)) {
- inc %a
- set %item $hget(NFL.get.scores,$gettok(%items,%a,44))
- if (%a == 1) NFL.get.scores.nfl.msg 0,2 NFL
- NFL.get.scores.nfl.final %item
- }
- }
- else {
- if (%NFL.get.scores.nfl.TEMP.info == final) NFL.get.scores.nfl.msg There are currently no NFL final games for this week.
- }
- }
- if (%NFL.get.scores.nfl.TEMP.info == all) || (%NFL.get.scores.nfl.TEMP.info == upcoming) {
- ; Upcoming»Monday September 23 2013»8:40p ET»Oakland at Denver» »1-1 (0-1 V) »36% »2-0 (1-0 H) »64%
- var %a = 1, %data, %last, %item, %total = 0
- while ($hget(NFL.get.scores,NFL. $+ %a)) {
- set %data $hget(NFL.get.scores,NFL. $+ %a)
- if (upcoming isin $gettok(%data,1,187)) {
- if (%last != $gettok(%data,2,187)) NFL.get.scores.nfl.msg 0,2 NFL $gettok(%data,2,187) $+ :
- inc %total
- NFL.get.scores.nfl.upcoming %data
- }
- set %last $gettok(%data,2,187)
- inc %a
- }
- if (!%total) && (%NFL.get.scores.nfl.TEMP.info == upcoming) NFL.get.scores.nfl.msg There are no more NFL upcoming games for this week.
- }
- .timerNFL.get.scores.nfl.Close 1 15 NFL.get.scores.nfl.Close
- }
- alias NFL.get.scores.nfl.final {
- if (!$1) return
- var %item = $1-, %team1, %team2
- var %sep $iif(vs isin $gettok(%item,4,187),vs,at)
- set %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),1- $+ $calc($findtok($gettok(%item,4,187),%sep,1,32) - 1),32))
- set %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),$calc($findtok($gettok(%item,4,187),%sep,1,32) + 1) $+ -,32))
- var %teams
- if ($gettok($replace($gettok(%item,5,187),null,0),1,58) > $gettok($replace($gettok(%item,5,187),null,0),2,58)) set %teams $+ %team1 $+ 14@ %team2 $+
- elseif ($gettok($replace($gettok(%item,5,187),null,0),1,58) < $gettok($replace($gettok(%item,5,187),null,0),2,58)) set %teams %team1 14@ $+ %team2 $+
- else set %teams %team1 14@ %team2
- NFL.get.scores.nfl.msg %teams 14 Score:12 $replace($gettok(%item,5,187),null,0,:,$chr(32) 14to12 $chr(32)) 14 Status:4 FINAL
- }
- alias NFL.get.scores.nfl.upcoming {
- if (!$1) return
- var %item = $1-
- var %sep $iif(vs isin $gettok(%item,4,187),vs,at)
- var %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),1- $+ $calc($findtok($gettok(%item,4,187),%sep,1,32) - 1),32))
- var %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),$calc($findtok($gettok(%item,4,187),%sep,1,32) + 1) $+ -,32))
- var %consensus
- if ($chr(37) isin $remove($gettok(%item,7,187),$chr(32))) {
- if ($remove($gettok(%item,7,187),$chr(32)) == $remove($gettok(%item,9,187),$chr(32))) set %consensus Dead Even
- elseif ($remove($gettok(%item,7,187),$chr(37)) > $remove($gettok(%item,9,187),$chr(37))) set %consensus $+ $remove($gettok($strip(%team1),$iif(!$team.colors,-1,-2),32),]) $+ $paren($remove($gettok(%item,7,187),$chr(32))) $+ 14over $remove($gettok($strip(%team2),$iif(!$team.colors,-1,-2),32),]) $paren($remove($gettok(%item,9,187),$chr(32)))
- elseif ($remove($gettok(%item,7,187),$chr(37)) < $remove($gettok(%item,9,187),$chr(37))) set %consensus $+ $remove($gettok($strip(%team2),$iif(!$team.colors,-1,-2),32),]) $+ $paren($remove($gettok(%item,9,187),$chr(32))) $+ 14over $remove($gettok($strip(%team1),$iif(!$team.colors,-1,-2),32),]) $paren($remove($gettok(%item,7,187),$chr(32)))
- }
- NFL.get.scores.nfl.msg $gettok(%item,3,187) %team1 $paren($gettok($gettok(%item,6,187),1,32)) 14@ %team2 $paren($gettok($gettok(%item,$iif(%consensus,8,7),187),1,32)) $iif(%consensus,14 Consensus: %consensus)
- }
- alias NFL.get.scores.nfl.current {
- if (!$1) return
- var %item = $1-, %team1, %team2
- var %sep $iif(vs isin $gettok(%item,4,187),vs,at)
- set %team1 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),1- $+ $calc($findtok($gettok(%item,4,187),%sep,1,32) - 1),32))
- set %team2 $NFL.get.scores.nfl.teamcolors($gettok($gettok(%item,4,187),$calc($findtok($gettok(%item,4,187),%sep,1,32) + 1) $+ -,32))
- var %teams
- var %team1score $gettok($replace($gettok(%item,6,187),null,0),1,58)
- var %team2score $gettok($replace($gettok(%item,6,187),null,0),2,58)
- if (%team1score > %team2score) set %teams $+ %team1 14@ %team2
- elseif (%team1score < %team2score) set %teams %team1 14@ $+ %team2
- else set %teams %team1 14@ %team2
- NFL.get.scores.nfl.msg %teams 14 14Score: $replace($gettok(%item,6,187),null,0,:,$chr(32) to $chr(32)) 14 Status:3 $gettok(%item,5,187) $iif($gettok(%item,7,187),- $gettok(%item,7,187))
- }
- alias NFL.get.scores.nfl.Sorted {
- if ($1) {
- ;sorts items by putting all the dates in hash tables
- var %z = 0, %new
- while ($hget(NFL.get.scores,0).item > %z) {
- inc %z
- if (NFL. isin $hget(NFL.get.scores,%z).item) set %new $addtok(%new,$v2,44)
- }
- set %z 0
- var %data, %time, %data2, %all, %item
- while ($gettok(%items,0,44) > %z) {
- inc %z
- set %item $gettok(%items,%z,44)
- set %data $hget(NFL.get.scores,%item)
- set %new $gettok(%data,2,187) $+ . $+ $gettok(%data,3,187)
- set %data2 %new
- set %time $remove($gettok(%data2,2,46),p,a,et)
- set %time $calc($calc($gettok(%time,1,58) * 360) + $calc($gettok(%time,2,58) * 60))
- set %time $calc($ctime($gettok(%data2,1,46)) + %time)
- hadd NFL.get.scores %time $addtok($hget(NFL.get.scores,%time),%item,44)
- }
- var %z = 0
- set %new
- while ($hget(NFL.get.scores,0).item > %z) {
- inc %z
- if (NFL. !isin $hget(NFL.get.scores,%z).item) set %new $addtok(%new,$v2,44)
- }
- return $sorttok(%new,44,n)
- }
- }
- alias NFL.get.scores.nfl.Close {
- sockclose NFL.get.scores
- unset %NFL.get.scores.nfl.TEMP.*
- .timerhfree.NFL.get.scores 1 30 if ($hget(NFL.get.scores)) hfree NFL.get.scores
- }
- alias -l useragent {
- var %r $rand(1,11)
- if (%r == 1) return User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
- elseif (%r == 2) return User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
- elseif (%r == 3) return User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
- elseif (%r == 4) return User-Agent: Opera/9.20 (Windows NT 6.0; U; en)
- elseif (%r == 5) return User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20060127 Netscape/8.1
- elseif (%r == 6) return User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
- elseif (%r == 7) return User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; da-dk) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
- elseif (%r == 8) return User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.2; WOW64; rv:1.8.0.7) Gecko/20110321 MultiZilla/4.33.2.6a SeaMonkey/8.6.55
- elseif (%r == 9) return User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
- elseif (%r == 10) return User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36
- elseif (%r == 11) return User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0
- }
- on *:sockopen:NFL.get.scores: {
- sockwrite -nt $sockname GET /football-scores-matchups.aspx HTTP/1.1
- sockwrite -nt $sockname $useragent
- sockwrite -nt $sockname Host: scores.covers.com
- sockwrite -nt $sockname Accept-Language: en-us
- sockwrite -nt $sockname Accept: */*
- sockwrite -nt $sockname $crlf
- }
- on *:sockread:NFL.get.scores: {
- var %temp, %date, %item, %data
- if ($sockerr) {
- var %error
- if ($sockerr == 3) set %error Connection refused by remote host
- elseif ($sockerr == 4) set %error DNS lookup for hostname failed
- elseif ($sockerr > 0) set %error Unknown socket error ( $+ $sockerr $+ )
- echo -s NFL.get.scores: 4Socket Error: %error
- .timerNFL.get.scores.nfl.error 1 10 NFL.get.scores.nfl.msg 0,2 NFL Socket Error. Please try again later. :(
- .timerNFL.get.scores.nfl.close 1 15 NFL.get.scores.nfl.close
- halt
- }
- else {
- .timerNFL.get.scores.nfl.Timeout off
- sockread %temp
- ;STATUS»DATE»TIME»TEAMS»STATUS»SCORE(Away:Home)»Game Status
- if (<td colspan="2" class="scoreboard-left"><h2> isin %temp) && (%date != $striphtml(%temp)) set %NFL.get.scores.nfl.TEMP.DATE $remove($striphtml(%temp),$chr(44))
- if (*<td class="scoreboard-*">* iswm %temp) {
- if ($striphtml(%temp)) {
- if (!$hget(NFL.get.scores)) hmake NFL.get.scores
- ;In_Game_Status_1_
- unset %NFL.get.scores.nfl.TEMP.GameStatus
- set %item $striphtml(%temp)
- set %NFL.get.scores.nfl.TEMP.title $gettok($wildtok(%temp,*Title_1_*,1,60),2,62)
- if (Final isin %item) {
- ;Game Over
- set %NFL.get.scores.nfl.TEMP.STATUS Final
- hadd NFL.get.scores NFL. $+ $calc($hget(NFL.get.scores,0).item + 1) $+(Final,$chr(187),%NFL.get.scores.nfl.TEMP.DATE,$chr(187),0,$chr(187),$gettok($wildtok(%temp,*Title_1_*,1,60),2,62))
- }
- elseif (*AM ET* iswm %item) || (*PM ET* iswm %item) {
- ;Game Upcoming
- set %NFL.get.scores.nfl.TEMP.STATUS Upcoming
- hadd NFL.get.scores NFL. $+ $calc($hget(NFL.get.scores,0).item + 1) $+(Upcoming,$chr(187),%NFL.get.scores.nfl.TEMP.DATE,$chr(187),$replace($remove($gettok($wildtok(%temp,*span class="pretab">*,1,60),2,62),$chr(32)),pmET,p ET,amET,a ET),$chr(187),$gettok($wildtok(%temp,*Title_1_*,1,60),2,62),$chr(187))
- }
- else {
- ;Game is ON!
- set %NFL.get.scores.nfl.TEMP.STATUS Current
- hadd NFL.get.scores NFL. $+ $calc($hget(NFL.get.scores,0).item + 1) $+(Current,$chr(187),$asctime($ctime,dddd),$chr(187),Now,$chr(187),$gettok($wildtok(%temp,*Title_1_*,1,60),2,62),$chr(187),$gettok($wildtok(%temp,*In_Game_Status_1_*,1,60),2,62))
- }
- }
- }
- }
- if (*<td class="datac" id="*Score_1* iswm %temp) {
- if (%NFL.get.scores.nfl.TEMP.STATUS == Current) || (%NFL.get.scores.nfl.TEMP.STATUS == Final) {
- var %i $hfind(NFL.get.scores,* $+ %NFL.get.scores.nfl.TEMP.title $+ *,1,w).data
- if (<td class="datac" id="VisitScore_1 isin %temp) hadd NFL.get.scores %i $hget(NFL.get.scores,%i) $+($chr(187),$iif(!$striphtml(%temp),null,$remove($striphtml(%temp),$chr(32))),:)
- if (<td class="datac" id="HomeScore_1_ isin %temp) hadd NFL.get.scores %i $hget(NFL.get.scores,%i) $+ $iif(!$striphtml(%temp),null,$remove($striphtml(%temp),$chr(32)))
- }
- }
- if (%NFL.get.scores.nfl.TEMP.STATUS == Upcoming) && ($striphtml(%temp)) {
- var %i = $hfind(NFL.get.scores,* $+ %NFL.get.scores.nfl.TEMP.title $+ *,1,w).data
- if (*<td class="data">*-* (*-* ?)</td>* iswm %temp) hadd NFL.get.scores %i $hget(NFL.get.scores,%i) $+($chr(187),$striphtml(%temp))
- if (*<td class="datac">*%</td>* iswm %temp) hadd NFL.get.scores %i $hget(NFL.get.scores,%i) $+($chr(187),$striphtml(%temp))
- }
- .timerNFL.get.scores.nfl.End 1 3 NFL.get.scores.nfl.End
- }
- alias NFL.get.scores.nfl.teamcolors {
- var %a
- if ($1- == Arizona) set %a 1,4[ Arizona Cardinals ]
- elseif (Atlanta isin $1-) set %a 4,1[ Atlanta Falcons ]
- elseif (Baltimore isin $1-) set %a 8,2[ Baltimore Ravens ]
- elseif (Buffalo isin $1-) set %a 4,2[ Buffalo Bills ]
- elseif (Carolina isin $1-) set %a 11,1[ Carolina Panthers ]
- elseif (Chicago isin $1-) set %a 7,2[ Chicago Bears ]
- elseif (CINCINNATI isin $1-) set %a 1,7[ Cincinnati Bengals ]
- elseif (CLEVELAND isin $1-) set %a 7,15[ Cleveland Browns ]
- elseif (DALLAS isin $1-) set %a 12,15[ Dallas Cowboys ]
- elseif (DENVER isin $1-) set %a 7,2[ Denver Broncos ]
- elseif (DETROIT isin $1-) set %a 12,15[ Detroit Lions ]
- elseif (GREEN BAY isin $1-) set %a 0,3[ Green Bay Packers ]
- elseif (HOUSTON isin $1-) set %a 1,4[ Houston Texans ]
- elseif (INDIANAPOLIS isin $1-) set %a 12,15[ Indianapolis Colts ]
- elseif (JACKSONVILLE isin $1-) set %a 1,8[ Jacksonville Jaguars ]
- elseif (KANSAS CITY isin $1-) set %a 0,4[ Kansas City Chiefs ]
- elseif (MIAMI isin $1-) set %a 7,11[ Miami Dolphins ]
- elseif (MINNESOTA isin $1-) set %a 8,6[ Minnesota Vikings ]
- elseif (NEW ENGLAND isin $1-) set %a 2,15[ New England Patriots ]
- elseif (NEW ORLEANS isin $1-) set %a 8,1[ New Orleans Saints ]
- elseif (NY GIANTS isin $1-) || (N.Y. GIANTS isin $1-) set %a 4,2[ New York Giants ]
- elseif (NY Jets isin $1-) || (N.Y. JETS isin $1-) set %a 0,3[ New York Jets ]
- elseif (OAKLAND isin $1-) set %a 15,1[ Oakland Raiders ]
- elseif (PHILADELPHIA isin $1-) set %a 0,10[ Philadelphia Eagles ]
- elseif (PITTSBURGH isin $1-) set %a 2,0[ Pittsburgh Steelers ]
- elseif (SAN DIEGO isin $1-) set %a 8,2[ San Diego Chargers ]
- elseif (SEATTLE isin $1-) set %a 0,2[ Seattle Seahawks ]
- elseif (SAN FRANCISCO isin $1-) set %a 0,4[ San Francisco 49ers ]
- elseif (ST. LOUIS isin $1-) set %a 8,2[ St. Louis Rams ]
- elseif (TAMPA BAY isin $1-) set %a 8,4[ Tampa Bay Buccaneers ]
- elseif (TENNESSEE isin $1-) set %a 11,2[ Tennessee Titans ]
- elseif (WASHINGTON isin $1-) set %a 0,5[ Washington Redskins ]
- elseif (rice isin $1-) set %a Team Rice
- elseif (sanders isin $1-) set %a Team Sanders
- elseif (jr isin $1-) set %a Team Rice
- elseif (ds isin $1-) set %a Team Sanders
- if (!$team.colors) return 12 $+ $remove($strip(%a),[,]) $+
- else return %a
- }
- alias -l team.lookup {
- var %a
- if (Arizona isin $1-) set %a $v1
- elseif (Atlanta isin $1-) set %a $v1
- elseif (Baltimore isin $1-) set %a $v1
- elseif (Buffalo isin $1-) set %a $v1
- elseif (Carolina isin $1-) set %a $v1
- elseif (Chicago isin $1-) set %a $v1
- elseif (CINCINNATI isin $1-) set %a $v1
- elseif (CLEVELAND isin $1-) set %a $v1
- elseif (DALLAS isin $1-) set %a $v1
- elseif (DENVER isin $1-) set %a $v1
- elseif (DETROIT isin $1-) set %a $v1
- elseif (GREEN BAY isin $1-) set %a $v1
- elseif (HOUSTON isin $1-) set %a $v1
- elseif (INDIANAPOLIS isin $1-) set %a $v1
- elseif (JACKSONVILLE isin $1-) set %a $v1
- elseif (KANSAS CITY isin $1-) set %a $v1
- elseif (MIAMI isin $1-) set %a $v1
- elseif (MINNESOTA isin $1-) set %a $v1
- elseif (NEW ENGLAND isin $1-) set %a $v1
- elseif (NEW ORLEANS isin $1-) set %a $v1
- elseif (NY GIANTS isin $1-) || (N. Y. GIANTS isin $1-) set %a N. Y. GIANTS
- elseif (NY JETS isin $1-) || (N. Y. JETS isin $1-) set %a N. Y. Jets
- elseif (OAKLAND isin $1-) set %a $v1
- elseif (PHILADELPHIA isin $1-) set %a $v1
- elseif (PITTSBURGH isin $1-) set %a $v1
- elseif (SAN DIEGO isin $1-) set %a $v1
- elseif (SEATTLE isin $1-) set %a $v1
- elseif (SAN FRANCISCO isin $1-) set %a $v1
- elseif (ST. LOUIS isin $1-) set %a $v1
- elseif (TAMPA BAY isin $1-) set %a $v1
- elseif (TENNESSEE isin $1-) set %a $v1
- elseif (WASHINGTON isin $1-) set %a $v1
- elseif (Cardinals isin $1-) set %a Arizona
- elseif (Falcons isin $1-) set %a Atlanta
- elseif (Ravens isin $1-) set %a Baltimore
- elseif (Bills isin $1-) set %a Buffalo
- elseif (Panthers isin $1-) set %a Carolina
- elseif (Bears isin $1-) set %a Chicago
- elseif (Bengals isin $1-) set %a Cincinnati
- elseif (Browns isin $1-) set %a Cleveland
- elseif (Cowboys isin $1-) set %a Dallas
- elseif (Broncos isin $1-) set %a Denver
- elseif (Lions isin $1-) set %a Detroit
- elseif (Packers isin $1-) set %a Green Bay
- elseif (Texans isin $1-) set %a Houston
- elseif (Colts isin $1-) set %a Indianapolis
- elseif (Jaguars isin $1-) set %a Jacksonville
- elseif (Chiefs isin $1-) set %a Kansas City
- elseif (Dolphins isin $1-) set %a Miami
- elseif (Vikings isin $1-) set %a Minnesota
- elseif (Patriots isin $1-) set %a New England
- elseif (Saints isin $1-) set %a New Orleans
- elseif (GIANTS isin $1-) set %a N.Y. Giants
- elseif (JETS isin $1-) set %a N.Y. Jets
- elseif (Raiders isin $1-) set %a Oakland
- elseif (Eagles isin $1-) set %a Philadelphia
- elseif (Steelers isin $1-) set %a Pittsburgh
- elseif (Chargers isin $1-) set %a San Diego
- elseif (Seahawks isin $1-) set %a Seattle
- elseif (49ers isin $1-) set %a San Francisco
- elseif (Rams isin $1-) set %a ST. Louis
- elseif (Buccaneers isin $1-) set %a Tampa Bay
- elseif (Titans isin $1-) set %a Tennessee
- elseif (Redskins isin $1-) set %a Washington
- elseif (rice isin $1-) set %a Team Rice
- elseif (sanders isin $1-) set %a Team Sanders
- elseif (jr isin $1-) set %a Team Rice
- elseif (ds isin $1-) set %a Team Sanders
- else return $1-
- return %a
- }
- alias -l paren if ($1) return ( $+ $1- $+ )
- ;==================================================================================
- ;Author : fubar
- ;Function: $striphtml identifier
- ; This identifier strips html code from a string of text.
- ; Good for using when retrieving webpages within mirc.
- ;==================================================================================
- ;
- ;This identifier strips html code from a string of text. Good for using when retrieving webpages within mirc.
- ;
- ;Usage: $striphtml(html code)
- alias -l Xchr {
- var %return $regsubex($regsubex($1-,/&#x([A-F0-9]{1,2});/g,$chr($base($regml(\n),16,10))),/&#([0-9]{2});/g,$chr(\1))
- return $replacecs(%return,–,,·,·,»,»,«,«,Ü,Ü,ü,ü,Á,Á,á,á,É,$&
- É,é,é,Í,Í,í,í,Ó,Ó,ó,ó,Ñ,Ñ,ñ,ñ,Ú,Ú,ú,ú, ,$chr(32),$&
- æ,æ,",")
- }
- alias -l striphtml {
- ; making sure there are parameters to work with
- IF ($1) {
- ; Setting my variables. The %opt is set kind of funky
- ; all it does is combine <two><brackets> into 1 <twobrackets>, fewer loops this way
- ; also stripped tab spaces
- VAR %strip,%opt = <> $remove($1-,> <,><,$chr(9)) <>,%n = 2
- ; using $gettok() I checked the text in front of '>' (chr 62)
- ; then the second $gettok checks the text behind '<' (chr 60)
- ; so I'm extracting anything between >text<
- WHILE ($gettok($gettok(%opt,%n,62),1,60)) {
- ; take each peice of text and add it to the same variable
- %strip = %strip $ifmatch
- %strip = $replace(%strip,",")
- ; increase the variable so the while statement can check the next part
- INC %n
- }
- ; now that the loop has finished we can return the stripped html code
- RETURN $xchr(%strip)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement