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.

Flag except on idle-deop doesn't work.

Help for those learning Tcl or writing their own scripts.
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Flag except on idle-deop doesn't work.

Post by eXtremer »

Code: Select all

set list_of_chans "#chan1 #chan2"

global botnick nick

# interval in minutes between checks.
set check_interval  30

# allowed time in minutes for an op to be idle.
set op_allowed_time 30

# allowed time in minutes for a voiced user to be idle.
#set vo_allowed_time 10

# nicks to be exempted from Deop/devoice
set exclude_nicks "nick1;nick2;"

set exclude_nicks [string tolower $exclude_nicks]

proc inactive_checker { chan } {
        global exclude_nicks op_allowed_time  botnick
        if {![botisop $chan]} { return 0 }
        foreach user [chanlist $chan] {
        set user [string tolower $user]

        if {![string match "*$user;*" $exclude_nicks] && ![matchattr [nick2hand $user $chan] f]  } {
                        if {[isop $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) && ([getchanidle $user $ch
an] >= $op_allowed_time)} {
                                        putserv "mode $chan -ok $user Idle.Op.SaP-Control"
                        }
                }
        }
}

proc run_checking_timer { } {
        global list_of_chans check_interval

        foreach check_chan [split $list_of_chans] {
                inactive_checker $check_chan
        }
        timer $check_interval run_checking_timer
}

timer $check_interval run_checking_timer

putlog "\[LOADED\] Inactive op/voice control - by SaPrOuZy."
This script should except the users that have +f flag, but it doesn't, only the nick except works, but I need the flag except too..
Please help, thanks in advance.

if {![string match "*$user;*" $exclude_nicks] && ![matchattr [nick2hand $user $chan] f] }
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

try changing

Code: Select all

if {![string match "*$user;*" $exclude_nicks] && ![matchattr [nick2hand $user $chan] f]  }
to

Code: Select all

if {![string match "*$user;*" $exclude_nicks] || ![matchattr [nick2hand $user $chan] f]  }
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

DragnLord wrote:try changing

Code: Select all

if {![string match "*$user;*" $exclude_nicks] && ![matchattr [nick2hand $user $chan] f]  }
to

Code: Select all

if {![string match "*$user;*" $exclude_nicks] || ![matchattr [nick2hand $user $chan] f]  }
noop, it's not working.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

try this code.

Code: Select all

set list_of_chans "#chan1 #chan2"

global botnick nick

# interval in minutes between checks.
set check_interval  30

# allowed time in minutes for an op to be idle.
set op_allowed_time 30

# allowed time in minutes for a voiced user to be idle.
#set vo_allowed_time 10

# nicks to be exempted from Deop/devoice
set exclude_nicks "nick1;nick2;"

set exclude_nicks [string tolower $exclude_nicks]

proc inactive_checker { nick chan text } {
        global exclude_nicks op_allowed_time  botnick
        if {![botisop $chan]} { return 0 }
      set fnick [lindex $text 0]
		set userhand [nick2hand $fnick] 
        foreach user [chanlist $chan] {
        set user [string tolower $user]

        if {![string match "*$user;*" $exclude_nicks] && ![matchattr $userhand o|o $chan] || [matchattr $userhand f|f $chan]} {
                        if {[isop $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) && ([getchanidle $user $chan] >= $op_allowed_time)} {
                                        putserv "mode $chan -ok $user Idle.Op.SaP-Control"
                        }
                }
        }
}

proc run_checking_timer { } {
        global list_of_chans check_interval

        foreach check_chan [split $list_of_chans] {
                inactive_checker $check_chan
        }
        timer $check_interval run_checking_timer
}

timer $check_interval run_checking_timer

putlog "\[LOADED\] Inactive op/voice control - by SaPrOuZy." 
i don't tested this code, but u tellme :)
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

ok Nor7on, I'll try it.
Thanks ;)
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

[14:37] Tcl error in script for 'timer10907':
[14:37] wrong # args: should be "inactive_checker nick chan text"

?
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

so ? what's wrong in that code ?
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Code: Select all

set list_of_chans "#chan1 #chan2"

global botnick nick

# interval in minutes between checks.
set check_interval  30

# allowed time in minutes for an op to be idle.
set op_allowed_time 30

# allowed time in minutes for a voiced user to be idle.
#set vo_allowed_time 10

# nicks to be exempted from Deop/devoice
set exclude_nicks "nick1;nick2;"

set exclude_nicks [string tolower $exclude_nicks]

proc inactive_checker { chan } {
        global exclude_nicks op_allowed_time  botnick
        if {![botisop $chan]} { return 0 }
        foreach user [chanlist $chan] {
        set user [string tolower $user]
        set userhand [nick2hand $user]

        if {![string match "*$user;*" $exclude_nicks] && ![matchattr $userhand o|o $chan] || [matchattr $userhand f|f $chan]} {
                        if {[isop $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) && ([getchanidle $user $chan] >= $op_allowed_time)} {
                                        putserv "mode $chan -ok $user Idle.Op.SaP-Control"
                        }
                }
        }
}

proc run_checking_timer { } {
        global list_of_chans check_interval

        foreach check_chan [split $list_of_chans] {
                inactive_checker $check_chan
        }
        timer $check_interval run_checking_timer
}

timer $check_interval run_checking_timer

putlog "\[LOADED\] Inactive op/voice control - by SaPrOuZy." 
try.
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

No, again, it's not working, not the bot deops even the except nicks !
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

change

Code: Select all

if {![string match "*$user;*" $exclude_nicks] && ![matchattr $userhand o|o $chan] || [matchattr $userhand f|f $chan]} {
For

Code: Select all

if {![string match "*$user;*" $exclude_nicks] || [matchattr $userhand f|f $chan]} {
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

Noop, it's not working, smb recommend a good idle-deop script psl!
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

I know this script, I've tested it already, The bot si deopind itself :)

*** Bot sets mode: -oo Bot tester`
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Code: Select all

# Set this to a flag you want to be exempt from checks.
set IDLEOP(exempt) "E"
solution:
add ur bot to userlist and get flag +E.

try.
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

-Bot- Sorry, but I can't adduser myself.
Post Reply