mIRC Homepage
Posted By: keeker Help with catching @find results - 16/12/02 02:20 PM
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)
  }
}

Posted By: Hammer Re: Help with catching @find results - 16/12/02 11:01 PM
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.
Posted By: keeker Re: Help with catching @find results - 16/12/02 11:38 PM
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
© mIRC Discussion Forums