Here's an example:
Code:
On @*:join:[color:blue]#teenworld[/color],[color:blue]#20+[/color]:{
  if $hget(whois,0).item < 3 {
    ;
    ; The hash table "whois" stores the nicks you are doing a WHOIS on.
    ;
    hadd -mu20 whois $nick #
    whois $nick
  }
}
 
raw *:*:{
  ;
  ; 310-320 is the range of WHOIS replies.
  ;
  if $numeric isnum 310-320 && $hget(whois,$2) {
    if $numeric == 320 {
      [color:green]echo -s Name: $2 - Age: $gettok($4,1,47) - Sex: $gettok($4,2,47)[/color]
    }
    if $numeric == 318 { 
      ; 
      ; 318 = End of WHOIS
      ;
      hdel whois $2
    }
    haltdef
  }
}

To know what a specific command does, type /help /command. See the gree line? This informal /echo can be replaced with anything else. For example -
Code:
    if $numeric == 320 {
      var %nick = $2
      var %chan = $hget(whois,$2)
      var %age = $gettok($4,1,47)
 
      if %chan == #teenworld && %age >= 20 {
        notice %nick Man, you're too old for %chan
      }
      elseif %chan == #20+ && %age < 20 {
        kick %chan %nick See you in #teenworld
      }
    }

I hope it wasn't too complicated...
To keep the current code structure, first paste in Word or Wordpad then copy to the mIRC editor.