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.

TCL needed help

Old posts that have not been replied to for several years.
User avatar
WeiJie
Halfop
Posts: 73
Joined: Thu May 20, 2004 9:30 pm
Location: Singapore

Post by WeiJie »

Anyone got any idea?
WeiJie
Admin of IntelFusion
Http://dj-online.org
#Sparks@Boatquay @ mIRC Galaxynet
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

strikelight wrote:What part of "Case Matters" don't you understand?
Everything! There's a "we don't read anything" mentality happening; a common problem.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

I've tried the following code by awyeah, but it doesn't work fine.
Anyone got any idea why doesn't awyeah's coding works? :D
+ Stealth Box +
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

What "following" code?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

The "following" code is the both coding that awyeah have scripted out:

Code: Select all

bind sign - * netsplit:lock 

proc netsplit:lock {nick uhost hand chan text {reason ""}} { 
 global botnick netsplit_lock 
  set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"] 
  if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} { 
 putquick "MODE $chan +m" -next; set netsplit_lock 1 
 putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next 
 utimer 10 [list putquick "MODE $chan -m" -next] 
 utimer 15 [list unset netsplit_lock] 
 } 
 return 0 
} 
and...

Code: Select all

bind sign - * netsplit:lock 

proc netsplit:lock {nick uhost hand chan text {reason ""}} { 
 global botnick netsplit_lock 
  set chan [string tolower $chan] 
  set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"] 
  if {(![info exists netsplit_lock($chan)]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} { 
 putquick "MODE $chan +m" -next; set netsplit_lock($chan) 1 
 putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next 
 utimer 10 [list putquick "MODE $chan -m" -next] 
 utimer 15 [list unset netsplit_lock($chan)] 
 } 
 return 0 
} 
+ Stealth Box +
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

.. and you could also be a bit more elaborate on the "it doesn't work fine" bit also, not one of is a mind reader. :P
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

It's like what WeiJie said,
For the code...

Code: Select all

bind sign - * netsplit:lock 

proc netsplit:lock {nick uhost hand chan text {reason ""}} { 
 global botnick netsplit_lock 
  set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"] 
  if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} { 
 putquick "MODE $chan +m" -next; set netsplit_lock 1 
 putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next 
 utimer 10 [list putquick "MODE $chan -m" -next] 
 utimer 15 [list unset netsplit_lock] 
 } 
 return 0 
} 
It's shows
Tcl: syntax error in expression "(![info exists netsplit_lock]) && ([lsearch -exact $checkmod"
Tcl: ("if" test expression)
Tcl: while compiling
Tcl: "if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string m..."
Tcl: (compiling body of proc "netsplit:lock", line 4)
Tcl: invoked from within
Tcl: "netsplit:lock $_stnm1 $_stnm2 $_stnm3 $_stnm4 $_stnm5"
While for...

Code: Select all

bind sign - * netsplit:lock 

proc netsplit:lock {nick uhost hand chan text {reason ""}} { 
 global botnick netsplit_lock 
  set chan [string tolower $chan] 
  set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"] 
  if {(![info exists netsplit_lock($chan)]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} { 
 putquick "MODE $chan +m" -next; set netsplit_lock($chan) 1 
 putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next 
 utimer 10 [list putquick "MODE $chan -m" -next] 
 utimer 15 [list unset netsplit_lock($chan)] 
 } 
 return 0 
} 
It's shows,
Tcl: syntax error in expression "(![info exists netsplit_lock($chan)]) && ([lsearch -exact $c"
Tcl: ("if" test expression)
Tcl: while compiling
Tcl: "if {(![info exists netsplit_lock($chan)]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([s..."
Tcl: (compiling body of proc "netsplit:lock", line 5)
Tcl: invoked from within
Tcl: "netsplit:lock $_stnm1 $_stnm2 $_stnm3 $_stnm4 $_stnm5"
+ Stealth Box +
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

One quick glance shows that the global variable "netsplit_lock" doesn't exist!
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

([llength $reason] == 2])
should be

Code: Select all

[llength $reason]==2
I guess :)
Have you ever read "The Manual"?
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

Alchera wrote:One quick glance shows that the global variable "netsplit_lock" doesn't exist!
What should I do den?
Change the
bind sign - * netsplit:lock
to
bind sign - * netsplit_lock
?
+ Stealth Box +
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

global doesnt mean proc.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Stealthx: Just do as user suggested. :)
user wrote:
([llength $reason] == 2])
should be

Code: Select all

[llength $reason]==2
I guess :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

Alchera wrote:Stealthx: Just do as user suggested. :)
user wrote:
([llength $reason] == 2])
should be

Code: Select all

[llength $reason]==2
I guess :)
Changed for both code, but however, although it doesn't appear any error message now, it still doesn't work when there's a netsplit going on.
+ Stealth Box +
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

gb wrote:You might want to use bind splt and bind rejn to detect netsplit/rejoins.
See doc/tcl-commands.doc in your eggdrop dir for details.
Have you ever read "The Manual"?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Yeah, sorry I messed up in the brackets, didn't notice it as it was quite jumbled.

This should be replaced:

Code: Select all

  if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} {

With this:

Code: Select all

  if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match -nocase "*.??.galaxynet.org" [lindex $reason 0]]) && ([string match -nocase "*.??.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2)} {
Using lindex $reason 2 would be almost equal if we are using llength $reason, as it is showing the length of the list, so if length is 2 its meaning appropriate, then list index 2 will obviously be null. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked