mIRC Home    About    Download    Register    News    Help

Print Thread
Random sound and sound browser #95056 21/08/04 07:10 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
Hi there,
I always use sound requests with my friends, and I like to have a command that requests a RANDOM sound among the wavs on the sound directory. How can I do?

And how could I do to have a visual "browser" for the sounds? They are more than 600 and it's difficult to remember them and uncomfortable to let the directory open.

Thanks a lot

Re: Random sound and sound browser #95057 21/08/04 08:07 PM
Joined: Feb 2004
Posts: 714
Z
Zyzzyx26 Offline
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Usage is: /listsounds
It should open a dialog with all your .wav files listed. (Untested)
Code:
alias ListSounds {
 var %i = $findfile([color:green]"c:\directory of files"[/color],*.wav,0)
 while (%i) {
  hadd -m SoundList $nopath($findfile([color:green]"c:\directory of files"[/color],*.wav,%i))
  dec %i
 }
 dialog -m Sounds Sounds
}
on *:DIALOG:Sounds:init:*: {
  var %x = $hget(SoundList,0).item
  while (%x) { 
   did -a Sounds 1 $hget(SoundList,%x).item $hget(SoundList,%x).data
   dec %x
  }
  hfree SoundList
}
dialog Sounds {
  title "Sounds"
  size -1 -1 167 170
  option dbu notheme
  list 1, 4 4 159 149, vsbar size sort
  button "Close", 2, 128 156 32 12, ok
}
You must just replace with the correct directory of the wavs

I am not sure I got the random request matter straight. I understood that you wanted to send a random .wav file when someone request it.. so the code that follows should do that.
Code:
on *:TEXT:[color:blue]!random sound*[/color]:[color:red]#[/color]: {
 var %y = $findfile([color:green]"c:\directory of files"[/color],*.wav,0)
 dcc send $nick $findfile([color:green]"c:\directory of files"[/color],*.wav,$rand(1,%y))
} 
Replace with the correct directory of the wavs. You can also change the trigger command and the channel (specific chan or all).

I hope these work smile

Zyzzyx.

Note: I edited the code because it had a little mistake. You should copy the code that has this message under it!

Last edited by Zyzzyx26; 21/08/04 08:16 PM.

"All we are saying is give peace a chance" -- John Lennon
Re: Random sound and sound browser #95058 21/08/04 08:42 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
thanks A LOT but how can I do to double click the sound on the list and make it request?

and: I didnt want to play a random sound on a request, I'd need a command that requests a random sound to another user.

Example: I type /randomsound in the "john" query window and it sends a request of a random sound in the sound directory to john

Last edited by yamaz; 21/08/04 08:46 PM.
Re: Random sound and sound browser #95059 21/08/04 08:47 PM
Joined: Feb 2004
Posts: 714
Z
Zyzzyx26 Offline
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Hmm.. wierd, works without messages here. Try running it again and see if it appears then smile


"All we are saying is give peace a chance" -- John Lennon
Re: Random sound and sound browser #95060 21/08/04 08:50 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
I edited the message above smile Read it now please

Re: Random sound and sound browser #95061 21/08/04 08:58 PM
Joined: Feb 2004
Posts: 714
Z
Zyzzyx26 Offline
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
You lost me on the request thing. :P These sounds that are listed in the dialog are the ones inside your computer. You cannot list the songs that are on someone else's HD.

" I type /randomsound in the "john" query window and it sends a request of a random sound in the sound directory to john" - When you say 'sends a request in the directory to John', you mean you want to GET a wav FROM John? Or SEND a wav TO him?

Same question goes for the double click thing? You want to SEND or GET?

BTW, if you want to get that song, it would require for the other person so send it to you. You can't simply download it from someone without their knowledge.


"All we are saying is give peace a chance" -- John Lennon
Re: Random sound and sound browser #95062 21/08/04 09:15 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
it's to send a request to make play the sound I want on John's OC smile john is supposed to have exactly the same sounds as me smile

The sound are just stupid quotes from movies and stuff like that......it's just for fun

Re: Random sound and sound browser #95063 21/08/04 09:36 PM
Joined: Feb 2004
Posts: 714
Z
Zyzzyx26 Offline
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Oh, I see now.. smile Try this:
Code:
alias ListSounds {
 var %i = $findfile([color:red]"c:\directory of files"[/color],*.wav,0)
 while (%i) {
  hadd -m SoundList $nopath($findfile([color:red]"c:\directory of files"[/color],*.wav,%i))
  dec %i
 }
 dialog -m Sounds Sounds
}
on *:DIALOG:Sounds:init:*: {
  var %x = $hget(SoundList,0).item
  while (%x) {
   did -a Sounds 1 $hget(SoundList,%x).item $hget(SoundList,%x).data
   dec %x
  }
  hfree SoundList
}
on *:DIALOG:Sounds:dclick:1: sound $active $did(1).seltext
dialog Sounds {
  title "Sounds"
  size -1 -1 167 170
  option dbu notheme
  list 1, 4 4 159 149, vsbar size sort
  button "Close", 2, 128 156 32 12, ok
}

Code:
alias [color:blue]randomsound[/color] {
 var %y = $findfile([color:red]"c:\directory of files"[/color],*.wav,0)
 sound $active $findfile([color:red]"c:\directory of files"[/color],*.wav,$rand(1,%y))
}
In both you must change the file directory. In the 2nd code you can also change the alias name (change "randomsound" for whatever you want)


"All we are saying is give peace a chance" -- John Lennon
Re: Random sound and sound browser #95064 22/08/04 09:22 AM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
I really don't know how to thank you....it works perfectly....thank you VERY much smile

Re: Random sound and sound browser #95065 22/08/04 11:50 AM
Joined: Feb 2004
Posts: 714
Z
Zyzzyx26 Offline
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Awesome! Have fun wink


"All we are saying is give peace a chance" -- John Lennon