mIRC Home    About    Download    Register    News    Help

Print Thread
#33940 03/07/03 11:40 PM
Joined: Jun 2003
Posts: 10
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2003
Posts: 10
I am trying to make an alias that will check if the full host in $1 (say Doomflame!doom@doomflame) matches the part host in $2 (say *!*@*doom*), I developed some code, but there is a problem. say $1 was Doomflame!doom@doomflame.is.cool, and in $2 was *!*@doof.is.cool, they would match because of the .is. Here is my current code:
Code:
alias matchaddr {
  if ($gettok($1,1,33) isin $gettok($2,1,33)) { return $true }
  if ($gettok($gettok($1,2,33),1,64) isin $gettok($gettok($2,2,33),1,64)) { return $true }
  var %done 1
  while (%done <= $numtok($gettok($1,2,64),46)) {
    if ($gettok($gettok($1,2,64),%done,46) isin $gettok($2,2,64)) { return $true }
    inc %done
  }
  return $false
}


Anyone have a way to do this without the bug? If you don't understand what i want:

say you have a nicknames full host, and you are trying to check if it is on the banlist (why it would be there i do not know), the banlist doesn't contain any full parts, just bits of text with wildcards. How would i check this with a script?

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
/help iswm

alias matchaddr {
if ( $2 iswm $1 ) return $true
else return $false
}



Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Jun 2003
Posts: 10
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2003
Posts: 10
wow! thanks smile


Link Copied to Clipboard