This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Protected nick

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Protected nick

Post by fls »

Does anyone got an idea there is any script for Nick protected ?

Example :-

* ABC Join #
*Bot kick ABC out of the # ( ABC nick is an register nick OP in this channel . Pls /nick <nick> to change )


Question,
Can i have More nick to be added for this protection?
Will the bot kick on real nick owner ??


Regards
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Do you want this to go with on whats in the bots userfile? like use there handle as there nickname. And if they use that handle as the nickname and there hostmask dosen't match, It bans them? That sort of thing. I have seen a script that dose something like this, thou so far i've been unable to find it.
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

Well, just wanna to get those +o +v +f nick to be protected and not to be clone by others.

Example : One of the OP nick is @moon

and there is a new user enter with the nick moon_456


Can there be a script to scan for those onjoin and /nick change into a protected nick as above with a warn and will kb !*moon_456*@* within a period of time which user refuse to change.

*moon_456 enter #
<bot>Hey moon_456 , your nick is smiliar to an recognise OP in this channel. If u are the owner of the nick Pls identify through the nickserv or /nick <newnick> to change or i got to remove you.

**<bot>Kick moon_456 has been kick out from the channel ( You have been warnned. Pls /nick <newnick> and rejoin )
*** <bot> set ban !*moon_456*@*


regard
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Thanks. do you have some way of checking that the nickname is registered or not? like a raw numeric from the irc server in the /whois out put. Other wise its probably going to kick/ban them unless they change there nickname or leave the channel. :|
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

Maybe a +f +o flag to be excuse ? a identify through nickserv will auto get a +o +v +f in the bot userlist

Regard
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Not really tested this, so you'll have to let me know how it gose when ya use it.

Code: Select all

##
# chkopc.tcl
##

# Number of seconds before the bot will kick and ban the nickname that matches an ops?
set chkopc_time "120"

# Warning message to post to the nickname in the channel, that matches an ops nickname?
set chkopc_warnmsg ""

# Same as above. Only this will be used as the kick reason.
set chkopc_kickmsg ""

#Note: Please remenber to escape 'special chars' in the warnings and kick messages.

proc join:chkopc {nick host handle channel} {
global botnick chkopc_warnmsg chkopc_kickmsg chkopc_time
 if {$nick == $botnick} {return}
  if {[validuser [nick2hand $nick]] && [matchattr [nick2hand $nick] +fov|+fov $channel]} {return}
   if {![validuser [nick2hand $nick]] || ![matchattr [nick2hand $nick] +fov|+fov $channel]} {
    foreach target [chanlist $channel] {
     if {[validuser [nick2hand $target]] && [matchattr [nick2hand $target] +fov|+fov $channel] && [onchan $target $channel]} {
      if {[string match -nocase "*$target*" "$nick"]} {
       puthelp "PRIVMSG $channel :$nick, $chkopc_warnmsg"
        utimer $chkopc_time "putserv {KICK $channel $nick $chkopc_kickmsg}"
         utimer $chkopc_time "putserv {MODE $channel +b $nick!*@*}"
          return
      }
     }
    }; return
   }
}

proc nick:chkopc {nick host handle channel newnick} {
global botnick chkopc_warnmsg chkopc_kickmsg chkopc_time
 if {$nick == $botnick} {return}
  if {[validuser [nick2hand $nick]] && [matchattr [nick2hand $nick] +fov|+fov $channel]} {return}
   if {![validuser [nick2hand $nick]] || ![matchattr [nick2hand $nick] +fov|+fov $channel]} {
    foreach target [chanlist $channel] {
     if {[validuser [nick2hand $target]] && [matchattr [nick2hand $target] +fov|+fov $channel] && [onchan $target $channel]} {
      if {[string match -nocase "*$target*" "$nick"] && [string match -nocase "*$target*" "$newnick"]} {
       putquick "KICK $channel $newnick $chkopc_kickmsg"
        putquick "MODE $channel +bb $newnick!*@* $nick!*@*"
         foreach ut [utimers] {
          if {[string match "**$nick**" [join $ut]]} {
           killutimer [lrange $ut end end]
          }
         }; return
      }
       if {[string match -nocase "*$target*" "$newnick"]} {
        puthelp "PRIVMSG $channel :$newnick, $chkopc_warnmsg"
         utimer $chkopc_time "putserv {KICK $channel $newnick $chkopc_kickmsg}"
          utimer $chkopc_time "putserv {MODE $channel +b $newnick!*@*}"
           return
       }
        if {[string match -nocase "*$target*" "$nick"]} {
         foreach ut [utimers] {
          if {[string match "**$nick**" [join $ut]]} {
           killutimer [lrange $ut end end]
          }
         }; return
        }
     }
    }; return
   }
}

