This is the script as re-written by nappa (thank you btw) Works fine for all major sports. Triggers are :
.nhl
.nfl
.nba
.mlb
Just copy and paste in the remote of your bot and enjoy :)
on $*:text:/^.(n(hl|ba|fl)?|mlb)$/iS:#:{
if (!$hget(scores,count)) {
if ($sock(scores)) sockclose scores
sockopen scores feeds.feedburner.com 80
sockmark scores $regml(1) msg # 4,15
}
}
on *:sockopen:scores: {
sockwrite -n $sockname GET $+(/mpiii/,$gettok($sock(scores).mark,1,32),.php) HTTP/1.1
sockwrite -n $sockname Host: $+(feeds.feedburner.com,$str($crlf,2))
}
on *:sockread:scores: {
var %scores | sockread %scores
if ($regex(%scores,/<title>(.+)<\/title>/)) {
hinc -mu5 scores count 1
$iif($hget(scores,count) >= 3,$gettok($sock(scores).mark,2-,32) $regml(1))
}
}
isn't giving scores anymore just returns same..
jethro? someone could fix would be awsome!
thanks
and is there anyway of adding checking a certian team's score to all of the checks?.. !mlb scores red sox
edit:
just thought of this...would be cool if you could check a teams schedule as well.. !mlb schedule red sox
Here you go, snackled. Place the script below in a new remote by itself as a separate script:
on *:text:$($iif(.ncaa * iswm $strip($1),$1)):*:{
if (!$(,$+(%,f,$site,#))) { inc -u3 $+(%,f,$site,#)
set -l %ncaa $+(ncaa,$r(1,$ticks))
sockopen %ncaa feeds.feedburner.com 80
sockmark %ncaa $strip($2) msg $iif(#,#,$nick)
}
}
on *:sockclose:ncaa*:{
$gettok($sock($sockname).mark,2-3,32) No such team as $&
$qt($gettok($sock($sockname).mark,1,32))
}
on *:sockread:ncaa*: {
if (!$sockerr) { var %ncaa | sockread %ncaa
if ($gettok($sock($sockname).mark,1,32) isin %ncaa) {
$gettok($sock($sockname).mark,2-3,32) $&
$gettok($gettok(%ncaa,-1,62),1,60) | sockclose $sockname } }
}
on *:sockopen:ncaa*:{
if (!$sockerr) {
sockwrite -n $sockname GET /collegesportsinfo-scores HTTP/1.1
sockwrite -n $sockname Host: $+($sock($sockname).addr,$str($crlf,2))
sockwrite -n $sockname Connection: close
}
}
I'll suggest that you change the trigger name to something else so that it doesn't interfere with the other socket script.
what would be REALLY cool is if somebody could type in something like:
me: .Jose Bautista
and then the bot spits back:
Jose Bautista: batting average / slugging percentage / on base percentage / home runs
not sure how this could be accomplished through feedburner, but i do know that stats like this are available from sites like ESPN and Yahoo Sports.
weishaupt, I'm not sure if napa did it inadvertently or not. The alternative examples he provided had the link for www.mpiii.com , which was an entirely different url from getting the scores at feeds.feedburner.com. To fix that, you need to change them back to the feedburner one.
I also added the college football scores to the script, requested by TwiztedChat]. TwistedChat], to get the college foodball scrore, enter: .ncaa or !ncaa
Here is it:
on $*:text:/^([!.])(n(hl|ba|fl|caa)?|mlb)$/iS:#:{
if ($regml(2) == ncaa) { ncaa }
if (!$hget(scores,count)) {
if ($sock(scores)) sockclose scores
sockopen scores feeds.feedburner.com 80
sockmark scores $regml(2) $iif($regml(1) = !,.notice $nick,msg #) 4,15
$gettok($sock(scores).mark,2-,32) 4,15Gathering $regml(2) info please wait.....
}
}
on *:sockopen:scores: {
sockwrite -n $sockname GET $+(/mpiii/,$gettok($sock(scores).mark,1,32),.php) HTTP/1.1
sockwrite -n $sockname Host: $+($sock(scores).addr,$str($crlf,2))
}
on *:sockread:scores: {
var %scores | sockread %scores
if ($regex(%scores,/<title>(.+)<\/title>/)) {
hinc -mu5 scores count 1
$iif($hget(scores,count) >= 3,$+(.,timerscore,$v1) 1 $calc($v1 *2) $&
$gettok($sock(scores).mark,2-,32) $+([,$calc($v1 -2),]) $regml(1))
}
}
alias -l ncaa {
if (!$hget(ncaa,count)) {
if ($sock(ncaa)) sockclose ncaa
sockopen ncaa feeds.feedburner.com 80
sockmark ncaa $regml(2) $iif($regml(1) = !,.notice $nick,msg #) 4,15
$gettok($sock(ncaa).mark,2-,32) 4,15Gathering $regml(2) info please wait.....
}
}
on *:sockopen:ncaa: {
sockwrite -n $sockname GET /collegesportsinfo-scores HTTP/1.1
sockwrite -n $sockname Host: $+($sock(ncaa).addr,$str($crlf,2))
}
on *:sockread:ncaa: {
var %ncaa | sockread %ncaa
if ($regex(%ncaa,/<title>(.+)<\/title>/)) {
hinc -mu5 ncaa count 1
$iif($hget(ncaa,count) >= 3,$+(.,timerscore,$v1) 1 $calc($v1 *2) $&
$gettok($sock(ncaa).mark,2-,32) $+([,$calc($v1 -2),]) $regml(1))
}
}
why isnt the .nfl working all i get is Gathering nfl info please wait.....
the.mlb works great but nothing else will work
.n [» Fri Dec 20 | 10:29:15 pm «] <~Billy> Gathering n info please wait.....
.ncaa works [1] NY Mets 5 St. Louis 2 (FINAL)
main 1 i need to work is the .nfl
anyway i could get 1 just for the .nfl ???
hmm the one with the link from feedburner still works
.nfl Minnesota 9 New Orleans 14 (FINAL) Miami 15 Buffalo 10 (FINAL) Detroit 14 Chicago 19 (FINAL) Cincinnati 24 New England 38 (FINAL) Carolina 18 NY Giants 31 (FINAL) Atlanta 9 Pittsburgh 15 (FINAL - OT) Cleveland 14 Tampa Bay 17 (FINAL) Denver 17 Jacksonville 24 (FINAL) Indianapolis 24 Houston 34 (FINAL) Arizona 17 St. Louis 13 (FINAL) Green Bay 27 Philadelphia 20 (FINAL) San Francisco 6 Seattle 31 (FINAL) Dallas 7 Washington 13 (FINAL) Baltimore at NY Jets (7:00 PM ET) San Diego at Kansas City (10:15 PM ET)
yeah. i tested it and it doesn't work proper...
Too bad i can't fix it my own :>
It only goes till the 17th of may...