mIRC Homepage
Posted By: Angrycat Kicking unwelcome users - 07/11/05 09:16 PM
Howdy.

I am trying to create a script that does the following.

  • On Join checks the users status i.e msg NickServ Status $nick
  • If the users status is != 3 then it auto kicks them
  • If the users status is 3 but they do not appear in my friends list (var $friends for example) then it kicks them as well


This is just intended for a channel myself and some friends use to discuss provate matters and we dont want people jumping in on us.

I am aware that we can set channel modes to prevent people finding us, but for various reasons this is not an option.

Does anyone have any pointers on how to achieve this cleanly ?

Thanks a million !


Angrycat
Posted By: Lpfix5 Re: Kicking unwelcome users - 07/11/05 10:06 PM
probably 2 scripts is needed ... probably can be arranged a little better but you get the point

on *:JOIN:#channelhere:{
msg nickserv status $nick
if ($nick isin $friends) { halt }
else { kick $chan $nick Your not in my friends list }
}

on *:NOTICE:*:*:{
if ($3 != 3) { kick $active $3 Not authorized. }
}
Posted By: HAMM3R Re: Kicking unwelcome users - 08/11/05 12:14 AM
Are you sure you meant $friends? Do you have a friends alias that will return the names? I think you may have meant a var like %friends. Just a thought.

Edit: That script is not a good idea. The on notice event doesnt even check if the nickname was nickserv, meaning it would be triggered by any notice. I dont think that's what you want. Probably something more like:

Code:
on *:join:#chan: {
  if ($nick !isin %friends) {
    msg nickserv status $nick
    set %nss $nick $chan
  }
}
on *:notice:*Status*:?: {
  if ($nick == nickserv) && ($2 == $gettok(%nss,1,32)) && ($3 != 3) {
    kick $gettok(%nss,2,32) $gettok(%nss,1,32) Bye
   unset %nss
  }
}


Then if you havent already done so,

/set %friends friend1 friend2 friend3

Hope this helps
Posted By: HAMM3R Re: Kicking unwelcome users - 09/11/05 11:09 AM
I know it's late, but I just noticed something. If you're using the code from my last post, you may want to make the following modification to check wheather you are in op in the channel (thus you have the ability to kick users).

Change:
if ($nick == nickserv) && ($2 == $gettok(%nss,1,32)) && ($3 != 3) {

To:
if ($nick == nickserv) && ($2 == $gettok(%nss,1,32)) && ($3 != 3) && ($me isop $gettok(%nss,2,32) {

Hope this helps

smile
© mIRC Discussion Forums