mIRC Home    About    Download    Register    News    Help

Print Thread
#114563 15/03/05 04:45 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Oct 2004
Posts: 18
I need a script that would keep a certain nic out of my room..For instance, everytime he/she joins it would automatically kick/ban him..Preferably ban..ANy help is appreciated

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
On @*:Join:[color:red]#Channel[/color]: {
  if ($nick == [color:red]SomeNick[/color]) { ban -k $chan $nick 3 }
}


Change the parts in red to suit your needs.

Last edited by SladeKraven; 15/03/05 04:52 PM.
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
For a specific nickname:

on @*:join:#your-channel:{
if ($nick == nickname) {
ban -k # $nick 3 Kick Reason Here
}
}


However, if you want to detect him joining on his address rather than his nickname (which is generally harder to evade), you could use $address or, for just the part after the @, $site.

on @*:join:#your-channel:{
if ($site == this.guys.hostname) {
ban -k # $nick 3 Kick Reason Here
}
}


See these for a bit more info and help:

/help on join
/help if then else
/help $address
/help /ban


Regards,


Mentality/Chris
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Oct 2004
Posts: 18
So I could actually ban the address to keep him from joining on multiple names?

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Both examples would BAN the address. Only the second one would DETECT the address when he joins. And yes, using something like the second example means the nickname of the user is irrelevant.

Regards,


Mentality/Chris
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Oct 2004
Posts: 18
When you say host name...That would be something like [email]Boxbred@Boxbred[/email] or [email]Boxbred@*[/email] * Boxbred, or am I wrong all together?

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
The format of addresses on IRC is the following

nickname!user@hostname

So hostname is just the part after the @. It's more clearly displayed in a /whois of a user. This always changes if it's a dialup user each time they reconnect to the Internet, so a combination of wildcards may be needed to ban the user. Inevitably though you could end up banning perfectly innocent users from the same ISP. That's one of the reasons a ban evader can be a pain in the ass though and there's not much to be done about it smile Sometimes a hostname does not resolve and an IP address will be displayed instead. You can also obtain the IP through the /dns command (or obtain the hostname if the IP is displayed).

The 'user' part is aka the IdentD or UserID which can be changed almost as easily as a nickname, it's just "newbies" know how to do it less than more experienced users, plus it requires a reconnect.

Regards,


Mentality/Chris
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
even with broadband if have seen minute changes in the ip address so if u really want to keep them out blocking other users from the same isp may be unavoidable

Joined: Dec 2002
Posts: 14
N
Pikka bird
Offline
Pikka bird
N
Joined: Dec 2002
Posts: 14
Quote:
Code:
On @*:Join:[color:red]#Channel[/color]: {
  if ($nick == [color:red]SomeNick[/color]) { ban -k $chan $nick 3 }
}


Change the parts in red to suit your needs.


Instead of if ($nick == SomeNick)

You could make it apply to a list of nicknames with tokens, that way if anyone matching those nicks joined, you can kickban 'em!

Code:
if $findtok(these nicks are banned,$nick,32,1) { ban -k $chan $nick 3 }


Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You have the last 2 parameters mixed up in that $findtok(), but $istok() was made especially for this sort of thing.

Code:
on @!*:join:#:{
  if ($istok(nick1 nick2 nick3 etc,$nick,32)) {  }
}


New username: hixxy
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hi namnori you have the 32 and the 1 the wrong way round in the $findtok().

IMO I'd use $istok() to check if it is a token.

And also, how about calling the nicknames from an alias, just so the original poster don't get a little confused with token identifiers. smile

Code:
alias bnicks {
  return these nicks are to be banned on sight Donna{sleeping}
}

On @*:Join:[color:red]#Channel[/color]: {
  if ($istok($bnicks,$nick,1,32)) {
    ban -k $chan $nick 3
  }
}


Edit: Matt beat me to it. :tongue:


Link Copied to Clipboard