Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:JOIN:#: {
- if ($nick == $me) && (%cricket_ [ $+ [ $chan ] ]) { .timer[CRICKET_ $+ $chan $+ ] 0 300 cricket $chan }
- }
- ON *:TEXT:!*:#: {
- tokenize 32 $strip($1-)
- if ($1 == !cricket) {
- if (!$2) {
- if (!%cricket_ [ $+ [ $chan ] ]) { set -eu1 %cricket_ $+ $chan 1 }
- cricket $chan
- return
- }
- if ($2) && ($2 !== ON) && ($2 !== OFF) { msg $chan $nick Error, Cricket AUTO Announcer, Please enter ON or OFF option! | return }
- if ($2 == ON) {
- if (%cricket_ [ $+ [ $chan ] ]) { msg $chan $nick Error, Cricket AUTO Announcer is already enabled for this channel! | return }
- set %cricket_ $+ $chan 1
- msg $chan $nick Cricket AUTO Announcer has just enabled for this channel.
- .timer[CRICKET_ $+ $chan $+ ] 0 300 cricket $chan
- }
- if ($2 == OFF) {
- if (!%cricket_ [ $+ [ $chan ] ]) { msg $chan $nick Error, Cricket AUTO Announcer is already disabled for this channel! | return }
- set %cricket_ $+ $chan 0
- msg $chan $nick Cricket AUTO Announcer has just disabled for this channel.
- .timer[CRICKET_ $+ $chan $+ ] off
- }
- }
- }
- alias cricket {
- if (!$1) || ($1 !ischan) || (!%cricket_ [ $+ [ $1 ] ]) { return }
- var %s = cricket_ $+ $rand(1,100000000000)
- sockclose %s
- sockopen %s cricscore-api.appspot.com 80
- sockmark %s $1
- }
- ON *:SOCKOPEN:cricket_*:{
- if ($sockerr) {
- var %chan = $sock($sockname).mark
- if ($me ison %chan) { msg %chan Cricket: Error opening socket! - Error Details: $sock($sockname).wsmsg }
- return
- }
- sockwrite -nt $sockname GET /csa?id=1144513 HTTP/1.1
- sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
- sockwrite -nt $sockname Content-Type: application/json
- sockwrite -nt $sockname Host: $sock($sockname).addr
- sockwrite -nt $sockname $crlf
- }
- ON *:SOCKREAD:cricket_*:{
- if ($sockerr) {
- var %chan = $sock($sockname).mark
- if ($me ison %chan) { msg %chan Cricket: Error reading socket! - Error Details: $sock($sockname).wsmsg }
- sockclose $sockname
- return
- }
- var %x
- sockread %x
- if (*HTTP/1.1* iswm %x) && (*200* !iswm %x) {
- var %chan = $sock($sockname).mark
- if ($me ison %chan) { msg %chan Cricket: Error parsing socket! - Error Details: %x }
- sockclose $sockname
- return
- }
- if ($+(*,$chr(123),*) iswm %x) {
- var %chan = $sock($sockname).mark
- if ($me ison %chan) { msg %chan 3༒2ẸČĹĮƤŜẸ ŜČŘĮƤŤ3༒ 1||5 Cʀɪᴄᴋᴇᴛ UᴘᴅᴀᴛᴇS 1||3 $gettok(%x,4,34) 1||3 $gettok(%x,8,34) }
- sockclose $sockname
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement