mIRC Home    About    Download    Register    News    Help

Print Thread
#63529 10/12/03 03:04 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
ok this is makeing me nuts and i cant figur out how to do this all i know is u have to use $remove and $gettok thats all i know k

k what i got is a line from a .txt file that looks like this:
"C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy" DHY oav3 ed

what i am trying to do is remove every thing around the file name

this is all i got so far any help and improvements would be nice ~_~

Code:
alias mp3.play {
  if ($dialog(topbar)) {
    if (!%mp3.songnum) { set %mp3.songnum 1 }
    splay -p $read($mircdirmp3\mp3list.txt, %songnum)
    startmp3
  }
}


Need amazing web design for low price: http://www.matrixn3t.net
Joined: Nov 2003
Posts: 228
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Nov 2003
Posts: 228
Are you trying to grab everything between the quotes?

If so,
Code:
alias test {
  ;you can use /tokenize 34
  tokenize 34 "C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy" DHY oav3 ed
  echo -a $1
  ;or $gettok
  var %gettok = $gettok("C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy" DHY oav3 ed,1,34)
  echo -a %gettok
}


Both will return...

C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy

I'm guessing that the "So Bad Boy" after the .mp3 isn't supposed to be inside the quotes though...

Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
nonono im just trying to grab the file location not the other part =/

actualy yea it is supposed to be in between the quotes ;p

Last edited by ATMA; 10/12/03 01:01 PM.

Need amazing web design for low price: http://www.matrixn3t.net
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
$nofile(filename)
Returns the path in filename without the actual filename.

$nopath(filename)

Returns filename without a path if it has one.

$nopath(c:\mirc\mirc.exe) returns mirc.exe

Code:
alias test {
  ;you can use /tokenize 34
  tokenize 34 "C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy" DHY oav3 ed
  echo -a $nofile($1)
  ;or $gettok
  var %gettok = $gettok("C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy" DHY oav3 ed,1,34)
  echo -a $nofile(%gettok)
}


If it ain't broken, don't fix it!
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
blah no im trying to get just C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 thats all _-_


Need amazing web design for low price: http://www.matrixn3t.net
Joined: Dec 2003
Posts: 33
M
Man Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Dec 2003
Posts: 33
Ok I REALLY dont know regular expressions, but I tried really hard and this is what I came up with.

Code:
if ($regex("C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 So Bad Boy" DHY oav3 ed,([^"]+\.[^[:space:]]+))) {
  echo -a $regml(1)
}


I hope it will work

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Code:
  if !%mp3.songnum { set %mp3.songnum 1 }
  var %a = $read($mircdirmp3\mp3list.txt,n,%songnum)
  if $regex(file,%a,/"(.+\.\w+)/) { splay -p $regml(file,1) | startmp3 }

Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
this too returns blank -_-;


Need amazing web design for low price: http://www.matrixn3t.net

Link Copied to Clipboard