err0r
Subject Matter Expert Member #20,793
Quick Code
menu channel {
My Radio
.Set Channel: { set %myradioroom $$?="Full Channel Name" }
.$iif($timer(.myradio),$style(2)) Turn On: { myradio | .timer.myradio 0 10 myradio | echo -a myradio msg on }
.$iif(!$timer(.myradio),$style(2)) Turn Off: { unset %myradio.song | .timer.myradio off | echo -a myradio msg off }
}
alias myradio { sockclose myradio | sockopen myradio 109.169.47.158 80 }
on *:sockopen:myradio: {
if ($sockerr) { echo -a $sockerr | sockclose $sockname | halt }
sockwrite -n $sockname POST /chat/fr2.php?ip=109.169.47.158&port=9522&ip1=&ip2=&ip3=&show=&b=1&radioid=1177905 HTTP/1.0
sockwrite -n $sockname Host: 109.169.47.158
sockwrite -n $sockname $crlf
}
on *:sockread:myradio: {
if ($sockerr > 0) return
var %myradio | sockread %myradio
if ($regex(%myradio,/<center>Song : (.*?)<\/body></html> <\/body>/)) {
if ($regml(1) == Radio Status : Off) { sockclose $sockname | halt }
if (%myradio.song != $regml(1)) && ($regml(1) != $null) { set %myradio.song $regml(1) | msg %myradioroom Now playing: $regml(1) on http://independent.listen2myradio.com }
sockclose $sockname
}
}
Edited Jul 18, 2011 6:04 PM by err0r
Get information about ircWx here
err0r
Subject Matter Expert Member #20,793
type this in your script and u can get the exact room name you will need... //echo -a $active
you can also change the menu for adding channel
menu channel {
My Radio
.Set Channel: { set %myradioroom $chan | echo -a channel : %myradioroom }
.$iif($timer(.myradio),$style(2)) Turn On: { myradio | .timer.myradio 0 10 myradio | echo -a myradio msg on }
.$iif(!$timer(.myradio),$style(2)) Turn Off: { unset %myradio.song | .timer.myradio off | echo -a myradio msg off }
}Then you can simply set it by being in that room.
Edited Jul 18, 2011 11:16 PM by err0r
Get information about ircWx here
JOhnson
I know not of what I speak Member #27,425

err0r question ? if I have to change my server on the radio will I have to annoy you

for you to get the code to work again as tonight the radio was buffering and people had to wait till it worked ... but I left it as it was for now

as always thank you for any reply
Edited Aug 8, 2011 12:46 AM by JOhnson