Why not just use,
Code:
on !*:Join:%%%: {
  if ($nick != $me) msg $chan Welcome $nick to $chan + !
}


To the original poster, if you want an auto greet.

The following code allows users to customize their own greeting message.

Code:
on 1:Text:!greet*:#: {
  if (!$2) { 
    .notice $nick No message set.
    writeini -n greet.ini Greetings $nick $+ .
    halt 
  }
  else { 
    writeini -n greet.ini Greet $nick $2- 
    halt 
  }
}

on !*:JOIN:#: {
  if ($readini(greet.ini,Greet,$nick)) { 
    msg $chan $readini(greet.ini,Greet,$nick) 
    halt 
  }
}