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.

fb.lagcheck.tcl error

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

fb.lagcheck.tcl error

Post by Arnold_X-P »

this tcl generates me the following error in partyline:
[20:03] <(Deborilla> [01:04:00] -Anti-Lag- Comprobando si hay un retraso en mi servidor.
[20:04] <(Deborilla> [01:04:00] -Anti-Lag- El retraso corriente actual es 1.552 segundos.
[20:04] <(Deborilla> [01:04:00] Tcl error [raw:check:lag]: can't unset "::chan": no such variable

Code: Select all

# Set here the user flag for using the commands.
set lagflag "m"

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

# 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
  foreach msgchan $lagchans {
    if {$chan == $msgchan} {
      set ::lag "[clock clicks]"
      set ::type 1
      set ::chan $msgchan
      putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Now checking server lag."
      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 Current lag is \002$lag\002 seconds." }
  if {$::type == 1} { putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Current lag is \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 $lagchans {
        putquick "PRIVMSG $msgchan :\002Attention\002: My lag has exceeded the limit of $antilagtime seconds (currently at $lag seconds). I am now jumping servers."
      }
    }
    putlog "\002-Anti-Lag-\002 Lag exceeded $antilagtime seconds. Trying another server..."
    jump
  }
  unset ::lag
  unset ::chan
  if {[info exists ::type]} { unset ::type }
}

putlog "\002-Anti-Lag-\002 $antilagv by FrostByte: Loaded"
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Try changing the line...

Code: Select all

unset ::chan
...to...

Code: Select all

unset -nocomplain ::chan
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

yes bros thanks..

unset -nocomplain ::lag
unset -nocomplain ::chan
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

Code: Select all

# Set here the user flag for using the commands.
set lagflag "m"

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

# 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
  foreach msgchan $lagchans {
    if {$chan == $msgchan} {
      set ::lag "[clock clicks]"
      set ::type 1
      set ::chan $msgchan
      putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Now checking server lag."
      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 Current lag is \002$lag\002 seconds." }
  if {$::type == 1} { putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Current lag is \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 $lagchans {
        putquick "PRIVMSG $msgchan :\002Attention\002: My lag has exceeded the limit of $antilagtime seconds (currently at $lag seconds). I am now jumping servers."
       }
     }
    putlog "\002-Anti-Lag-\002 Lag exceeded $antilagtime seconds. Trying another server..."
    jump
   }
  unset -nocomplain ::lag
  unset -nocomplain ::chan
  if {[info exists ::type]} { unset -nocomplain ::type }
 }

putlog "\002-Anti-Lag-\002 $antilagv by FrostByte: Loaded"
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
Post Reply