mIRC Home    About    Download    Register    News    Help

Print Thread
#108943 24/01/05 01:12 PM
Joined: Jan 2005
Posts: 18
H
Ho0tz04 Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Jan 2005
Posts: 18
I've been trying for a day now, to able to do an on input command, where if i type !find <artist name> it will search my mp3 folder and echo back just songs by that artist including tha artists name.

Here is my code.

mp3.search {
var %mp3.search $findfile(%mpegdir,$2-* $+ .mp3,0)
while (mp3.search) { /echo -a $1- }
dec %mp3.search
}

I apologize for the hidious coding, but any help would be GREATLY appreciated.

-Ho0tz aka arkt1k

#108944 24/01/05 01:21 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias mp3.search { .echo -q $findfile(%mpegdir,$1-*.mp3,0,echo -a $1-) }


/mp3.search <filename wildcard>


New username: hixxy
#108945 24/01/05 01:37 PM
Joined: Jan 2005
Posts: 18
H
Ho0tz04 Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Jan 2005
Posts: 18
Wow thank you very much, i making something harder than it really was. smile

What's the wildcard ?

I tried it and it just echoed 0

Last edited by Ho0tz04; 24/01/05 01:46 PM.
#108946 24/01/05 01:49 PM
Joined: Oct 2003
Posts: 96
J
Babel fish
Offline
Babel fish
J
Joined: Oct 2003
Posts: 96
wildcard ...

/mp3.search *van*halen*eruption*

#108947 24/01/05 01:58 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
The <filename wildcard> should be part of the song name, eg:

Code:
;The following would look for any songs that start with dj.
/mp3.search dj

;The following would look for any songs that have dj anywhere in the name.
/mp3.search *dj


New username: hixxy
#108948 24/01/05 02:21 PM
Joined: Jan 2005
Posts: 18
H
Ho0tz04 Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Jan 2005
Posts: 18
One last thing and I will let u go. how would I use that in a /me and now have it echo how many files there were shown.

(ie:D:\Mp3's\Disturbed - Down With The Sickness.mp3
D:\Mp3's\Disturbed - Get Psycho.mp3
D:\Mp3's\Disturbed - Prayer.mp3
3

#108949 24/01/05 02:37 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias mp3.search { describe $chan $findfile(%mpegdir,$1-*.mp3,0,describe $chan $1-) }


New username: hixxy
#108950 24/01/05 02:42 PM
Joined: Oct 2003
Posts: 96
J
Babel fish
Offline
Babel fish
J
Joined: Oct 2003
Posts: 96
and then watch as that floods the channel if it finds 50 files lol

Edit: This will play a random file from the results if any.
Code:
alias mp3.search {
  if (!$window(@mp3.search)) window -lh @mp3.search
  clear @mp3.search
  var %f = $findfile(%mpegdir,$+($1-,.mp3),0,@mp3.search)
  if (!%f) return
  var %file = $line(@mp3.search,$rand(1,%f))
  if (($active ischan) || ($query($active))) describe $active is playing: $nopath(%file)
  else echo -a Playing: $nopath(%file)
  splay $+(",%file,")
}

Last edited by JoeDaddy; 24/01/05 03:08 PM.
#108951 24/01/05 03:55 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Quote:
and then watch as that floods the channel if it finds 50 files

To help moderate these innocent scripts, mIRC has an internal flood protection system that can queue own commands and messages: Alt+O > IRC > Flood.

#108952 24/01/05 04:12 PM
Joined: Oct 2003
Posts: 96
J
Babel fish
Offline
Babel fish
J
Joined: Oct 2003
Posts: 96
That will protect from that but I'm sure he doesn't want
to play every result to the channel .. and could still get
a channel flood ban.

#108953 24/01/05 04:13 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Quote:
but I'm sure he doesn't want
to play every result to the channel


I just gave him what he asked for, nothing more nothing less. smile


New username: hixxy
#108954 24/01/05 04:15 PM
Joined: Oct 2003
Posts: 96
J
Babel fish
Offline
Babel fish
J
Joined: Oct 2003
Posts: 96
true .. my bad


Link Copied to Clipboard