mIRC Home    About    Download    Register    News    Help

Print Thread
#157159 22/08/06 11:43 PM
Joined: Aug 2006
Posts: 4
T
TAfool Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2006
Posts: 4
Is there any way in mIRC to set up a sound to be played at certain times? I'm in a small traders group and would like to send a sound at the market open and close. We've done it manually for years but it has become quite tedious.

Thanks,
TAfool

#157160 23/08/06 01:41 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The easiest way to do this would require each person in the channel to have the same sound (or at least a sound with the same filename). There are other more complicated methods, but I'm not sure how they would actually be done.

Here's an example of the simplest method that I could think of

Code:
 on me:*:join:#:{
if $time(HH:nn) < 09:00 || $time(HH:nn) > 17:00 {
.timer 09:00 1 1 .splay $chan Opening.wav
}
else {
.timer 17:00 1 1 .splay $chan Closing.wav
}
}

on *:waveend:{
if $filename == opening.wav {
.timer 17:00 1 1 .splay $chan Closing.wav
}
elseif $filename == closing.wav {
.timer 09:00 1 1 .splay $chan Opening.wav
}
}
 

#157161 23/08/06 02:07 AM
Joined: Aug 2006
Posts: 4
T
TAfool Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2006
Posts: 4
Thank you very much. I will play around with a form of what you provided and see if I can make it work.

Regards,
TAfool

#157162 05/09/06 07:53 AM
Joined: Aug 2006
Posts: 4
T
TAfool Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2006
Posts: 4
Thanks for the help, its definitely got me going, however, I get an error of "ON Unkown command".

I've tried several variants (and read the help file!) but nothing seems to get it recognized. Any ideas?

Thanks,
TA

#157163 05/09/06 08:36 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You should be getting a line number and script name with that message. Find the line specified in the script specified and see what you have there. My post (which you say you altered) works per your request.

#157164 05/09/06 08:40 AM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
sounds like you havent closed a } bracket somewhere and the next line is an event catch.(definition)

if the } isn't there then the line is being included in the last bit of code, meaning mirc is trying to use ON x as an alias.

bad-
Code:
alias stuff {
echo -s this is inside the alias
echo -s the next line is where the curly bracket should go but it's commented out
;}

on 1:input:*:{ stuff }

Last edited by billythekid; 05/09/06 09:02 AM.
#157165 05/09/06 08:42 AM
Joined: Apr 2005
Posts: 9
A
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
A
Joined: Apr 2005
Posts: 9
on me:*:join:#:{
looks like it should be corrected to
on $me:*:join:#:{

#157166 05/09/06 08:46 AM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
The $ prefix
Indicates that the matchtext section of a definition contains a regular expression.

on $*:TEXT:m/regular expression/switches:#:/echo message: $1-


billythekid
#157167 05/09/06 08:54 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Per Billythekid's note, the $ in that location would indicate a regular expression match text, which the ON JOIN event does not have.

The format of that ON JOIN event is correct and limits the commands that follow it, so that they only execute when you join the channel.

#157168 07/09/06 02:38 AM
Joined: Aug 2006
Posts: 4
T
TAfool Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Aug 2006
Posts: 4
The help here is great!

While playing around I did get lots of errors that listed the line and the error so I know what you're saying but this is a notice in the status screen. "ON Unknown command" still comes up but the script below is working.

Since we wanted it to be easy we chose something that most everyone would have....tada.wav. And since it's the same sound for open and close I was able to simplify it by using:

on me:*:join:#[our group]:{
timer 06:30:00 1 1 .sound tada.wav The market is open! {
on *:WAVEEND:/timer 06:30:00 1 1 .sound tada.wav The market is open!}
timer 13:00:00 1 1 .sound tada.wav The market is closed. Hope your day was good! {
on *:WAVEEND:/timer 13:00:00 1 1 .sound tada.wav The market is closed. Hope your day was good!}
}

This gets 2 timers queued. As soon as the one plays it resets for the next time set.

This seems to work great and I will add some form of if/then/goto to eliminate Saturday/Sunday alarms when I get a chance. I know nothing of this programing stuff so it takes a while.

And yes, yours worked but since we only had one sound I just couldn't leave well enough alone.

Thank you for the help. Really!
TA


Link Copied to Clipboard