On invite
From Scriptwiki
The on INVITE event triggers when a user invites you to a channel.
on <level>:INVITE:<#[,#]>:<commands>
Note that if you want to automatically join a channel when someone invites you, it's easier to turn on the Auto-Join option in the Options dialog.
Example
on *:Invite:#help.script: { join -i }
This example shows howto join #help.script if someone invites you to it. Note that join -i joins the channel to where you was last invited.