mIRC Home    About    Download    Register    News    Help

Print Thread
#96722 04/09/04 11:52 PM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
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:
Code:
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:
Code:
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.
#96723 04/09/04 11:56 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
1.

Change

if ( $me == RockBotLive ){

to

if ( $me == RockBotLive ) {

2.

Change

on 1:TEXT:!onair*:#:{

to

on @1:TEXT:!onair*:#:{


New username: hixxy
#96724 05/09/04 12:10 AM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
Code:
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.

#96725 05/09/04 12:12 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Sorry, my mistake:

Code:
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.

New username: hixxy
#96726 05/09/04 12:27 AM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
Thanks everything is working perfect now, and thats good to know about the $(|).

Rock1019

Last edited by Rock1019; 05/09/04 12:28 AM.
#96727 05/09/04 07:03 PM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
Okay, I have one more question grin

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

#96728 06/09/04 12:39 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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.


-KingTomato
#96729 06/09/04 05:00 AM
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
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.

#96730 06/09/04 05:20 AM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
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

#96731 06/09/04 05:40 AM
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
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
Code:
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
Code:
 
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.
#96732 06/09/04 05:48 AM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
/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

#96733 06/09/04 05:51 AM
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
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

#96734 06/09/04 06:22 AM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
Sorry, im a bit of a n00b hehe. Thanks


Link Copied to Clipboard