mIRC Home    About    Download    Register    News    Help

Print Thread
#203742 25/08/08 10:53 PM
Joined: Jul 2004
Posts: 59
L
Babel fish
OP Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
I have this line in one of my scripts
.&Play Wav:/sound $$hfile="Play a wav!" [ $mircdirsounds\ ] $me just played $filename

I was wondering if anyone could help me with adding the part in red to notice the channel with the Sound file name. I lookes in mirc help for $$hfile help and didnt find anything.

LittleJohn #203743 25/08/08 11:17 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Since $hfile is not part of mIRC (unless it's a hold over from a much older version), then that is what we call a custom identifier, which, in turn, calls for information from an alias, in this case, called hfile.
Check your script for a line that reads:
Code:
alias hfile
or
Code:
alias -l hfile

If you don't have either of those, then you're missing part of the script.
Looking at that script, and checking the help file, it appears that someone has things a bit mixed up, as the /sound command is not meant for playing sounds. That's the /splay command.

Try replacing that line with
Code:
.&Play Wav: .splay $$sfile($wavedir)

and add the following to the code
Code:
on *:waveend:{
  .msg $active $me just played $filename
}

RusselB #203746 25/08/08 11:35 PM
Joined: Jul 2004
Posts: 59
L
Babel fish
OP Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
RusseB,

I believe the $$hfile causes the File dialog to open (must be an and old way of doing this) The /Sound is needed for the other chater to hear the sound being played.

if I use the Play wav as I posted the user can hear it if they have the file if they do not their system requests it. That all seems to work. the part I can not get working is to post the file name that was played.

Thanks for your reply

Last edited by LittleJohn; 25/08/08 11:39 PM.
LittleJohn #203750 26/08/08 02:11 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
.&Play Wav: { var %file = $$sfile($wavedir,Select a file to play at $active,Play it!) | sound $qt(%file) just playing $nopath(%file) }

smile

RusselB #203758 26/08/08 01:31 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Just a suggestion, but it might be worth trying identifiers like that quickly so that you know whether they're built-in or not, rather than throwing what ifs and buts.

A simple //echo -a $hfile="pick a file" will show you it's an outdated version of $sfile()


Link Copied to Clipboard