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 

fb.lagcheck.tcl error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 221
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Mon May 25, 2015 8:16 pm    Post subject: fb.lagcheck.tcl error Reply with quote

this tcl generates me the following error in partyline:
Quote:

[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:

# 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"

_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Mon May 25, 2015 9:11 pm    Post subject: Reply with quote

Try changing the line...
Code:
unset ::chan
...to...
Code:
unset -nocomplain ::chan

_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 221
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Wed Jun 03, 2015 10:30 pm    Post subject: Reply with quote

yes bros thanks..

unset -nocomplain ::lag
unset -nocomplain ::chan
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 221
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Wed Jun 03, 2015 10:36 pm    Post subject: Reply with quote

Code:
# 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"

_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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