Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:text:*:%icecast_chan: {
- if (!radio == $1) {
- .timer_radio_msg_ $+ $network $+ _ $+ $nick 1 1 radio_msg
- }
- elseif ($1 == !url) {
- .timer_radio_url_ $+ $network $+ _ $+ $nick 1 1 radio_url $nick
- }
- elseif ($1 == !radiohelp) {
- .timer_radio_help_ $+ $network $+ _ $+ $nick 1 1 radio_help $nick
- }
- elseif ($1 == !song) {
- .timer_radio_song_ $+ $network $+ _ $+ $nick 1 1 msg %icecast_chan $+ $colm Current Song: $+ $cols %z.artist - %z.title $+ $cold $chr(8226) $+ $colm Genre: $+ $cols %z.genre
- }
- elseif ($1 == !listeners) {
- .timer_radio_listeners_ $+ $network $+ _ $+ $nick 1 1 msg %icecast_chan $+ $colm Listeners: $+ $cols %z.listeners $+ $colm (Peak: $+ $cols %z.listenerpeak $+ $colm $+ )
- }
- elseif ($1 == !total) {
- .timer_radio_total_ $+ $network $+ _ $+ $nick 1 1 msg %icecast_chan $+ $colm Total %icecast_chan Joins: $+ $cols %total_chan_joins $+ $colm (Since: $+ $cols %total_chan_joins_date $+ $colm $+ )
- }
- }
- alias -l radio_url {
- msg %icecast_chan $+ $colm Listen $+ $cold $+ @ $+ $cols http:// $+ %z.host
- ;msg %icecast_chan $+ $colm Listen $+ $cold $+ @ $+ $cols http:// $+ %z.host $+ : $+ $my_icecast_port
- ;msg %icecast_chan $+ $colm Listen $+ $cold $+ @ $+ $cols http:// $+ $my_icecast_url $+ : $+ $my_icecast_port
- }
- alias -l radio_help {
- msg %icecast_chan $+ $colm $+ ( $+ $cols Radio Help $+ $colm $+ )
- msg %icecast_chan
- msg %icecast_chan $+ $cols !Request <song> $+ $cold $chr(8226) $+ $colm To request a song.
- msg %icecast_chan $+ $cols !Radio $+ $cold $chr(8226) $+ $colm To see Radio Info.
- msg %icecast_chan $+ $cols !Url $+ $cold $chr(8226) $+ $colm To display the Radio stream url.
- msg %icecast_chan $+ $cols !Song $+ $cold $chr(8226) $+ $colm To display current playing song.
- msg %icecast_chan $+ $cols !Listeners $+ $cold $chr(8226) $+ $colm To display current listeners.
- msg %icecast_chan $+ $cols !Total $+ $cold $chr(8226) $+ $colm To display total %icecast_chan joins.
- }
- alias -l radio_msg {
- msg %icecast_chan $+ $cols %z.servername $+ $cold $chr(8226) $+ $colm Now Playing: $+ $cols %z.artist - %z.title $+ $cold $chr(8226) $+ $colm Genre: $+ $cols %z.genre $+ $cold $chr(8226) $+ $colm BitRate: $+ $cols %z.ice-bitrate $+ $cold $chr(8226) $+ $colm Channels: $+ $cols %z.ice-channels $+ $cold $chr(8226) $+ $colm SampleRate: $+ $cols %z.ice-samplerate $+ $cold $chr(8226) $+ $colm Listeners: $+ $cols %z.listeners $+ $colm (Peak: $+ $cols %z.listenerpeak $+ $colm $+ )
- }
- ON *:JOIN:%icecast_chan: {
- if ($nick != $me) { inc %total_chan_joins 1 | return }
- if ($nick == $me) {
- .timeer 1 20 chan_url_spam_msg
- unset %no_spam
- }
- }
- ON *:PART:%icecast_chan: { if ($nick == $me) { set %no_spam 1 } }
- ON *:KICK:%icecast_chan: { if ($knick == $me) { set %no_spam 1 } }
- alias colm { return $iif(%radio_color1,$v1,3) }
- alias cols { return $iif(%radio_color2,$v1,33) }
- alias cold { return $iif(%radio_color3,$v1,79) }
- ON *:SOCKOPEN:radio_*: {
- if ($sockerr) { scon -a msg %icecast_admin_chan 4Error Sock OPEN $qt($sockname) | return }
- sockwrite -nt $sockname GET /status-json.xsl HTTP/1.1
- sockwrite -nt $sockname Host: $my_icecast_url
- sockwrite -nt $sockname Connection: Close
- sockwrite $sockname $crlf
- }
- ON *:SOCKREAD:radio_*: {
- if ($sockerr) { scon -a msg %icecast_admin_chan 4Error Sock READ $qt($sockname) | return }
- var %radio | sockread %radio
- }
- ON *:SOCKCLOSE:radio_*: {
- if ($sockerr) { scon -a msg %icecast_admin_chan 4Error Sock CLOSE $qt($sockname) | return }
- var %radio | sockread -f %radio
- var %x = 1
- while (%x <= $numtok(%radio,34)) {
- var %g = $gettok(%radio,%x,34)
- if (%g != :) && (%g != ,) && (%g != dummy) && (*null* !iswm %g) && (%g != :{) && (%g != $chr(123)) {
- if (*"source":{* iswm %radio) {
- if (%radiostatus == 2) {
- set %radiostatus 1
- scon -a topic %icecast_chan %z.online.topic
- }
- }
- if (*"source":{* !iswm %radio) {
- if (%radiostatus == 1) {
- set %radiostatus 2
- scon -a topic %icecast_chan %z.offline.topic
- sockclose $sockname
- break
- }
- }
- var %h = $gettok(%radio,$calc(%x + 1),34)
- var %hh = $gettok(%radio,$calc(%x + 2),34)
- var %i = $remove(%h,:,$chr(44))
- var %ii = $remove(%hh,:,$chr(44))
- var %j = $replace(%i,chr(32),$chr(32)),audio_bitrate,$chr(32))
- var %jj = $replace(%ii,chr(32),$chr(32),audio_bitrate,$chr(32))
- if (%g == host) { set %z.host %jj }
- if (%g == server_name) { set %z.servername %jj }
- if (%g == artist) { set %z.artist %jj }
- if (%g == genre) { set %z.genre %jj }
- if (%g == ice-bitrate) { set %z.ice-bitrate %j }
- if (%g == audio_channels) { set %z.ice-channels %j }
- if (%g == audio_samplerate) { set %z.ice-samplerate %j }
- ;if (%g == listenurl) { set %z.listenurl %jj }
- if (%g == listener_peak) { set %z.listenerpeak %j }
- if (%g == listeners) { set %z.listeners %j }
- if (%g == title) { z.spam | set %z.oldsong %z.title | set %z.title %jj }
- }
- inc %x
- }
- }
- ;.timer_radio.online_checkerz 1 4 set %z.radio.online 1 | .timer 1 8 z.topic
- alias z.topic {
- if (%z.radio.online) {
- topic %icecast_chan %z.offline.topic
- unset %z.radio.online
- return
- }
- if (!%z.radio.online) {
- topic %icecast_chan %z.online.topic
- }
- }
- alias z.spam {
- if (%no_spam) { return }
- if (%z.oldsong == %z.title) { return }
- scon -a msg %icecast_chan $+ $cols %z.servername $+ $cold $chr(8226) $+ $colm Now Playing: $+ $cols %z.artist - %z.title $+ $cold $chr(8226) $+ $colm Genre: $+ $cols %z.genre $+ $cold $chr(8226) $+ $colm BitRate: $+ $cols %z.ice-bitrate $+ $cold $chr(8226) $+ $colm Channels: $+ $cols %z.ice-channels $+ $cold $chr(8226) $+ $colm SampleRate: $+ $cols %z.ice-samplerate $+ $cold $chr(8226) $+ $colm Listeners: $+ $cols %z.listeners $+ $colm (Peak: $+ $cols %z.listenerpeak $+ $colm $+ )
- }
- alias radio {
- sockopen radio_ $+ $(1,99999999) $my_icecast_url $my_icecast_port
- }
- alias my_icecast_url {
- ;######################################################################################
- ;# Input your server's URL below (don't erase "return") >> DON'T INCLUDE THE :PORT << #
- ;######################################################################################
- return 64.140.169.30
- ;#############################
- }
- alias my_icecast_port {
- ;################################################################################
- ;# Input below the port that the server is listening to (don't erase "return") #
- ;################################################################################
- return 80
- ;################
- }
- on *:connect:{
- ;##############################################################################
- ;# Input your the channel(s) you want the messages to be sent in below. #
- ;# Input how frequent you want the script to check for a new song (e.g 30) #
- ;##############################################################################
- set %icecast_chan #IRC-Radio
- set %icecst_spam 3
- set %z.online.topic $+ $colm IRC-Radio 9Online $+ $cold $chr(8226) $+ $cols DJ: $+ $cold %icecast_dj $+ $cold $chr(8226) $+ $cols !RadioHelp $+ $cold $chr(8226) http:// $+ %z.host $+ $cold $chr(8226) $+ $cols Come listen to tunes, hangout and have a awesome chat experience!
- set %z.offline.topic $+ $colm IRC-Radio 4Offline $+ $cold $chr(8226) $+ $cols !RadioHelp $+ $cold $chr(8226) http:// $+ %z.host $+ $cold $chr(8226) $+ $cols Come listen to tunes, hangout and have a awesome chat experience!
- ;##################################################################################################
- .timerice_check 0 %icecst_spam radio
- set %total_listeners_date 21/03/2018
- .timer_chan_url_spam 0 21600 chan_url_spam_msg
- }
- on *:disconnect:{
- .timerice_check off
- .timer_chan_url_spam off
- }
- alias chan_url_spam_msg {
- if (%no_spam) { return }
- scon -a msg %icecast_chan $+ $colm We would like to Thank & Welcome you to $+ $cols %icecast_chan $+ $colm for joining us! $+ $cold $chr(8226) $+ $colm Listen $+ $cold @ $+ $cols http:// $+ %z.host
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement