mIRC Home    About    Download    Register    News    Help

Print Thread
#63985 14/12/03 04:49 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
ok idk if my mirc is pissy or w/e but i have been playing around with tokens and stuff and it seems to not want to work right

Code:
alias mp4.play {
  var %read $mircdirmp3\mp3list.txt
  var %a $numtok($read(%read, %mp3.songnum), 32)
  echo $findtok($remove($read(%read, %mp3.songnum), "), %a, 32)
}


i get this error: * Invalid format: $numtok (line 264, script.mrc)


Need amazing web design for low price: http://www.matrixn3t.net
#63986 14/12/03 08:05 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
mIRC isn't pissy. If something doesn't work right, you screwed up the code. It really is that simple. Now as for the debugging of your code:

mIRC is very specific about the error, your $numtok has the wrong amount of arguments. Therefor the first thing we do is look it up in the helpfile to discover $numtok requires exactly two parameters. Then we return to your code:

$numtok($read(%read, %mp3.songnum), 32)

First you check your brackets for a misplacement. There is not.

Since the 32 is undeniably a parameter, the problem lies with the $read function you mention.

We look up $read in the helpfile. Only one parameter needed, with optionally more. Not a problem there.

The first parameter shoukld be an existing filename. Does %read return an existing filename? Try doing
[color"blue]//echo -a $exists($mircdirmp3\mp3list.txt)[/color]. If that echoes $true, it exists, but I'm guessing it echoes $false.

If it does return true, the problem must be in the %mp3.songnum. Do an echo of that too.

That's pretty much all the options you have that can cause this error...



DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#63987 14/12/03 10:10 AM
Joined: Nov 2003
Posts: 227
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 227
I'm not having any problems with:
//echo -a $numtok($null,32)
or
//echo -a $numtok(,32)
i would try added the n flag to the $read so any text in the file will not be treated as commands.

var %a $numtok($read(%read,n,%mp3.songnum), 32)

#63988 14/12/03 11:40 AM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
var %a = $numtok( $read( %read , %mp3.songnum ) , 32 )

does this work?


Code:
//if ( khaled isgod ) echo yes | else echo no
#63989 14/12/03 06:33 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
ok rat your thing fixed my problem but it echos nothing... shouldnt it be echoing something?


Need amazing web design for low price: http://www.matrixn3t.net
#63990 14/12/03 08:19 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Assuming the file is the same as your other posts:
"C:\Anime\music\gunsmith_cats_-_hateshinai_toiki.mp3 Hateshinai Toiki" Unknown

Code:
alias mp4.play {
  var %a = $read($mircdirmp3\mp3list.txt,%mp3.songnum)
  echo -a $mid(%a,2,$calc($pos(%a,.mp3,1) +2))
}


#63991 14/12/03 10:13 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
nm u guys i finly figured it out ~_~ heres my play script that strips every thing down to just the file name it also works with songs that have spaces in the file name =]

Code:
alias mp3loc {
  var %read $mircdirmp3\mp3list.txt
  var %a = $remove($read(%read, %mp3.songnum), ")
  var %b = $wildtok(%a,*.mp3,1,32)
  var %c = $findtok(%a,%b,32)
  var %d = $calc(%c + 1)
  var %e = $gettok(%a,%d $+ -,32)
  return $remove(%a, %e)
}


thats mainly what i was trying to accplish =p


Need amazing web design for low price: http://www.matrixn3t.net
#63992 15/12/03 03:12 PM
Joined: Dec 2003
Posts: 33
M
Man Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Dec 2003
Posts: 33
ATMA read my posts in your previous threads, you never responded too them, and the codes ALOT smaller, I even developed a new and better way for you to list the songs.

Code:
alias mp3.play {
  if ($dialog(topbar)) {
    if (!%mp3.songnum) { set %mp3.songnum 1 }
    var %songname $read($mircdirmp3\mp3list.txt, n, %songnum)
    if ($regex(file,%songname,/"([^\.]+\.\w+)/)) {
      splay -p $+(",$regml(file,1),")
      startmp3
    }
    else echo -a Error Song not found in line %songnum  }
}


Link Copied to Clipboard