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.
Old posts that have not been replied to for several years.
-
`
`perl
Post
by `perl »
What"s the problem in this code ?
#*/ idle max */
set idle(max) "2"
bind raw - 317 event:idle
proc event:idle {from keyword text} {
global idle
set idle(sec) [expr $idle(max) / 60]
if {$idle(sec) > $idle(max)} {
foreach channel [channels] {
if {[onchan $nick $channel]} {
putserv "NOTICe $nick :You have too much IDLE ($idle(secs) secondes)"
putserv "MODE $channel -o $nick" } } } }
bind time -|- "00 * * * *" event:idlelook
bind time -|- "01 * * * *" event:idlelook
bind time -|- "02 * * * *" event:idlelook
bind time -|- "03 * * * *" event:idlelook
bind time -|- "04 * * * *" event:idlelook
bind time -|- "10 * * * *" event:idlelook
bind time -|- "15 * * * *" event:idlelook
bind time -|- "20 * * * *" event:idlelook
bind time -|- "25 * * * *" event:idlelook
bind time -|- "30 * * * *" event:idlelook
bind time -|- "35 * * * *" event:idlelook
bind time -|- "40 * * * *" event:idlelook
bind time -|- "45 * * * *" event:idlelook
bind time -|- "50 * * * *" event:idlelook
bind time -|- "55 * * * *" event:idlelook
proc event:idlelook { min hour day month year } {
global botnick
foreach channel(list) [channels] {
foreach user(list) [chanlist $channel(list)] {
putlog "[chanlist $channel(list)]"
if {[isop $user(list) $channel(list)]} {
putserv "WHOIS $user(list)" ; putlog "looking idle " ; return 0 } } } }
-
user
-
- Posts: 1452
- Joined: Tue Mar 18, 2003 9:58 pm
- Location: Norway
Post
by user »
if you had read the error messages you'd know. (hint: you're trying to access variables that doesn't exist)
-
`
`perl
Post
by `perl »
I find the good code but my eggdrop deop her !
Code: Select all
set idle(max) "2"
bind raw - 317 event:idle
proc event:idle {from keyword text} {
global botnick idle
set idle(nick) [lindex $text 1]
set idle(instant) [lindex $text 2]
if {$idle(max) < $idle(instant)} {
foreach chan [channels] {
if {![isop $idle(nick) $chan]} { return 0 }
if {![string match "$botnick" $idle(nick)]} {
if {[onchan $idle(nick) $chan]} {
putserv "NOTICE $idle(nick) :Attention tu est inactif depuis [lindex $text 2] secondes"
putserv "MODE $chan -o $idle(nick) " } } } } }
bind pub - whois pub:whois
proc pub:whois { nick uhost hand chan arg } {
global idle
putserv "WHOIS $arg"
}
bind time - * event:idlelook
bind time - "00 * * * *" event:idlelook
proc event:idlelook { min hour day month year } {
global botnick
foreach channel(list) [channels] {
foreach user(list) [chanlist $channel(list)] {
if {[isop $user(list) $channel(list)]} {
putserv "WHOIS $user(list)" ; return 0 } } } }
What's the problem ?