That is because on me:*:JOIN:#: or on *:JOIN:#: if ($nick == $me) (which are essentially the same thing, the differences are described below) react to the original JOIN command from the server. When you receive the notification that you have joined the channel, you have not yet received the topic, who set the topic and when it was set, the /names list (which is where you find out who all is on the channel, who's opped/voiced), the end of names list, the modes for the channel and when the channel was created.

/JOIN #Channel (you typed this)
:MyNick!userid@host JOIN :#Channel
/MODE #Channel (sent by mIRC on your behalf)
:server 332 MyNick #Channel :This is the channel topic.
:server 333 MyNick #Channel Nick1 1044499804
:server 353 MyNick = #help :MyNick Nick30 Nick29 @Nick28 Nick27 Nick26 Nick25 Nick23 Nick22 Nick21 Nick20 Nick19 Nick18 +Nick17 Nick16 Nick15 Nick14 Nick13 Nick12 Nick11 Nick10 Nick9 Nick8 Nick7 Nick6 Nick5 Nick4 Nick3 Nick2 @Nick1
:server 366 MyNick #Channel :End of /NAMES list.
:server 324 MyNick #Channel +tnl 39
:server 329 MyNick #Channel 1042103590

Your on me:*:JOIN:#: might also issue a /who $chan to fill the IAL (Internal Address List) and a /mode $chan b to fill the IBL (Internal Ban LIst) for that channel. If so, then you might want to wait for the raw 352's to finish with a raw 315 (End of /WHO list.), as well as waiting for the raw 367's to finish with a raw 368 (End of Channel Ban List).

You might also want to check $7 in each raw 352 for * (opered client) and G (away client) to total those for your stats, as well. You could also total how many clients are on each server by checking $5 and adding to each server's total for that channel for your stats.

Once you have received all of this information, then you can do your channel stats - but as you can see, you cannot do any channel stats until you have gotten it all (or at least all that you desire for your stats display).

on me:*:JOIN:#: only gets triggered if you are the one joining the channel.

on *:JOIN:#: if ($nick == $me) gets triggered every time someone joins the channel and then checks to see if it was you.

on !*:JOIN:#: only gets triggered when someone else joins the channel you're in.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C