egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

lag check error ...any ideas?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
agathodaimon
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Wed Nov 09, 2005 8:40 am    Post subject: lag check error ...any ideas? Reply with quote

i found this lag checker and i "installed" it in the conf file ..i restarted the bot ....after i wihile i tryed it...it worked..but ...after an hour and i half ..it stoped working giving me this error:
Code:
Tcl error [dcc:antilag]: can't set "::lag": variable is array


And this would be the script :


Code:

# --- #

# fb.lagcheck.tcl 1.03 by FrostByte

# http://www.KeyIRC.net

# -

# This script will automatically check the lag between the bot and server.

# If the lag is greater than the set number of seconds, it will jump servers.

# -

# Updates:

# -

# 1.01 - Added a public command for bot masters: !lagcheck

#    This will make the bot check it's lag.

# -

# 1.02 - Added configuration for a lagcheck notification.

#      - Added configuration for userflag command.

#      - Added DCC command.


# -

# 1.03 - Added multi-channel support for notification.

#

# Commands are:

#

# (pub) !lagcheck - This makes the bot check it's lag.

# (dcc) .lagcheck - This does the same as above.

#

# --- #



# Set here the user flag for using the commands.

set lagflag "mno|mno"



# Set here the channels that the bot will notify that the lag is too high. Set to "" to disable.

set lagchans "#romania_nationalista #sarutuldulce #militienii"



# This is the lag limit, if the lag exceeds this time (in seconds), the bot will jump servers.

set antilagtime 5



# This is the script timer, this is the number of minutes the bot will check the lag.

set lagtimer 20



# Set this to 1 if you want the bot to notify the partyline when checking the lag. Set to 0 to disable.

set lagnotify 1



### Do not edit below this line! ###

### ---------------------------- ###



set antilagv 1.03

bind raw - 391 raw:check:lag

bind pub ${lagflag} !lagcheck pub:antilag

bind dcc ${lagflag} lagcheck dcc:antilag



if {![info exists antilagloaded]} {

  timer $lagtimer proc:antilag

  set antilagloaded 1

}



proc proc:antilag {} {

  global lagtimer lagnotify

  set ::lag "[clock clicks]"

  set ::type 0

  if {$lagnotify == 1} { putlog "\002-Anti-Lag-\002 Now checking server lag." }

  putquick "TIME"

  timer $lagtimer proc:antilag

}

proc pub:antilag {nick uhost hand chan text} {

  global lagchans

  if {([lsearch -exact [split [string tolower $lagchans]] [string tolower $chan]] != -1)} {

    set ::lag "[clock clicks]"

    set ::type 1

    set ::chan $chan

    putquick "PRIVMSG $::chan :\002 Si acu sa vad ce lag am \002"

    putquick "TIME"

  }

}

proc dcc:antilag {hand idx text} {

  set ::lag "[clock clicks]"

  putlog "\002-Anti-Lag-\002 Now checking server lag."

  set ::type 2

  putquick "TIME"

}



proc raw:check:lag {from key text} {

  global antilagtime lagchans lagnotify

  set lag [expr ((([clock clicks] - $::lag)/2)/60)/1000.]

  if {$lagnotify == 1} { putlog "\002-Anti-Lag-\002 Lagu e de \002$lag\002 seconde." }

  if {$::type == 1} { putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Lagu curent e de \002$lag\002 seconds." }

  if {($lagnotify == 0) && ($::type == 2)} { putlog "\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }

  if {$lag > $antilagtime} {

    if {($lagchans != "") && ($::type != 2)} {

      foreach msgchan [split [string tolower $lagchans]] {

        putquick "PRIVMSG $msgchan :\002Attention\002: Domle am mai mult de  $antilagtime seconde (currently at $lag seconds). Ies putin schimb servaru si mantorc."

      }

    }

    putlog "\002-Anti-Lag-\002 Lag exceeded $antilagtime seconds. Trying another server..."

    jump

  }

  unset ::lag

  if {[info exists ::chan]} { unset ::chan }

  if {[info exists ::type]} { unset ::type }

}



putlog "\002-Anti-Lag-\002 $antilagv by FrostByte: Loaded
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Nov 09, 2005 12:10 pm    Post subject: Reply with quote

It seems that lag is being used globally by some other script as an array, so try to replace all ::lag and $::lag with ::mylag and $::mylag.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber