mIRC Home    About    Download    Register    News    Help

Print Thread
Script to keep someone out #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

Re: Script to keep someone out #114564 15/03/05 04:49 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
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.
Re: Script to keep someone out #114565 15/03/05 04:51 PM
Joined: Jun 2003
Posts: 5,024
M
Mentality Offline
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
Re: Script to keep someone out #114566 15/03/05 04:58 PM
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?

Re: Script to keep someone out #114567 15/03/05 05:10 PM
Joined: Jun 2003
Posts: 5,024
M
Mentality Offline
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
Re: Script to keep someone out #114568 15/03/05 05:24 PM
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?

Re: Script to keep someone out #114569 15/03/05 05:35 PM
Joined: Jun 2003
Posts: 5,024
M
Mentality Offline
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
Re: Script to keep someone out #114570 15/03/05 08:45 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
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

Re: Script to keep someone out #114571 17/03/05 02:16 PM
Joined: Dec 2002
Posts: 14
N
namnori Offline
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 }


Re: Script to keep someone out #114572 17/03/05 02:19 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
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
Re: Script to keep someone out #114573 17/03/05 02:30 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
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: