SHOUTCAST RADIO SPAMMER SOCK BOT

Iniciado por TerraChat, May 12, 2024, 11:22 PM

Tema anterior - Siguiente tema

TerraChat

Sockbot with a sockread to get the data of the 7.html file of a shoutcast server. Will spam current song, easy to set to show DJ if you wanted, will show stats on command and the last 5 songs played.


;_________________________
;(--- 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 Radio 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://www.blufm.net (Winamp link: http://stream.blufm.net:8000/listen.pls ) 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. Http://www.blufm.net ( Winamp link: http://stream.blufm.net:8000/listen.pls ) Or you can tune in by clicking the BluFM button above the chat window.
} }

on *:sockclose:fmbot:{ .timerFM off | echo 4 -ast * BluFm Bot Socket Closed | blufmbot }

;_____________________
;(--- Data Socket ---)
;_____________________

on *:sockopen:data:{
  sockwrite -n $sockname GET /7.html HTTP/1.0
  sockwrite -n $sockname User-Agent: BluFM mIRC (Mozilla  Compatible)
  sockwrite -n $sockname Host: stream.blufm.net:8000
  sockwrite -n $sockname Connection: keep-alive
  sockwrite -n $sockname $crlf

}

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,35),35)
    set %playing $gettok(%d,7-,44)
    rall Song %playing
  }
  set %Stats Stream is up at $gettok(%d,6,44) kbps with $gettok(%d,1,44) of $gettok(%d,4,44) listeners ( $+ $gettok(%d,5,44) unique), Max tuned in at once $gettok(%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,Accept: */*,$crlf,Host: www.phreik.net,$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 password, restart. - | unset %radio.cookie }
}

;___________________
;(----- Alias -----)
;___________________

alias rwrite sockwrite -n fmbot $$1-

alias blufm sockclose data | sockopen data stream.blufm.net 8000 | .timerfm 0 20 blufm

alias botmsg rwrite privmsg $1 $+($chr(1), S, $chr(32), $chr(3), $chr(3), Calibri,;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.phreik.net 6667
  blufm
}

alias fmbotcookie  {
  set %radio.cookie $$?="Enter User Name:" $$?="Enter Your Password:"   
  if ($sock(fmcookie)) sockclose fmcookie
  sockopen fmcookie www.phreik.net 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 spamming 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
  -
}