|
Rock1019
|
Rock1019
|
I'm working on my first mIRC bot for my internet radio station's IRC chat. I'm having some problems however, so I was wondering if anybody here can help me. Problem 1: on 1:JOIN:#:{
if ( $me == RockBotLive ){ /notice $nick Welcome to #rock1019 $nick $+ , a DJ is currently broadcasting live! Visit http://www.1019theedge.com to tune in. }
else { /notice $nick Welcome to #rock1019 $nick $+ ! }
}
- It works great if the bot's nick is RockBotLive but the else statement doesnt send the notice when the bot's name is RockBot. Problem 2: on 1:TEXT:!onair*:#:{
/nick RockBotLive
/ns identify ******
/topic # Rock 101.9 The Edge - Today's Hottest Rock $chr(124) Now Playing: $2- $chr(124) http://www.1019theedge.com
} - How can I make this part of the script only available to ops in the channel? I tried making it "on @1:TEXT:" like a friend suggested but it didn't work. Any help is appriciated and I hope to hear from someone soon. Thanks! Rock1019
Last edited by Rock1019; 04/09/04 11:55 PM.
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
1.
Change
if ( $me == RockBotLive ){
to
if ( $me == RockBotLive ) {
2.
Change
on 1:TEXT:!onair*:#:{
to
on @1:TEXT:!onair*:#:{
|
|
|
|
Rock1019
|
Rock1019
|
on @1:TEXT:!onair*:#:{
/nick RockBotLive
/ns identify 1019theedge
/topic # Rock 101.9 The Edge - Today's Hottest Rock $chr(124) Now Playing: $2- $chr(124) http://www.1019theedge.com
} That still isn't working, anybody in the channel can do the command.
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
Sorry, my mistake: on 1:TEXT:!onair*:#:{
if ($nick isop $chan) {
/nick RockBotLive
/ns identify 1019theedge
/topic # Rock 101.9 The Edge - Today's Hottest Rock $chr(124) Now Playing: $2- $chr(124) http://www.1019theedge.com
}
} Edit: not that it matters, but you can simply use $(|) instead of $chr(124)
Last edited by tidy_trax; 05/09/04 12:14 AM.
|
|
|
|
Rock1019
|
Rock1019
|
Thanks everything is working perfect now, and thats good to know about the $(|).
Rock1019
Last edited by Rock1019; 05/09/04 12:28 AM.
|
|
|
|
Rock1019
|
Rock1019
|
Okay, I have one more question  Is there any way for my RockBot to launch a program (winamp) and load a stream (Rock 101.9 The Edge) when a user in the chatroom types say, "!tunein" ? Thanks, Rock1019
|
|
|
|
Joined: Jan 2003
Posts: 2,973
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,973 |
At best, you can have it advertise the link to the .pls file, and instruct them to double-click. Having it launch a program would be a security threat, as some things aren't so innocent as this could be. An alternative would be to have the users download a simple mIRC script that would launch it for them. Posting a link is much simpler though.
|
|
|
|
Joined: Mar 2004
Posts: 540
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 540 |
I help run a internet radio station. If you are using shoutcast there is a way to do all this. We have a mirc bot running and on the same computer we have RTB(Radio Tool Box) It lets you get stats on the current streams. We have the bot read the log file every so many seconds and itll post the current song, dj(That would be the description part in the winamp shoutcast DSP) current listeners what not.
|
|
|
|
Rock1019
|
Rock1019
|
We have an eggdrop bot for song title and listeners but it only works for one bitrate, would RTB be able to display multiple bitrate information together as one? For example, we have 10 96k slots and 10 32k slots, so say there was 5 96k listeners and 3 32k listeners, would it display "Listeners: 8" ? If so, I may be interested and I might even just try it for fun, so how would I get my RockBot to read the logfile?
Thanks! Rock1019
|
|
|
|
Joined: Mar 2004
Posts: 540
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 540 |
Yea it does but you pick a main server to get the main info from IE your dj server. I run a script that gets the xml info from each relay to see per server info First have this
alias xmlNodeVal {
; Usage: $xmlNodeVal(location, pattern[, separator])[.xml]
;
; location : either a local file or a web resource
;
; pattern : a valid XST expression:
; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmconpatterns.asp
;
; separator : an ascii value. use when retrieving multiple nodes
;
; .xml : returns <TAG>+text instead of plain text
;
; For example, this lists the current listeners on a SHOUTCast server:
; $xmlNodeVal(http://admin:pass@127.0.0.1:8000/admin.cgi?mode=viewxml,/SHOUTCASTSERVER/LISTENERS/LISTENER/HOSTNAME, 32)
.comopen oDOM Msxml2.DOMDocument
if $comerr { return }
!.echo -q $com(oDOM, async, 4, bool, false)
if !$com(oDOM, load, 1, bstr, $1) || !$com(oDOM, selectNodes, 1, bstr, $2, dispatch* colNodes) {
.comclose oDOM
return
}
var %val, %sep = $iif($3, $3, 32), %prop = $iif($prop, xml, text)
var %i = $comval(colNodes, 0)
while %i {
%val = $instok(%val, $comval(colNodes, %i, %prop), 1, %sep)
dec %i
}
.comclose colNodes
.comclose oDOM
return %val
}
Then
alias bbdjinfo {
var %bbdjinfo.dj = $xmlNodeVal(http://UNAME:PASS@IP:PORT/admin.cgi?mode=viewxml, /SHOUTCASTSERVER/SERVERTITLE)
var %bbdjinfo.listeners = $xmlNodeVal(http://UNAME:PASS@IP:PORT/admin.cgi?mode=viewxml, /SHOUTCASTSERVER/CURRENTLISTENERS)
var %bbdjinfo.maxlisteners = $xmlNodeVal(http://UNAME:PASS@IP:PORT/admin.cgi?mode=viewxml, /SHOUTCASTSERVER/MAXLISTENERS)
var %bbdjinfo.song = $xmlNodeVal(http://UNAME:PASS@IP:PORT/admin.cgi?mode=viewxml, /SHOUTCASTSERVER/SONGTITLE)
var %bbdjinfo.bitrate = $xmlNodeVal(http://UNAME:PASS@IP:PORT/admin.cgi?mode=viewxml, /SHOUTCASTSERVER/BITRATE)
msg %stream.chan DJ Server: 4DJ: %bbdjinfo.dj 4Song: %bbdjinfo.song 4Listeners: ( $+ %bbdjinfo.listeners $+ / $+ %bbdjinfo.maxlisteners $+ ) 4Bitrate: %bbdjinfo.bitrate
}
So it would look like DJ Server: DJ: JWolf Song: Pearl Jam - Live 2003-05-02 CD 1 of 3 - 09/12. Faithful Listeners: (5/10) Bitrate: 128 I wouldnt reccomend using this as the main part of the bot since It ties mirc up if you could find a dll for this it would go faster
Last edited by Armada; 06/09/04 05:41 AM.
|
|
|
|
Rock1019
|
Rock1019
|
/me is a little consfused
How does this work? I want to have remote !listeners and !song commands and the listeners should display 2 different bitrates combined as one (X/20)... lol
|
|
|
|
Joined: Mar 2004
Posts: 540
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 540 |
Youd on text that alias change it so it would message your channel, make another alias to check the other server and have it add the 2 variables up it helps if you think about it more then 5 minutes
|
|
|
|
Rock1019
|
Rock1019
|
Sorry, im a bit of a n00b hehe. Thanks
|
|
|
|
|