mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Is there a way to make this timer playable to more than one channel?


Code:
alias silentmp3 {
  set %silentfilename $findfile($mp3dir,*.mp3,$rand(1,$findfile($mp3dir,*.mp3,0)))
  set %silentlength $duration($duration($calc($sound(%silentfilename).length / 1000 )))
  ctcp %silentchan mp3 $nopath(%silentfilename)
  msg %silentchan  $+ $color(info) $+ Artist : $+ $color(ctcp) $sound(%silentfilename).artist  $+ $color(normal) <><> $+ $color(info) Title: $+ $color(ctcp) $sound(%silentfilename).title  $+ $color(normal)
  msg %silentchan  $+ $color(info) $+ Length : $+ $color(ctcp) $duration($calc($sound(%silentfilename).length / 1000))  $+ $color(normal) <><> $+ $color(info) Mode: $+ $color(ctcp) $sound(%silentfilename).mode  $+ $color(normal) <><>  $+ $color(info) $+ Bitrate: $+ $color(ctcp) $sound(%silentfilename).bitrate kbs
  msg %silentchan  $+ $color(info) $+ ! $+ $me $nopath(%silentfilename)
  .timersilentrandom 1 %silentlength silentmp3
}



This timer works great on one channel, but what i want it to do is play to more than one channels, not all of them, just ones that I can add with a popup. Does this make sense? sorry, its late and i need sleep.


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 212
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
how bout simply putting while whoops in there?
like while ($chan(0)) {
if (I want to msg to this chan) { msg | ctcp }
dec %i
}


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
as the other guy who posted said, use while loops.

Also, using the .timer to call the alias that it is in *should* create an infinate loop (don't know if this is what you want...)

have a popup to add the current chan to a variable something like this:
Add $active $+ :{ addtok(%playmp3channels,$active,32)

and then in the alias, have:
Code:
alias aliasname {
  ;choose random file to play here...
  var %i = 1
  while %i <= $numtok(%playmp3channels,32) {
    ;while %i is less than or equal to the number of channels in the variable, do this:
    msg $gettok(%playmp3channels,%i,32)  bleh...
    msg $gettok(%playmp3channels,%i,32)  blah...
    msg $gettok(%playmp3channels,%i,32)  bluh...
    ;messages the selected channel what ever...
    inc %i
  }
.timer bleh...
}


something like that, so you can add/remove a channel from the playing list, and get your script to play the mp3 to all of the selected channels.

Don't know if the above is correct, just wrote it, not got time to check!!!

Try it yourself smile


And yes, I know the link below doesn't work!!!


Aubs.
cool

Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
thanks for the input Aubs, this is what i came up with:
I made a menu item to write the channel names to a text file, and added this code to my script :
Code:
 alias silentmp3 {
  var %scn $lines($mircdir $+ $network $+ silentchanlist.txt)
  while %scn > 0 {
    set %silentfilename $findfile($mp3dir,*.mp3,$rand(1,$findfile($mp3dir,*.mp3,0)))
    .ctcp $read($mircdir $+ $network $+ silentchanlist.txt,%scn) mp3 $nopath(%silentfilename)
    msg $read($mircdir $+ $network $+ silentchanlist.txt,%scn)  $+ $color(info) $+ Artist : $+ $color(ctcp) $sound(%silentfilename).artist  $+ $color(normal) <><> $+ $color(info) Title: $+ $color(ctcp) $sound(%silentfilename).title  $+ $color(normal)
    msg $read($mircdir $+ $network $+ silentchanlist.txt,%scn)  $+ $color(info) $+ Length : $+ $color(ctcp) $duration($calc($sound(%silentfilename).length / 1000))  $+ $color(normal) <><> $+ $color(info) Mode: $+ $color(ctcp) $sound(%silentfilename).mode  $+ $color(normal) <><>  $+ $color(info) $+ Bitrate: $+ $color(ctcp) $sound(%silentfilename).bitrate kbs
    msg $read($mircdir $+ $network $+ silentchanlist.txt,%scn)  $+ $color(info) $+ ! $+ $me $nopath(%silentfilename)
    dec %scn 1
  }
}
 
it seems to be working pretty good, but i wouldnt recommend using it for anything over 4 channels, for fear of gettig disconnected for flooding. once again thanks for the input


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
try opening a debug window, "/debug -p @debug" the see how amsg or ame works, you can send to more than one channel at a time with msg #channel1,#channel2 message.

Joined: Dec 2002
Posts: 212
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
yes, he can, but MAXTARGETS is different on different networks so he may come up with a problem. On mine it's 4 for example, so if he wants to send to 5 chans he need at least 2 lines
a good point tho!;)


And all I need now is intellectual intercourse, a soul to dig the hole much deeper

Link Copied to Clipboard