mIRC Homepage
Posted By: glenfield722 Making a script to ban a nick - 07/10/04 10:58 PM
Please could you tell me if there is some method in which a nick can be banned on entrance to a chat room. I do not know anything about scripting but would apprreciate any help you could give me on this matter

Thank you
Posted By: Zyzzyx26 Re: Making a script to ban a nick - 08/10/04 01:14 AM
You can use the ON Join event for that matter.

ON [color:red]!*:Join:#channel: if (Nick_banned == $nick) { ban -k $chan $nick Banned nick }[/color]

This will check if the nickname that just joined matches the banned nick. If it does, it will kick and ban it. Change the orange part for the nick you wish to ban. The red ! means that the script will *not* respond if YOU are the one joining. You must change the #channel for the channel name(s) you want the script to act upon (if it's more than 1, separate them with a comma [,]).

If you would like to ban the person for a period of time, change ban -k $chan $nick Banned nick for ban -kuN $chan $nick Banned nick - where N is the time you want the ban to last in seconds. Note that "Banned nick" is the kick message and you can chage that for the message you wish.

I hope this can help smile
Zyzzyx.

Edit: for more info about it, type /help on join while in mIRC.

Edit2: the -k part means that the script will also kick the person. If you don't want that, remove the k. Note that, if you are using the timed ban (-uN), you still need the - sign.
Posted By: Iori Re: Making a script to ban a nick - 08/10/04 04:07 AM
  • ON @*:Join: #channel : if ( Nick_banned[ == $nick) { ban -k $chan $nick Banned nick }

Better to use @ than ! as it will only trigger if you are opped on that channel. This way also precludes your own joins and won't cause errors by trying to kick when you're not opped. laugh
Posted By: Zyzzyx26 Re: Making a script to ban a nick - 08/10/04 02:44 PM
Agreed smile Forgot about the @ :P
© mIRC Discussion Forums