|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
how do you create a playlist like this open a dialog with youre mp3dir and loadmp3s and at the right an empty one and a button between them like this " >> " and transport left mp3s to the right (left must remain in left dialog) and then play them when clicked play playlist
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
and how do i do this :
var %x = $findfile(%mp3dir,*mp3,0,did -a mp3 11 $nopath($1-)) }
instead of scanning mp3 dir i want the sucker to read the mp3.txt file and read that in the list
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
* create a dialog gui with two listboxes and a few buttons (I use list ID,x y w h,sort extsel hsbar) * when the button is pressed, read the lines in the left box one at a time and write them to the right box. Something along the lines of:
on *:DIALOG:[color:red]tablename[/color]:SCLICK:[color:red]id-of->>-button[/color]: {
; [color:brown]find how many lines are selected[/color]
var %i = $did($dname,[color:red]id-left[/color],0).sel
var %j = 1
; [color:brown]loop through them[/color]
while (%j <= %i) {
did -a $dname [color:red]id-right[/color] $did($dname,[color:red]id-left[/color],$did($dname,[color:red]id-left[/color],%j).sel)
inc %j
}
}
Parts in red need to be fixed up.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Dec 2002
Posts: 127
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 127 |
learn to use the helpfile.
alias foob { var %x = 1, %max = $lines(mp3.txt) while (%x <= %max) { did -a mp3 11 $nopath($read(mp3.txt,%x)) inc %x } }
------ deep down, i'm really superficial.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
$findfile doesn't read textfiles dude. try typing /help /loadbuf or /help /filter in your mirc. you could use either one. heck, you could even write a loop with $read, but I really suggest /loadbuf or /filter
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Dec 2002
Posts: 127
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 127 |
using /loadbuf or /filter is definitely faster, but not as flexible. if he wants to make use of $nopath() (and based on his first post, he does), then $read is a more viable option.
------ deep down, i'm really superficial.
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
Thank you all for youre fast replys : ) Its al usefull thanks
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
perhaps. problem comes when he wants to actually play these files. if he has them in different directories, and doesn't specify those, he'll need $findfile to find em again. My script actually saves the fullpath in a file, and when called upon I loadbuf it to a custom window and dump the window to the dialog without filepaths. it's the long way around, but especially on large playlists it's still gonna be faster than a $read loop directly
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Dec 2002
Posts: 127
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 127 |
not necessarily. he wouldn't have to use findfile if the mp3.txt kept the full paths to the files. he could just /splay $read(mp3.txt,w,$+(*,$did(mp3,11).sel)) to return the right filename.
------ deep down, i'm really superficial.
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
alias /test { dialog -m test test | did -r test 1 | var %x = $findfile(%mp3dir,*mp3,0,did -a test 1 $nopath($1-)) } alias f1 test
dialog test { title "moo" size -1 -1 121 57 option dbu list 1, 4 2 50 50, size list 2, 68 2 50 50, size button ">>", 3, 55 3 13 12 button "ok", 4, 58 32 8 12, ok }
on *:DIALOG:test:SCLICK:3: { ; find how many lines are selected var %i = $did($dname,1,0).sel var %j = 1 ; loop through them while (%j <= %i) { did -a $dname 2 $did($dname,1,$did($dname,2,%j).sel) inc %j } }
on *:dialog:test:sclick:*: { if $did = 3 { .splay pause } if $did = 4 { .splay stop } if $did = 5 { .splay resume } if $did = 6 { did -r test 11 | var %x = $read(system\mp3test.txt,did -a test 11 $nopath($1-)) | /foob } }
alias foob { var %x = 1, %max = $lines(system\mp3.txt) while (%x <= %max) { did -a mp3 2 $nopath($read(system\mp3.txt,%x)) inc %x } }
now i have this but it gives this error: [04:07pm] [Unknown command (%J]
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
replace: on *:DIALOG:test:SCLICK:3: { ; find how many lines are selected var %i = $did($dname,1,0).sel var %j = 1 ; loop through them while (%j <= %i) { did -a $dname 2 $did($dname,1,$did($dname,2,%j).sel) inc %j } }
with:
on *:DIALOG:test:SCLICK:3: { ; find how many lines are selected var %i = $did($dname,1,0).sel var %j = 1 ; loop through them while (%j <= %i) { did -a $dname 2 $did($dname,1,$did($dname,2,%j).sel) inc %j } }
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 127
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 127 |
instead of just copying/pasting our code, why not try and learn from it? or, hey, even reading it before asking why it doesn't work!
anyway, the problem is on the 6th line of yout sclick event. you're missing a 'while' statement in front of your test.
edit: look, even phoenix knew what the problem was! hhos
Last edited by feud; 18/07/03 02:13 PM.
------ deep down, i'm really superficial.
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
alias /test { dialog -m test test | did -r test 1 | var %x = $findfile(%mp3dir,*mp3,0,did -a test 1 $nopath($1-)) } alias f1 test
dialog test { title "moo" size -1 -1 121 57 option dbu list 1, 4 2 50 50, size list 2, 68 2 50 50, size button ">>", 3, 55 3 13 12 button "ok", 4, 58 32 8 12, ok }
on *:dialog:test:sclick:3: { ; find how many lines are selected var %i = $did($dname,1,0).sel var %j = 1 ; loop through them while (%j <= %i) { did -a $dname 2 $did($dname,1,$did($dname,2,%j).sel) inc %j } }
thanks pheonix first the right list did nothing no it does a thing { flipping } :P have a file selected and if i press >> first time white press 10 times than the first name of the mp3 dir appeared and then 10 times more the second did :P how to solve that? i cant find a clue
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
sorry i dont understand what you're asking for :tongue:
new username: tidy_trax
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
that mp3 from the left list go to the right list with this '>>' button (left mp3s must stay there) that selected mp3 on left copied to the list on the right
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
You're right, but my point was that the way I described will be faster when you are dealing with large playlists. mIRC isn't the fastest when it comes to reading files.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Dec 2002
Posts: 127
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 127 |
------ deep down, i'm really superficial.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Dr4g0n: far as I can tell from your last post you are asking exactly the same as you did originally, which makes me wonder why you maimed the working code you were given... Lemme give you a hint: In your last post of code you have the following line: did -a $dname 2 $did($dname,1,$did($dname,2,%j).sel) Compare that VERY VERY CLOSELY with the code I gave you. You screwed up translating my line to yours....
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 68 |
lolll :P i have it thank u very mch
|
|
|
|
|