mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
I am having trouble with this code to help me catch @fid results in PM, can yall give it a looksie and point me in the right irection again?
Code:
alias stripinfo {
  set %msginfo $1-
  set %msg2 $pos(%msginfo,!,1)
  set %msg3 $pos(%msginfo,.mp3,1)
  set %msg4 $mid(%msginfo,%msg2,%msg3)
  return $left(%msg4,$pos(%msg4,.mp3,1)) $+ mp3
}
alias f5 {
  var %finder $input(Search $active for what artist song?,eoq,Search $active,Artist Song,Search)
  if ($active == #ircwavplayers) { msg $active @find * $+ $replace(%finder,$chr(32),$chr(42)) $+ *mp3
    elseif ($active == #mp3junkies) { msg $active @locator %finder }
  }
}
;Events
on *:TEXT:*:?:{
  if (.mp3 isin $1-) {
    window -els @Search
    var %msg $1-
    aline @search $comchan($nick,1) $stripinfo(%msg)
  }
}



keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
You didn't post what your error was; however, I can see a couple things that might be causing problems. The code for the $stripinfo identifier can be inserted straight into the on TEXT since it is quite short, so I made that change. Also, the F5 alias had a bracket problem: the ElseIf was inside the If, also fixed. The only other change I made was to strip all codes from $1- every time it's used (possibly unnecessary but wise anyway - future scripts might format their filename msgs to make them "pretty."
Code:

alias F5 {
  var %finder $input(Search $active for what artist song?,eoq,Search $active,Artist Song,Search)
  if ($active == #ircwavplayers) msg $active @find $+(*,$replace(%finder,$chr(32),$chr(42)),*mp3)
  elseif ($active == #mp3junkies) msg $active @locator %finder
}
;Events
on *:TEXT:*:?:{
  if (.mp3 isin $strip($1-)) {
    window -els @Search
    aline @search $comchan($nick,1) $mid($strip($1-),$pos($strip($1-),!,1),$calc($pos($strip($1-),.mp3,1) + 3))
  }
}
Hopefully, the above code will help you along the way. It's hard to tell, though, without knowing what the problems you were having are.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
thank you for the reply Hammer, your code is working alot better than mine, exept that it doesnt remove all the stuff after the .mp3, which is ok, since the nessecary information is there to request and stuff, thanks for the help smile grin


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.

Link Copied to Clipboard