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.

AutoOp if not +d on bot

Old posts that have not been replied to for several years.
Locked
p
p2hicy

AutoOp if not +d on bot

Post by p2hicy »

Hi peeps,

I want to give op to every user which joins my channel #p2hicy, but not to users who have +d on the bot. I used this code to do that:

Code: Select all

bind join - * p2hicy:op
proc p2hicy:op { nick host handle chan text } {
if {$chan != "#p2hicy"} {return 0}
if {![matchchanattr $nick d $chan]} {
pushmode $chan +o $nick
}
}
But it doesn't work. Any ideas ? :cry:.

Thanks,
-p2hicy.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

How doesn't it work?

Do you mean it still ops +d users?

Do it op anyone?

I suspect it's your matcattr login

Code: Select all

if {![matchchanattr $nick d $chan]} {
Change the "d" to "d|d".

This means channel or global +d.

"|d" mean channel, "d" means global.
p
p2hicy

Post by p2hicy »

Hi,

I changed the code to the follow as you said:

Code: Select all

bind join - * p2hicy:op
proc p2hicy:op { nick host handle chan text } {
if {$chan != "#p2hicy"} {return 0}
if {![matchchanattr $nick d|d $chan]} {
pushmode $chan +o $nick
}
}
but it still doesn't work, it ops noone. :cry:

-p2hicy.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

p2hicy wrote:Hi,

I changed the code to the follow as you said:

Code: Select all

bind join - * p2hicy:op
proc p2hicy:op { nick host handle chan text } {
if {$chan != "#p2hicy"} {return 0}
if {![matchchanattr $nick d|d $chan]} {
pushmode $chan +o $nick
}
}
but it still doesn't work, it ops noone. :cry:

-p2hicy.
you'll want to use $handle for your matchattr, not $nick ...
p
p2hicy

Post by p2hicy »

Thanks, it works :).

-p2hicy.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

i recommend...

Post by De Kus »

adding triggers for this:
![matchattr $handle "k|k" $channel] } && ![matchattr $handle "q|q" $channel] && ![matchban $nick!$uhost $channel]
it prevents users beeing banned (by the bot) or devoiced also from getting opped :).

i have various expiriens with script freeop. i changed my policy to 60sec autoop and added various +d triggers for kicking/deopping +m users and setting +i, +k oder +l very low. i also added a clone protection addionaly to the sentinal.tcl clone join flood protection.

Code: Select all

  if {[lsearch -exact [channel info $channel] +autoop] > -1} {
    set userhost "*!*[string range $uhost [string first @ $uhost] e]"
    set clonenb 0
    foreach user [chanlist $channel] {
      set clonehost [getchanhost $user $channel]
      set cloneuserhost "*!*[string range $clonehost [string first @ $clonehost] e]"
      set userhandle [nick2hand $user]
      if {[string match [strlwr $userhost] [strlwr "$user![getchanhost $user $channel]"]] && ($userhost == $cloneuserhost) && !([matchattr $userhandle f|f $channel] || [matchattr $userhandle o|o $channel])} {
        incr clonenb
      }
    }
    if { $clonenb < 3 } {
      utimer 60 [list idleopping $nick $channel]
      return 1
    } else {
      incr clonenb -1 
      putserv "NOTICE $nick :Böser $clonenb. Clone Du!!!"
      return 2
    }
  }
feel free to copy the clonecounter for other usage, its a rewritten script Thor.
note: it counts only non-op and non-friend clones (usefull if some clones are bouncers and known).
Last edited by De Kus on Fri Jan 24, 2003 4:43 pm, edited 1 time in total.
p
p2hicy

Post by p2hicy »

Ok, thanks. :P

-p2hicy.
Locked