View previous topic :: View next topic |
Author |
Message |
jsilvestre Voice

Joined: 05 Mar 2005 Posts: 20 Location: Lisbon, Portugal
|
Posted: Fri Oct 14, 2005 11:09 pm Post subject: Error with this script |
|
|
Code: |
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# ____ _ _____ _ _ ___ #
# / ___| |__ __ _ _ _|_ _|__ ___ | |___ __ _/ | / _ \ #
# | | | '_ \ / _` | '_ \| |/ _ \ / _ \| / __| \ \ / / || | | | #
# | |___| | | | (_| | | | | | (_) | (_) | \__ \ \ V /| || |_| | #
# \____|_| |_|\__,_|_| |_|_|\___/ \___/|_|___/ \_/ |_(_)___/ #
# #
# Moonspell www.wolfheart.org moon@pthelp.org #
# #
# Script desenvolvido por Filipe Silva. #
# Bugs, sugestões, opiniões, comentários: enviem para moon@pthelp.org #
# #
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# -=(. Anti-Idle .)=- # Script Anti-Idle, Funciona para Idle Global, (raw 317) #
# # Verifica primeiro o idle no Canal #
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# Canal ou Canais em que pretende usar o Script! (separar por espaços)
set idle_channels "#teste"
# Intervalo de tempo para verificar o Idle! (minutos)
set idle_interval "10"
# Máximo de tempo idle permitido no Canal! (minutos)
set idle_time "30"
# [ops/voices/both] - Utilizadores aos quais se aplicará o Script.
set idle_users ops
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# -=(. FAQ .)=- # Respostas às possiveis dúvidas que possam surgir #
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# P: O que é uma Flag? #
# R: Flag é o nome dado ao estatuto(s) que cada Utilizador do Eggdrop tem, para #
# mais informações sobre cada uma delas faz (.help whois) na PartyLine do bot.#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# P: O que quer dizer Idle ? #
# R: Idle é o tempo de inactividade de um cliente em relação ao seu servidor, #
# ou seja, um utilizador que não envia nenhuma Informação durante "X" tempo, #
# esse "X" corresponde ao Idle. #
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# P: Eu tenho uma dúvida diferente, onde posso obter ajuda ? #
# R: Nesse caso, poderás sempre pedir ajuda no canal #Eggdrop (irc.ptnet.org), e #
# #Egg (irc.brasnet.org), canais pertencentes ao GUPE (Grupo de Utilizadores #
# Portugueses de Eggdrops), ou directamente comigo. #
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
### Não alterar nada a partir daqui...
#
set chantools "\002(\002ChanTools\002)\002\037\:\037"
set ver "v1.0"
putlog "## $chantools $ver by Moonspell - Activo!"
proc u {} {return };# underline code
proc r {} {return };# reverse code
proc b {} {return };# bold code
proc c {} {return };# color code
proc o {} {return };# reset attributes code
### -=(. Anti-Idle .)=- BINDS\PROCS:
#Binds
bind raw - "317" raw_317 ;# Idle Time
#Procs
proc idlecheck { } {
global idle_channels botnick idle_users idle_interval idle_time whois
set whois idlemode
if {$idle_channels == " "} {
set idle_temp [channels]
} else {
set idle_temp $idle_channels
}
foreach chan $idle_temp {
foreach person [chanlist $chan] {
switch [lindex $idle_users 0] {
"ops" {
if {[isop $person $chan]} {
if {(![matchattr [nick2hand $person $chan] b]) && ($person != $botnick) && ([getchanidle $person $chan]>$idle_time)} { putserv "WHOIS $person $person" }
}
}
"voices" {
if {[isvoice $person $chan]} {
if {(![matchattr [nick2hand $person $chan] b]) && ($person != $botnick) && ([getchanidle $person $chan]>$idle_time)} { putserv "WHOIS $person $person" }
}
}
"both" {
if {([isop $person $chan]) || ([isvoice $person $chan]) && ([getchanidle $person $chan]>$idle_time)} {
if {(![matchattr [nick2hand $person $chan] b]) && ($person != $botnick)} { putserv "WHOIS $person $person" }
}
}
}
}
}
if {![string match "*time_idle*" [timers]]} {
timer $idle_interval idlecheck
}
}
if {![string match "*time_idle*" [timers]]} {
timer $idle_interval idlecheck
}
putlog "-- $chantools Anti-Idle - Activo!"
proc raw_317 {from key arg} {
global idle_time idle_channels whois
switch [lindex $whois 0] {
"idlemode" {
set nick [string tolower [lindex $arg 1]]
set idle [string tolower [lindex $arg 2]]
set minutesidle [expr $idle / 60]
if {$minutesidle > $idle_time} {
foreach channel $idle_channels {
putserv "MODE $channel -o-v $nick $nick"
}
}
}
}
}
#EOF!
|
[03:52] Tcl error [raw_317]: can't read "whois": no such variable _________________ Best Regards
José Eduardo Silvestre |
|
Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat Oct 15, 2005 9:05 am Post subject: |
|
|
the creator of the script obiously forgot that his raw trigger will not only trigger if this script requests a WHOIS, but also when triggered by others. the var will initilzed on first usage, so it might be requested before its initialized. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|