mIRC Home    About    Download    Register    News    Help

Print Thread
#235410 15/12/11 08:53 AM
Joined: Nov 2011
Posts: 30
A
arc123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2011
Posts: 30
Code:
on *:load:{
  echo -s Sound Mp3
  sound, select sound file by open play
}

menu channel,menubar {
  -
  sound 
  .Play:mp3
}

alias mp3 {
  set %mp3 $file="select song" 
  set %siz $round($calc($int($calc($file(%mp3).size / 1049)) / 1000),2) MB
  set %wlength $calc($mp3(%mp3).length / 1000)
  set %wtime $duration(%wlength)
  if ($chr(32) isin %wtime) { %wtime = $remove(%wtime,$chr(32)) }
  if (%mp3 != $null) {
  run %mp3 }
  else halt
  if (%addinfo == $true) { %msg %wacko.title %ic2 $+ $nopath(%mp3) %div.color %div %ic Size: %ic2 %siz %div.color %div %ic Length: %ic2 %wtime %div.color %div %ic File Info: %ic2 $mp3(%mp3).bitrate Kbps %ic / %ic2 $calc($mp3(%mp3).sample * .001) Khz %ic / %ic2 $mp3(%mp3).mode }
  else { %msg %wacko.title %ic2 $+ $nopath(%mp3) %div.color %div %ic Size: %ic2 %siz %div.color %div %ic Length: %ic2 %wtime }
  else halt
}


wanna ask if i can edit that code as when i open a song and close

and then open it again it give me the previous folder .. so i wanted to save the last place for the last song i opened so that i just click on play and choose it and not have to go through folders again ... ty

arc123 #235412 15/12/11 11:08 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Save your current path from $insong.fname or when obtaining the file using $sfile(somepath) and then use it in $sfile(%pathvar) when you want to open the next song. Just check if your variable has something in it. If it does, use that. If it does not, set the variable to a default path. Don't forget to remove the filename from the path.


Invision Support
#Invision on irc.irchighway.net
arc123 #235422 16/12/11 03:16 AM
Joined: Nov 2011
Posts: 30
A
arc123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2011
Posts: 30
still didnt get it cuz i didnt could it really laugh

arc123 #235424 16/12/11 05:39 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Try this modification/compression of your mp3 alias:
Code:
alias mp3 {
  set %mp3 $$sfile($iif($isdir($nofile(%mp3)),$nofile(%mp3) $+ *.mp3,$mircdir),select song,Play!)
  var %siz = $bytes($file(%mp3).size,m) MB
  var %wtime = $remove($duration($calc($mp3(%mp3).length / 1000)),$chr(32))
  run %mp3
  %msg %wacko.title %ic2 $+ $nopath(%mp3) %div.color %div %ic Size: %ic2 %siz %div.color %div %ic Length: %ic2 %wtime $&
    $iif((%addinfo == $true),%div.color %div %ic File Info: %ic2 $mp3(%mp3).bitrate Kbps %ic / %ic2 $calc($mp3(%mp3).sample * .001) Khz %ic / %ic2 $mp3(%mp3).mode)
}

arc123 #235426 16/12/11 08:59 AM
Joined: Nov 2011
Posts: 30
A
arc123 Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2011
Posts: 30
yea thanks it worked


Link Copied to Clipboard