|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
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
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)
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Nov 2003
Posts: 227
Fjord artisan
|
Fjord artisan
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)
|
|
|
|
Joined: Dec 2002
Posts: 774
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 774 |
var %a = $numtok( $read( %read , %mp3.songnum ) , 32 )
does this work?
//if ( khaled isgod ) echo yes | else echo no
|
|
|
|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 397 |
ok rat your thing fixed my problem but it echos nothing... shouldnt it be echoing something?
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
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 alias mp4.play {
var %a = $read($mircdirmp3\mp3list.txt,%mp3.songnum)
echo -a $mid(%a,2,$calc($pos(%a,.mp3,1) +2))
}
|
|
|
|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
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 =]
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
|
|
|
|
Joined: Dec 2003
Posts: 33
Ameglian cow
|
Ameglian cow
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.
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 }
}
|
|
|
|
|