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.
Help for those learning Tcl or writing their own scripts.
opsb
Halfop
Posts: 41 Joined: Sat Sep 01, 2007 1:41 pm
Post
by opsb » Mon Feb 04, 2008 6:07 am
Code: Select all
### Anti-Idle v1.2
### by Progeny <progeny@azzurra.org>
### irc.azzurra.org - #EggHelp
# - Using -
# Type in partyline:
# .chanset #channel maxidle <time in minutes>
# If set 0 channel's check will be ignored.
# Punishing method (1 = Kick, 2 = Kick/Ban)
set pmethod 2
# Ban time in minutes.
set bantime 6
# Kick's reason
set aidlereason "Presli ste limit dopustenog idle vremena na kanalu #pomoc"
# Exception's flags
set flags f|f
# Kick op? (0 = Yes, 1 = No)
set kickop 1
# Kick halfop? (0 = Yes, 1 = No)
set kickhalfop 1
# Kick voice? (0 = Yes, 1 = No)
set kickvoice 1
# Check for idling users every minutes.
bind time - * aidle:checkidle
setudef int maxidle
proc aidle:checkidle { min hour day month year } {
global botnick flags kickop kickhalfop kickvoice
foreach chan [channels] {
if {![channel get $chan "maxidle"]} {continue}
foreach nick [chanlist $chan] {
if {$nick == $botnick} {continue}
if {([isop $nick $chan]) && ($kickop)} {continue}
if {([ishalfop $nick $chan]) && ($kickhalfop)} {continue}
if {([isvoice $nick $chan]) && ($kickvoice)} {continue}
if {[matchattr [nick2hand $nick] $flags] == 1} {continue}
if {[getchanidle $nick $chan] > [channel get $chan "maxidle"]} {
aidle:punish $chan $nick [channel get $chan "maxidle"]
}
}
}
}
proc aidle:punish { channel nick idletime } {
global pmethod aidlereason bantime
regsub -all "%idletime" $aidlereason $idletime aidlereason
switch $pmethod {
1 { putserv "KICK $channel $nick :$aidlereason" }
2 { newchanban $channel "*![getchanhost $nick]" "Anti-Idle" $aidlereason $bantime }
}
}
putlog "Anti-Idle v1.2 loaded"
I'm now using this script
I've edited it for these lines
Code: Select all
# Kick halfop? (0 = Yes, 1 = No)
set kickhalfop 1
and
Code: Select all
if {([ishalfop $nick $chan]) && ($kickhalfop)} {continue}
Firstly, it worked.. but now.. script won't kick from channel, just ban and that's all
thnx
Maiki
Voice
Posts: 28 Joined: Sun May 20, 2007 4:58 pm
Post
by Maiki » Mon Feb 04, 2008 7:49 am
Try this proc=
Code: Select all
proc aidle:checkidle { min hour day month year } {
global botnick flags kickop kickhalfop kickvoice
foreach chan [channels] {
if {![channel get $chan "maxidle"]} {continue}
foreach nick [chanlist $chan] {
if {$nick == $botnick} {continue}
if {[isop $nick $chan] && $kickop == "1"} {continue}
if {[ishalfop $nick $chan] && $kickhalfop == "1"} {continue}
if {[isvoice $nick $chan] && $kickvoice == "1"} {continue}
if {[matchattr [nick2hand $nick] $flags] == "1"} {continue}
if {[getchanidle $nick $chan] > [channel get $chan "maxidle"]} { aidle:punish $chan $nick [channel get $chan "maxidle"] }
}
}
}
opsb
Halfop
Posts: 41 Joined: Sat Sep 01, 2007 1:41 pm
Post
by opsb » Wed Feb 06, 2008 2:29 am
Again same but just for some nicks..
Some nicks are kicked-banned, and other just banned, and that's all
iamdeath
Master
Posts: 323 Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:
Post
by iamdeath » Wed Feb 06, 2008 9:41 am
Code: Select all
proc aidle:checkidle { min hour day month year } {
foreach chan [channels] {
if {![channel get $chan "maxidle"]} {continue}
foreach nick [chanlist $chan] {
if {[getchanidle $nick $chan] > [channel get $chan "maxidle"]} {
aidle:punish $chan $nick [channel get $chan "maxidle"]
}
}
}
}
When the bot is required to kick/ban ops/voice/halfops then you don't need to put it in the script so make it less confusing. Try with this code I hope it should work fine
peace
death
|AmDeAtH @ Undernet
Death is only the *Beginning*...
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Wed Feb 06, 2008 12:43 pm
Could you tell me the setting for "strict-hosts", and also, did you notice any pattern with kicks/bans and wether the users ident is prefixed with ~, -, +, =, or ^.
I would argue that the source of this issue is not within aidle:checkidle, but rather aidle:punish since the eggdrop reacts on all, but behaves differently on different offenders.
Only banning would be consistent with eggdrop not properly detecting a matching internal ban - often caused by improper bans with "strict-host".
NML_375
opsb
Halfop
Posts: 41 Joined: Sat Sep 01, 2007 1:41 pm
Post
by opsb » Tue Feb 12, 2008 9:53 pm
Code: Select all
[02:50:05] * eggBot (eggbot@eggdrop.dedica.org) has joined #pomoc
[02:50:06] ChanServ set[s] mode[s]: +o eggBot
[02:51:24] eggBot set[s] mode[s]: -o+b Apollo *!Apollo@levat.dedica.org
[02:51:26] eggBot set[s] mode[s]: +b *!~br0nx@BB38BD7D.B92574B6.945CAD23.IP
[02:51:28] eggBot set[s] mode[s]: +b *!docs@docs.dedica.org
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Feb 13, 2008 9:47 am
Have you ever read "The Manual"?