mIRC Home    About    Download    Register    News    Help

Print Thread
#135116 07/11/05 09:16 PM
Joined: Jan 2005
Posts: 16
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Jan 2005
Posts: 16
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

#135117 07/11/05 10:06 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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. }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#135118 08/11/05 12:14 AM
Joined: Jun 2005
Posts: 127
H
Vogon poet
Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
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

Last edited by HAMM3R; 08/11/05 12:22 AM.
#135119 09/11/05 11:09 AM
Joined: Jun 2005
Posts: 127
H
Vogon poet
Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
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


-- HAMM3R (aka: alhammer)
http://www.HAMM3R.net

Link Copied to Clipboard