0% found this document useful (0 votes)
152 views3 pages

Radio Snip

This document summarizes the code for a radio bot that connects to a radio station socket and IRC server to relay information and commands between the two. The bot connects to the radio station socket to get song title, DJ, and listener information and relays it to any IRC channels specified. It also listens for commands on IRC to control connecting/disconnecting from the radio station socket.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views3 pages

Radio Snip

This document summarizes the code for a radio bot that connects to a radio station socket and IRC server to relay information and commands between the two. The bot connects to the radio station socket to get song title, DJ, and listener information and relays it to any IRC channels specified. It also listens for commands on IRC to control connecting/disconnecting from the radio station socket.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

;_________________________ ;(--- RadioBot Socket ---) ;_________________________ on *:sockopen:fmbot:{ rwrite USER BluFm * * $+(:,OCX) rwrite account rall Rjoin

} on *:sockread:fmbot:{ var %fmbot if ($sockerr) { return } sockread %fmbot if (!%fmbot) { return } tokenize 32 %fmbot ;echo 7 -st %fmbot if ($1 == PING) { rwrite PONG $2- } elseif ($2 == PRIVMSG) { if ($4 == :TIME) { halt } elseif ($4 == :VERSION) { rwrite NOTICE $mid($gettok($1,1,33),2-) : =[BluFm Ra dio Spammer]= Version 1.4 - Created by MakiMaki & seraphim halt } elseif ($4 == :FINGER) { halt } elseif (!listen isin $4) { botmsg $3 Tune in to Phreik's Official Radio. http: //muvanje.listen2mymusic.com (Winamp link: http://87.117.203.166:34653/listen.pl s ) Or you can tune in by clicking the BluFM button above the chat window. } ; elseif (!DJ isin $4) { botmsg $3 Current DJ (8) DJ %DJ (8) } elseif (!playing isin $4) { botmsg $3 Currently Playing %playing } elseif (!last isin $4) { botmsg $3 Last 5 songs played %lastplayed } elseif (!stats isin $4) { botmsg $3 %Stats } } elseif ($2 == JOIN) { rwrite PRIVMSG $mid($gettok($1,1,33),2-): Welcome to the room $mid($gettok($ 1,1,33),2-) $+ , This room supports BluFM, Tune in to Phreik's Official Radio. h ttp://muvanje.listen2mymusic.com ( Winamp link: http://87.117.203.166:34653/list en.pls ) Or you can tune in by clicking the BluFM button above the chat window. } } on *:sockclose:fmbot:{ .timerFM off ufmbot } ;_____________________ ;(--- Data Socket ---) ;_____________________ on *:sockopen:data:{ sockwrite -n $sockname sockwrite -n $sockname sockwrite -n $sockname sockwrite -n $sockname sockwrite -n $sockname } on *:sockread:data:{ sockread -fn &bin var %d $remove($bvar(&bin,1,150).text,<HTML><meta http-equiv="Pragma" content= "no-cache"></head><body>,</body></html,>) if ($gettok(%d,7-,44)) && ($gettok(%d,7-,44) != %playing) { set %lastplayed $addtok(%playing $chr(32),$chr(32) $gettok(%lastplayed,1-4,3 5),35) set %playing $gettok(%d,7-,44) GET /7.html HTTP/1.0 User-Agent: mIRC (Mozilla Compatible) Host: 87.117.203.166:34653 Connection: keep-alive $crlf echo 4 -ast * BluFm Bot Socket Closed bl

rall Song %playing } set %Stats Stream is up at $gettok(%d,6,44) kbps with $gettok(%d,1,44) of $get tok(%d,4,44) listeners ( $+ $gettok(%d,5,44) unique), Max tuned in at once $gett ok(%d,3,44) halt } ;____________________ ;(--- CookieSock ---) ;____________________ on *:SOCKOPEN:fmcookie:{ sockwrite -n $sockname $+(GET /noht/cookiegrabber.php?u =,$gettok(%radio.cookie,1,32),&p=,$gettok(%radio.cookie,2,32) HTTP/1.1,$crlf,Acc ept: */*,$crlf,Host: 87.117.203.166:34653,$crlf,Connection: close,$crlf,$crlf) } on *:SOCKREAD:fmcookie:{ if ($sockerr > 0) return var %sc sockread %sc if (!%sc) return tokenize 32 %sc if ($2 == VALID:) { echo 9 -s * - Login successful (Account Cookie Stored [ $4]) - set %radio.cookie $4- } elseif ($2 == ERR:) { echo 4 -s - %radio.cookie is a invalid username or pass word, restart. - unset %radio.cookie } } ;___________________ ;(----- Alias -----) ;___________________ alias rwrite sockwrite -n fmbot $$1alias blufm sockclose data blufm sockopen data 87.117.203.166 34653 .timerfm 0 20

alias botmsg rwrite privmsg $1 $+($chr(1), S, $chr(32), $chr(3), $chr(3), Calibr i,;0) $2- $chr(1) alias fmbotclose sockclose fmbot .timerfm off

alias rall { var %i $numtok(%radiotok, 32) while (%i) { if ($1 == Song) { rwrite privmsg $gettok(%radiotok, %i, 32) Now Playing $2- } if ($1 == DJ) { rwrite privmsg $gettok(%radiotok, %i, 32) Current DJ - } if ($1 == Rjoin) { rwrite JOIN $gettok(%radiotok, %i, 32) } dec %i } } alias blufmbot { sockclose fmbot sockopen fmbot irc.krstarica.com 6667 blufm } alias fmbotcookie { set %radio.cookie $$?="Enter User Name:" $$?="Enter Your Password:" if ($sock(fmcookie)) sockclose fmcookie sockopen fmcookie www.krstarica.com 80 }

alias spam.chan set %radiotok $iif($istok(%radiotok, $1, 32), $remtok(%radiotok, $1, 32), $addtok(%radiotok, $1, 32)) $2- $iif($istok(%radiotok, $1, 32), Now sp amming in $1, No longer spamming in $1) ;____________________ ;(------ Menu ------) ;____________________ menu Channel { BluFm Bot .$style($iif($istok(%radiotok, #, 32),1)) Spam Radio in # : spam.chan # echo 7 -t # ..Set Account:fmbotcookie .Connect/Reset Bot:Blufmbot .Join #:rwrite join # .Part #:rwrite part # .Close Bot:fmbotclose }

You might also like