Système de bannissement d'utilisateur qui idle trop longtemps sur un salon d'aide
#4
(07/08/2019, 05:10)mecmec a écrit : Mince d'accord dans le forum http://forum.egghelp.org/viewtopic.php?t=15543 l'auteur il dit qu'il n'a pas testé, il a dû faire ça à l'arrache.

Bonjour,

j'ai un tcl sur un sapart a toi de le modifié a ta guise

Code :
### 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 1
# Ban time in minutes.
set bantime 5
# Kick's reason
set aidlereason "Auto Sapart - aucune question n'as ete faite durant 5min"
# Exception's flags
set flags f|f
# Kick op? (0 = Yes, 1 = No)
set kickop 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 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 {([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 "sapart $nick $channel" }
    1 { newchanban $channel "*![getchanhost $nick]" "Auto Sapart" "aucune question n'as ete faite durant 5min" $bantime }
    }
}

putlog "Anti-Idle v1.2 loaded"
Répondre Avertir


Messages dans ce sujet
RE: Système de bannissement d'utilisateur qui idle trop longtemps sur un salon d'aide - par bouba89 - 12/08/2019, 17:35

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté