mIRC Homepage
Posted By: kazie script for live score on flashscore.com - 17/04/16 12:26 PM
Hi,

I'm new to scripting. I am creating a betting bot on my channel and was thinking of getting a script to display live scores from flashscore.com

for example this link: http://www.flashscore.com/match/zcN2SxcI/#match-summary

the script should just capture the first line of text which is

Socar Spor 27-23 Gediz Universitesi

and return it to the channel on command.

Someone help?

Thanks a bunch.
Posted By: hixxy Re: script for live score on flashscore.com - 22/04/16 10:04 PM
Code:
alias getscore {
  if ($2 == $null) { echo -a * /getscore: insufficient parameters }
  else { 
    sockclose getscore
    sockopen getscore www.flashscore.com 80
    sockmark getscore $1-
  }
}

on *:sockopen:getscore:{
  sockwrite -n getscore GET /match/ $+ $gettok($sock(getscore).mark,1,32) $+ /#match-summary
  sockwrite -n getscore Host: www.flashscore.com
  sockwrite -n getscore Accept: */*
  sockwrite -n getscore User-Agent: mIRC/ $+ $version
  sockwrite -n getscore
}
on *:sockread:getscore:{
  var %data
  sockread %data
  if ($regex(%data,/<title>(.+?)<\/title>/)) { $gettok($sock(getscore).mark,2-,32) $regml(1) }
}


/getscore <match number> <command>

e.g. /getscore zcN2Sxcl echo -s
© mIRC Discussion Forums