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.

Op Limit

Old posts that have not been replied to for several years.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

The thing is the bot checks the channel list for ops. It does it in an alphabetical manner so if there is an extra op, it would be in the end of the channel lists, with alphabets near to the ending of the abc. And that person will be deoped.

It will be hard to deop the same target, because some times +o is used and some times +oooooo is used! Then we would individually have to check for each list index if +ooo, or a greater one is used. If they exist and not are "" then the bot can deop them. But then we would have to recheck the channel list, if it is still greater, then deop more people, other
wise halt.

I modified it a little bit. Try this code. If still it seems to deop wrong people then, I guess that's your badluck, heh. It will make sure only 8 people are opped on the channel, and the ones coming in the channel even if they are extra ops doesnt mean they will be specifically deoped, the bot can deop any op, to make the channel it under the op limit.

Code: Select all

set checkchans "#yourchannel" 
set maxops "8" 

bind mode - "*+o*" check:ops 

proc check:ops {nick uhost hand chan mode target} { 
 global botnick checkchans maxops 
  set totalops 0; set list [list] 
  if {($mode == "+o")} { 
  if {(([lsearch -exact [string tolower $checkchans] [string tolower $chan]] != -1) || ($checkchans == "*"))} { 
  foreach user [chanlist $chan] { 
    if {[isop $user $chan]} { 
     incr totalops; lappend list $user 
       } 
     } 
     if {($totalops > $maxops)} { 
      set deopnicks [lrange $list $maxops end] 
       if {([botisop $chan]) && ($deopnicks != "")} { 
        putserv "MODE $chan -oooooo [join $deopnicks]"
        putserv "PRIVMSG $chan :$deopnick O Limit de Operadores no Canal e $maxops "; return 0
        }
      } 
    } 
  } 
} 

putlog "OpLimit by awyeah - LOADED"
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Post by AbuAli »

:(
yeah i think am with badluck .. this tcl is ugly.. the bot deop the other users.. not who get the last op ... any way!! he make the channel with 8 ops :P its a step :D thx anyway
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

If you still want to deop, the last nick.

You can replace this code:

Code: Select all

  putserv "MODE $chan -oooooo [join $deopnicks]"
With this code:

Code: Select all

  putserv "MODE $chan -o $target"
But then I don't know how this script will react if there
are many +ooo modes triggered.

You can try it to test it out. If you specifically want to
deop the last person opped (if he is an extra op).


If you can't even replace it, use this then:

Code: Select all

set checkchans "#yourchannel" 
set maxops "8" 

bind mode - "*+o*" check:ops 

proc check:ops {nick uhost hand chan mode target} { 
 global botnick checkchans maxops; set totalops 0
  if {($mode == "+o")} { 
  if {(([lsearch -exact [string tolower $checkchans] [string tolower $chan]] != -1) || ($checkchans == "*"))} { 
  foreach user [chanlist $chan] { 
    if {[isop $user $chan]} { 
     incr totalops
       } 
     } 
     if {($totalops > $maxops)} { 
       if {([botisop $chan]) && ([onchan $target $chan])} { 
        putserv "MODE $chan -o $target" 
        putserv "PRIVMSG $chan :$target O Limit de Operadores no Canal e $maxops"
        return 0
        } 
      } 
    } 
  } 
} 

putlog "OpLimit by awyeah - LOADED"
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked