View Full Version : Script to ban a user for pming you in an empty channel.

9th September 2007, 4:26 PM
Scenario: a user joins an empty channel you are op in.

So the users in that channel are:

@You Idiot.

And then, he pms you!

Isn't that annoying?

So I wrote a script (added) to my current on open event to handle such a case when an idiot pms you. Previously, it just echo'd the user's host and common channels, but now, for the ban.

on *:open:?:*: {
var %x = 1, %y
while (%x <= $comchan($nick,0)) {
%y = %y $comchan($nick,%x)
if ($nick($comchan($nick,%x),0) == 2) && ($me isop $comchan($nick,%x)) && ($nick isreg $comchan($nick,%x)) && (m !isincs $chan($comchan($nick,%x)).mode) && ($left($1,1) != $chr(33)) {
/ban -u250 $comchan($nick,%x) $nick 2 | /kick $comchan($nick,%x) $nick Considering you have pm'd me while we are in this empty channel (just me an you), there was no need to p.m. me. Problem solved.
inc %x
if ($comchan($nick,1)) { /echo $nick $address($nick,1) %y }


-Only works when someone opens a pm window with you. So you can have a p.m. with someone and it will not ban them if they joined an empty channel you were op in and continued to pm you.

-Will not ban if there are 3 people or more in the channel...just you and him.

-Will not ban if the user is an op or voice, +h, etc.

-Will not ban if the channel is +m.

-Shows all the users common channels.

Let me know if you need to help to edit something.


9th September 2007, 6:03 PM
Stop evading your ban, you're not welcome here.

This is also not a 'Post all the scripts you have' discussion, it is to discuss issues with the chatroom(s) only.