Jump to content

Radio Code


JOhnson

Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

<p>updated a bit.</p>

<pre class="_prettyXprint">

menu channel {

Radio Test

.Set Channel: { set %radiotest.room $$?="Full Channel Name" }

.$iif($timer(.radiotest),$style(2)) Turn On: { radiotest | .timer.radiotest 0 10 radiotest | echo -a radiotest msg on }

.$iif(!$timer(.radiotest),$style(2)) Turn Off: { unset %radiotest.song | unset %radiotest.lastsong | .timer.radiotest off | echo -a radiotest msg off }

}

alias radiotest { sockclose radiotest | sockopen radiotest 96.31.83.87 8037 }

on *:sockopen:radiotest: {

sockwrite -n $sockname GET /7.html HTTP/1.1

sockwrite -n $sockname User-Agent: SHOUTcast Song Status (Mozilla Compatible)

sockwrite -n $sockname Host: $+(96.31.83.87,:,8037)

sockwrite -n $sockname $crlf

}

on *:sockread:radiotest: {

if ($sockerr > 0) return

var %radiotest | sockread -fn %radiotest

if ($regex(%radiotest,/<body>(.*)<\/body>/)) {

 

set %radiotest.song $gettok($regml(1),7-,44)

if (%radiotest.song != %radiotest.lastsong) {

 

msg %radiotest.room Now playing on CosyClanRadio.com - %radiotest.song

set %radiotest.lastsong %radiotest.song

}

}

}

</pre>

Link to comment
Share on other sites

  • 3 months later...

:oops: I am not pissed at you just f ing mad at you :lolwave: and Ozzy you have been saying that for years and tell me fella do you still have a horse or horses .... I might not be as good as you boys at scripting but I knows my horses :lolwave:

Link to comment
Share on other sites

  • 1 year later...

<bcry> I have edited this code that err0r gave to one or two other radio's but for some reason its not working for me ... any idea what iv done wrong :D the ip is correct and the port is correct ... hope to hear from you soon :lolwave: thanks for any replies :D

 

menu channel {
-
Magic
.Set Channel: { set %magicroom $chan | echo -a channel : %magicroom }
.$iif($timer(.magic),$style(2)) Turn On: { magic | .timer.magic 0 10 magic | echo -a magic msg on }
.$iif(!$timer(.magic),$style(2)) Turn Off: { unset %magic.song | .timer.magic off | echo -a magic msg off }
}
alias magic { sockclose magic | sockopen magic 91.121.195.222 8104 }
on *:sockopen:magic: {
sockwrite -n $sockname GET /7.html HTTP/1.1
sockwrite -n $sockname User-Agent: SHOUTcast Song Status (Mozilla Compatible)
sockwrite -n $sockname Host: $+(91.121.195.222,:,8104)
sockwrite -n $sockname $crlf
}
on *:sockread:magic: {
if ($sockerr > 0) return
var %magic | sockread -fn %magic
if ($regex(%magic,/<body>(.*)<\/body>/)) {

set %magic.song $gettok($regml(1),7-,44)
if (%magic.song != %magic.lastsong) {

msg %magic.room Now playing on The Magic Radio - %magic.song (8) http://myradiostream.com/32/8104(8)
set %magic.lastsong %magic.song
}
}
}

;credit err0r www.tg007.net

 

Link to comment
Share on other sites

:lmaojump: you know me :lolwave: iv joined http://myradiostream.com/32/8104 if that is any help to you ... it has an Ip and a port and that is about all I really knows ... unless you knows something I dont ... :lolwave: for godsake dont ask Pk :D the radio station is named The Magic Radio ? again if that is any help to you and again thank you for your reply ... as Ozzy sed is that Johnson doing your brains in ... tell him YES :lolwave: thanks again err0r I will leave it in your hands and hope you come up with the right answer :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...