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.

Bugs on tcl

Help for those learning Tcl or writing their own scripts.
Post Reply
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

Bugs on tcl

Post by F|irT »

Code: Select all

set list_of_chans "#chan1 #chan2"
global botnick username

# interval in minutes between checks.
set check_interval  5  

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

# 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;nick3;"

set exclude_nicks [string tolower $exclude_nicks]

proc inactive_checker { chan } {
	global exclude_nicks op_allowed_time  vo_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 {[isvoice $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) &&([getchanidle $user $chan] >= $vo_allowed_time)} {
 				putserv "mode $chan -vk $user Idle.Devoice"
 			} 
 			if {[isop $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) && ([getchanidle $user $chan] >= $op_allowed_time)} {
 					putserv "mode $chan -ok $user Idle.Op"
 			}
		} 
	}
}

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
i found this tcl but this is not proper working .. i got this result when i apply on bot.. [07:49] * NoNSt0p sets mode: -ok NoNSt0p Idle.Op . but deop him/self but not other's . can any one corret me for this

Code: Select all

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

# nicks to be exempted from devoice
set exclude_nicks "nick1;nick2;nick3;"
if it can be like this so will be thankfull.

F|irT
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

let me know...

Code: Select all

set list_of_chans "#chan1 #chan2"

# interval in minutes between checks.
set check_interval  5  

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

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


# nicks to be exempted from Deop
set op_exclude_nicks "nick1,nick2,nick3"

# nicks to be exempted from devoice
set vo_exclude_nicks "nick1,nick2,nick3"


set op_exclude_nicks [string tolower $op_exclude_nicks]
set vo_exclude_nicks [string tolower $vo_exclude_nicks]


proc inactive_checker { chan } {
  global op_exclude_nicks vo_exclude_nicks op_allowed_time vo_allowed_time
  if {![botisop $chan]} { return 0 } 
  foreach nk [chanlist $chan] { 
    set nk [string tolower $nk]

    if {[isbotnick $nk] || [onchansplit $nk $chan]} {  continue  }
    if {[matchattr [nick2hand $nk $chan] f]} {  continue  }

    if {[isop $nk $chan] && ![string match "*,$nk,*" ",$op_exclude_nicks,"]} {
      if {[getchanidle $nk $chan] >= $op_allowed_time} {
        putserv "mode $chan -ok $nk Idle.Op"
      }
    }
    if {[isvoice $nk $chan] && ![string match "*,$nk,*" ",$vo_exclude_nicks,"]} {
      if {[getchanidle $nk $chan] >= $vo_allowed_time} {
        putserv "mode $chan -vk $nk Idle.Devoice"
      }
    }
  }
}

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

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

No Bugs, No Error,

Post by F|irT »

I test This tcl .. result is perfect... No Bugs, No Error,
running on DALnet network ..

Thank you SpiKe^^ to making it rite..
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

Post by F|irT »

Code: Select all

set list_of_chans "#sukoon" 

# interval in minutes between checks. 
set check_interval  5  

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

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


# nicks to be exempted from Deop 
set op_exclude_nicks "nick1,nick2,nick3" 

# nicks to be exempted from devoice 
set vo_exclude_nicks "nick1,nick2,nick3" 


set op_exclude_nicks [string tolower $op_exclude_nicks] 
set vo_exclude_nicks [string tolower $vo_exclude_nicks] 


proc inactive_checker { chan } { 
  global op_exclude_nicks vo_exclude_nicks op_allowed_time vo_allowed_time 
  if {![botisop $chan]} { return 0 } 
  foreach nk [chanlist $chan] { 
    set nk [string tolower $nk] 

    if {[isbotnick $nk] || [onchansplit $nk $chan]} {  continue  } 
    if {[matchattr [nick2hand $nk $chan] f]} {  continue  } 

    if {[isop $nk $chan] && ![string match "*,$nk,*" ",$op_exclude_nicks,"]} { 
      if {[getchanidle $nk $chan] >= $op_allowed_time} { 
        putserv "mode $chan -ok $nk Idle.Op" 
      } 
    } 
    if {[isvoice $nk $chan] && ![string match "*,$nk,*" ",$vo_exclude_nicks,"]} { 
      if {[getchanidle $nk $chan] >= $vo_allowed_time} { 
        putserv "mode $chan -vk $nk Idle.Devoice" 
      } 
    } 
  } 
} 

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
i check this tcl it was working fine in starting but now it has started problem like .. devoice deop on idel time not working... here is the some result of.
<(MaSt3r> [12:56:00] Tcl error in script for 'timer22475':
<(MaSt3r> [12:56:00] illegal channel: #chan2
eXtreme-op has been idle 1hr 42mins 48secs, signed on Tue Jun 13 21:52:24 2017
MaSt3r sets mode: -vk eXtreme-op Idle.Devoice
[18:01] <F|irT> bot just devoice him after i rehsh the bot
[09:06] * MaSt3r sets mode: -ok DaD Idle.Op
DaD has been idle 5mins, signed on Sat Jul 22 14:04:48 2017
[09:06] * MaSt3r sets mode: -ok ZarNaH Idle.devoice
[09:15] ZarNaH has been idle 12mins 31secs, signed on Fri Jul 28 01:03:10 2017
C
Colins05
Voice
Posts: 1
Joined: Sat Aug 05, 2017 11:14 am

Re: Bugs on tcl

Post by Colins05 »

Merci beaucoup, cette code est vraiment utile
Post Reply