mIRC Home    About    Download    Register    News    Help

Print Thread
Kick/ban based on channel #243710 15/12/13 11:22 PM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
I'm sure there is, and sorry if this has been asked before or covered (although I could not seem to find anything that fit what I'm seeking to do either here or anywhere) but is there a way to set up a script that would kick and/or ban a user when they join your channel based on another room they happen to have joined?

Thanks.

Re: Kick/ban based on channel [Re: LCX] #243735 18/12/13 02:24 AM
Joined: Mar 2004
Posts: 526
HorseC Offline
Fjord artisan
Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
it is possible.
you would need to have a variable or token list of 'bad channels' and then when a user joins your channel, you would ask services on the net for extended who is information about the nickname, and compare the information back, against the list of bad channels. check the mIRC scripting sites, many scripts are available that do this.


Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Re: Kick/ban based on channel [Re: LCX] #243803 28/12/13 07:27 PM
Joined: Dec 2013
Posts: 5
Z
zaza Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
Z
Joined: Dec 2013
Posts: 5
on *:join:#yourchannel:{
whois $nick
}
raw 319:*#badchannel *:{
ban #yourchannel $2
kick #yourchannel $2 reason
}

Re: Kick/ban based on channel [Re: zaza] #244237 07/02/14 03:17 PM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
zaza, thank you for the script assist.

Re: Kick/ban based on channel [Re: LCX] #244240 07/02/14 07:16 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Just to add to this.....

I made this script for someone else and it could be of some use for you, At the moment zaza's script checks the user on joining your channel and then that's it. So if the user joins your channel, the script checks the user and bans them if they are in a bad channel and will leave them alone if there not.

This means the user can join your channel 1st, then join the bad channel and the script will not know as it only checks once on joining. The below code will check the user on joining your channel and then will recheck every 30 minutes and will ban the user for 15 minutes if found in a bad channel. (times can be changed)

Change the YOURCHANNEL to your channel name and the *BADCHANNEL* to the name of the bad channel, make sure the * stays on the front and end of the name.

Code:


