mIRC Homepage
Posted By: ATMA things make ppl physco _-_; - 10/12/03 03:04 AM
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
  }
}
Posted By: Seifer Re: things make ppl physco _-_; - 10/12/03 04:12 AM
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...
Posted By: ATMA Re: things make ppl physco _-_; - 10/12/03 12:59 PM
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
Posted By: Doqnach Re: things make ppl physco _-_; - 10/12/03 01:08 PM
$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)
}
Posted By: ATMA Re: things make ppl physco _-_; - 10/12/03 08:38 PM
blah no im trying to get just C:\Anime\music\DHY-oav3-ed-So Bad Boy.mp3 thats all _-_
Posted By: Man Re: things make ppl physco _-_; - 11/12/03 08:33 AM
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
Posted By: Iori Re: things make ppl physco _-_; - 11/12/03 04:04 PM
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 }
Posted By: ATMA Re: things make ppl physco _-_; - 11/12/03 08:27 PM
this too returns blank -_-;
© mIRC Discussion Forums