$isban()

By Aaron on Jul 03, 2007

$isban(nick/address)

*i posted this on swiftirc forums also if you were wondering - thought id share it here also

note that this is not "if (- isban #) { }"

alias isban { 
  var %tt = 1 
  while ($ibl($chan,%tt)) { 
    if ($1 == $v1) { 
      return $true 
      halt 
    } 
    else inc %tt 
  } 
  return $false 
}

Comments

Sign in to comment.
Lindrian   -  Jul 05, 2007

ah lol. Stupid to rip such a usless code.

 Respond  
kerstt   -  Jul 05, 2007

no lol aaron is the ripper, cause b_u_n-s isnt aaron :o

 Respond  
Lindrian   -  Jul 05, 2007

Who are we talking about kerstt? Me?

 Respond  
kerstt   -  Jul 05, 2007

ripped, the one posting this on swiftirc was called b_u_n_s, not aaron lol

 Respond  
Lindrian   -  Jul 03, 2007

I would have done it this way:

alias isban { 
  var %x = 1, %y = $ibl($chan,0)
  while (%x <= %y) { 
    if ($wildtok($ibl($chan,%x),$+(*,$1,*),1,32)) {
      return $true
    } 
    inc %x
  } 
}

$wildtok() is to match if you typed $isban(test) or $isban(test!@)
Cause, $1 == $v1 will result in a exact match.

 Respond  
Aaron   -  Jul 03, 2007

You can also shorten this by:

alias isban { return $iif($1 isban #,$true,$false) }
but i was experimenting with loops

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.