on *:join:#: {
  if ($chan == #YOURCHANNEL) { .timer $+ $nick 0 1800 .whois $nick | .whois $nick } 

}
on *:part:#: {
  if ($chan == #YOURCHANNEL) { .timer $+ $nick off }

}
on *:quit: { 
  { .timer $+ $nick off }

}
raw 319:*: {
  if *BADCHANNEL* iswm $1- { .ban -ku900 #YOURCHANNEL $2 2 Banned for 15 minutes for being in a bad channel | timer $+ $2 off } 



If you want to add more than one bad channel just copy this section and place it at the very end of the script and change the *BADCHANNEL*

Code:

 if *BADCHANNEL* iswm $1- { .ban -ku900 #YOURCHANNEL $2 2 Banned for 15 minutes for being in a bad channel | timer $+ $2 off }



Hope this helps laugh


Regards

JayStew
Re: Kick/ban based on channel [Re: jaystew] #244260 09/02/14 02:34 PM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
Thanks jaystew, I'll give yours a try since zaza's script since it seems more direct and what I want overall, and since it seems I screwed up putting it in cause it didn't work for me.

Re: Kick/ban based on channel [Re: LCX] #244261 09/02/14 04:40 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
smile Cool, Hope it works ok for you


Regards

JayStew
Re: Kick/ban based on channel [Re: jaystew] #244263 09/02/14 11:06 PM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
Ok, I've given it a shot. Question regarding the whole BADCHANNEL part. For example if I wanted to ban those who happened to be in a channel called #help, would I change BADCHANNEL to *help* or *#help*?

Thanks.

Re: Kick/ban based on channel [Re: LCX] #244264 10/02/14 04:12 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You should use the # sign.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Kick/ban based on channel [Re: sparta] #244323 15/02/14 05:04 PM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
Odd, I have it without the # sign and it works fine.

Re: Kick/ban based on channel [Re: LCX] #244325 15/02/14 10:09 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Hey

Sorry for the delay....... True it is odd, As i had it without the # infront of the room name, but i have tested it and it works with and without it.

It maybe safer to use it with #roomname im not sure, maybe someone could explain this to us both why this has occurred, but i have used a similar script for a while and it doesn't have the # in front of it and doesn't seem to cause no problems.

Any suggestions / advise would be appreciated.

smile


Regards

JayStew
Re: Kick/ban based on channel [Re: jaystew] #244348 18/02/14 05:40 AM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
Don't know if adding this question here is better or if I should start a new topic, but would a script like this or similar work on specific nicknames or words in nicknames like Guest?

Re: Kick/ban based on channel [Re: LCX] #244351 18/02/14 06:05 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Hey

This is not fully my code, I got the on nick part from a tutorial page as I couldn't work it out.

Load into remotes, if a user joins a room with a guest nick then it will kick and ban them for 15 minutes. If they join your channel then do /nick guest it will kick and ban for 15 minutes (the times can be changed and can make it so it kicks only, but would be advise to ban for a short period weather its only 2 minutes etc just to stop any flood joins happening)

Code:
on @*:join:#: {
  if (Guest* iswm $nick) {
    .ban -ku900 # $nick 2 No Guest nicks allowed, /nick NewNickname
  }
}
on *:nick: {
  if (Guest* iswm $newnick) { 
    VAR %i = 0
    WHILE (%i < $comchan($newnick,0)) { 
      INC %i 
      IF ($me isop $comchan($newnick,%i)) {
        .ban -ku900 $comchan($newnick,%i) $newnick 2 Banned for 15 minutes, Guest nicks are not allowed, /nick NewNickname to change your name. 
      }
    }
  }
}



If you want to add more names to the list say for example anyone with word happy , moody or sexy in the name do the following

Code:

if ((happy* iswm $newnick) || (moody* iswm $newnick) || (sexy* iswm $newnick)) {




Regards

JayStew
Re: Kick/ban based on channel [Re: jaystew] #244366 20/02/14 03:49 AM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
I'll give that one a try. Thanks again for the assist.

Re: Kick/ban based on channel [Re: LCX] #244422 25/02/14 05:43 PM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
Sorry for the double post but the anti-guest script works. Was wondering, would that guest script work with tweaks to aim at specific names to do other things, like grant voice to certain peoples (since I can't figure out how to get chanserv to do that for me...)?

Re: Kick/ban based on channel [Re: LCX] #244423 25/02/14 07:00 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Hello

Yes something like this would do it - Just change my nickname, your nickname and Nick to the nicknames you want to auto voice on join.

User who is giving voice needs to be opped.

Code:
 

on @*:join:#: {
  if ($nick == JayStew) || ($nick == LCX) || ($nick == Nick) {
    .mode $chan +v $nick  }
}


Just add another
Code:
 || ($nick == NICKNAME) 
to the end of the line (before the {

Also if a total stranger enters the room with one of the nicks above they would be voiced even if it isn't that person, You could also use something to voice by the users host rather than nick maybe? Depends what your prefer


Regards

JayStew
Re: Kick/ban based on channel [Re: jaystew] #244425 25/02/14 08:05 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
To add to this here's another way - If you are placing it in a bots mIRC use version 1 if you are placing it in your own mIRC use version 2


Version 1 - To add or delete user from auto voice list you must be a channel op.


VERSION 1

Code:

on *:TEXT:*:#:{
  if ($1 == !autovoice) && ($nick isop $chan) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !autovoice <nick> | halt }
    if ($2 !== $null) {
      if ($readini(autovoice.ini, $2, AutoVoice) !== $null) { .notice $nick User already exists in the AutoVoice list | halt }
      if ($comchan($2,0) == 0) { .notice $nick To add a user you must bring them to a channel were I am too. | halt }
      else { 
        writeini -n autovoice.ini $2 AutoVoice 100
        writeini -n autovoice.ini $2 Hostmask $mask($address($2,2),2)
        .notice $nick Added $2 to my AutoVoice list.
      }
    }
  }

  if ($1 == !DelAutoVoice) && ($nick isop $chan)  {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !DelAutoVoice <nick>. | halt }
    if ($2 !== $null) {
      if ($readini(autovoice.ini, $2, AutoVoice) == $null) { .notice $nick $2 doesn't appear to be in my autovoice list. | halt }
      else {
        .remini autovoice.ini $2
        .notice $nick AutoVoice for $2 has been removed.
      }
    }
  }
}
on *:JOIN:#:{  
if ($readini(autovoice.ini, $nick, AutoVoice) == 100){  .mode $chan +v $nick } 
}



Commands :

!AutoVoice nickname -adds user to autovoice list
!DelAutoVoice nickname - Deletes user from autovoice nickname



VERSION 2

Code:

alias autovoice {
  if ($1 == $null) { .echo -a Command incomplete. Syntax: /autovoice <nick> | halt }
  if ($1 !== $null) {
    if ($readini(autovoice.ini, $1, AutoVoice) !== $null) { .echo -a User already exists in the AutoVoice list | halt }
    if ($comchan($1,0) == 0) { .echo -a To add a user you must bring them to a channel were I am too. | halt }
    else { 
      writeini -n autovoice.ini $1 AutoVoice 100
      writeini -n autovoice.ini $1 Hostmask $mask($address($1,2),2)
      .echo -a Added $1 to my AutoVoice list.
    }
  }
}

alias DelAutoVoice {
  if ($1 == $null) { .echo -a Command incomplete. Syntax: /DelAutoVoice <nick>. | halt }
  if ($1 !== $null) {
    if ($readini(autovoice.ini, $1, AutoVoice) == $null) { echo -a $1 doesn't appear to be in my autovoice list. | halt }
    else {
      .remini autovoice.ini $1
      .echo -a AutoVoice for $1 has been removed.
    }
  }
}

on *:JOIN:#:{  
if ($readini(autovoice.ini, $nick, AutoVoice) == 100){  .mode $chan +v $nick } 
}




Commands:

/autovoice nickname - Adds nickname to auto voice list
/DelAutoVoice nickname - Deletes nickname from auto voice list


Regards

JayStew
Re: Kick/ban based on channel [Re: jaystew] #244429 26/02/14 05:03 AM
Joined: Mar 2013
Posts: 17
L
LCX Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Mar 2013
Posts: 17
Thank you, thank you again for all your help.
This should cover everything I hopefully need in regards to all that. smile