proc part:chkopc {nick host handle channel {msg ""}} {
global botnick
 if {$nick == $botnick} {return}
  if {[validuser [nick2hand $nick]] && [matchattr [nick2hand $nick] +fov|+fov $channel]} {return}
   if {![validuser $handle] || ![matchattr $handle +fov|fov $channel]} {
    foreach target [chanlist $channel] {
     if {[validuser [nick2hand $target]] && [matchattr [nick2hand $target] +fov|+fov $channel] && [onchan $target $channel]} {
      if {[string match -nocase "*$target*" "$nick"]} {
       foreach ut [utimers] {
        if {[string match "**$nick**" [join $ut]]} {
         killutimer [lrange $ut end end]
        }
       }
      }
     }
    }; return
   }
}

bind join - "* *" join:chkopc
bind nick - "* *" nick:chkopc
bind part - "* *" part:chkopc

putlog "loaded chkopc.tcl --"
return
Should hopefully do the trick. Dont worrie about it warning then kicking and banning the nickname. It will only ban them after the set time if they dont change there nickname or part the channel.
[update #1] Added checks for and settings for netsplits.
[update #2] Fixed mising flag check on join proc.
[update #3] Done some testing. fixed alot of errors. removed some code.
Last edited by TCL_no_TK on Sat Dec 01, 2007 4:56 am, edited 2 times in total.
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

I m sorry. I have loaded the script and restart the bot. It seen nothing happen while i get an OP nick to enter the channel. Even tat goes for a /nick OPnick change.

Everything seen to be loaded
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Check that they aren't recognized as a bot user and have the +fov flag globally or on the channel. Updated it just now to fix a missing flag check on the join proc. sorry about that, didn't see it when i was doing it.
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

reloaded , it seen nothing happen ..hmm

btw , wat ya mean by Check that they aren't recognized as a bot user ?


Regard
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

fls wrote:btw , wat ya mean by Check that they aren't recognized as a bot user ?
You're joking?

If they're in the bots user list they're ignored. :roll:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

its all in the bot userlist for those .adduser

getting in with a diff nick/ident and in using the OP nick and there isnt any response for the bot. anything i in missing ?

Regard,
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

They would need a differant hostmask (*!ident@*.host) from the one in the bots userfile, the user record for the nickname (aka. the op nickname). The only way it would do anything to someone that has been added to the bot is if they didn't have the flags +f +o or +v global or on the channel. They would just keep getting warned and ban after the set time. If the script didn't exempt the flags (+f +o or +v). Check the .channel <#name> output from DCC/Chat on the bots partyline it should show you all the users and there flags on the given channel <#name>. P.S want me to remove the global flag exempt incase you have some kinda of login or id system that gives them the flags for that channel, while they still have there global flag or flag(s)?
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

It seen there isnt any happen when i get someone to try on it with diff ident , hostmask.

any clue ?

Regard
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

I'll add it one of ma bots and do some testing on it then. It shouldn't tak longer than a day or two. Sorry to make ya wait.

Edit: I've rushed it and done some tested fixed alot of things. And it should work fine now, the code could probably do with alot of improving. And i've also removed the split code and stuff, since i wasn't able to test it.
Should work now, if ya do have any problems with it. Please make an other post and i'll look at it again. Be sure to let me know how it gose, cos am started to like this script :D
f
fls
Voice
Posts: 35
Joined: Wed Oct 17, 2007 10:55 pm

Post by fls »

First , my apologise for the trouble tat caused your inconvenience. Tks u

Well, It seen working fine. But, there is some error listed

It protect only for the bot nick itself. And i change nick to others +o +n +v nick the bot did nothing.

Regard,
Post Reply