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.
Help for those learning Tcl or writing their own scripts.
flexboy
Voice
Posts: 8 Joined: Sun Feb 04, 2007 5:11 am
Post
by flexboy » Thu Mar 22, 2007 6:10 pm
Can some one help me im tired of this error. i tryed googleing etc, but i dont know how to fix the error, can some one help please.
Here's the error:
Code: Select all
<eggdrop> Currently: illegal channel option: 111
<eggdrop> Currently: while executing
<eggdrop> Currently: "channel set [xindex $arg 1] $s"
<eggdrop> Currently: ("foreach" body line 3)
<eggdrop> Currently: invoked from within
<eggdrop> Currently: "foreach s [lrange $arg 2 end] {
<eggdrop> Currently: if {[llength $s] == "1"} {
<eggdrop> Currently: channel set [xindex $arg 1] $s
<eggdrop> Currently: } {
<eggdrop> Currently: channel set [xindex $arg 1..."
<eggdrop> Currently: ("sync" arm line 30)
<eggdrop> Currently: invoked from within
Here's code:
Code: Select all
set c [xindex $arg 1]
channel set $c chanmode [lindex $arg 2]
channel set $c idle-kick [lindex $arg 3]
channel set $c stopnethack-mode [lindex $arg 4]
channel set $c revenge-mode [lindex $arg 5]
channel set $c flood-chan [lindex $arg 6]
channel set $c flood-ctcp [lindex $arg 7]
channel set $c flood-join [lindex $arg 8]
channel set $c flood-kick [lindex $arg 9]
channel set $c flood-deop [lindex $arg 10]
channel set $c flood-nick [lindex $arg 11]
channel set $c aop-delay [lindex $arg 12]
} elseif {[xindex $arg 0] == "2"} {
foreach s [lrange $arg 2 end] {
if {[llength $s] == "1"} {
channel { set [xindex $arg 1]
} {
channel set [xindex $arg 1] [lindex $s 0] [lindex $s 1]
}
}
}
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Mar 22, 2007 6:40 pm
What's [xindex] and what's $arg?
flexboy
Voice
Posts: 8 Joined: Sun Feb 04, 2007 5:11 am
Post
by flexboy » Thu Mar 22, 2007 7:04 pm
Sir_Fz wrote: What's [xindex] and what's $arg?
im not really good at scripting but here's the full script.
Code: Select all
"sync" {
if {$bot != $hubnick} {return 0}
if {[xindex $arg 0] == "0"} {
set n [xrange $arg 1 end]
foreach c [channels] {
if {[lsearch -exact $n $c] < 0} {
channel remove $c
}
}
foreach c $n {
if {[lsearch -exact [channels] $c] < 0} {
channel add $c
}
}
return 0
} elseif {[xindex $arg 0] == "1"} {
set c [xindex $arg 1]
channel set $c chanmode [lindex $arg 2]
channel set $c idle-kick [lindex $arg 3]
channel set $c stopnethack-mode [lindex $arg 4]
channel set $c revenge-mode [lindex $arg 5]
channel set $c flood-chan [lindex $arg 6]
channel set $c flood-ctcp [lindex $arg 7]
channel set $c flood-join [lindex $arg 8]
channel set $c flood-kick [lindex $arg 9]
channel set $c flood-deop [lindex $arg 10]
channel set $c flood-nick [lindex $arg 11]
channel set $c aop-delay [lindex $arg 12]
} elseif {[xindex $arg 0] == "2"} {
foreach s [lrange $arg 2 end] {
if {[llength $s] == "1"} {
channel { set [xindex $arg 1]
} {
channel set [xindex $arg 1] [lindex $s 0] [lindex $s 1]
}
}
}
return 1
}
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Mar 22, 2007 8:49 pm
Full script? try loading that and tell me if it works
flexboy
Voice
Posts: 8 Joined: Sun Feb 04, 2007 5:11 am
Post
by flexboy » Thu Mar 22, 2007 9:49 pm
I did i got this:
Code: Select all
<eggdrop> illegal channel option: 115
<eggdrop> Tcl Error: while executing
<eggdrop> Tcl Error: "channel set [xindex $arg 1] $s"
<eggdrop> Tcl Error: ("foreach" body line 3)
<eggdrop> Tcl Error: invoked from within
<eggdrop> Tcl Error: "foreach s [lrange $arg 2 end] {
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Thu Mar 22, 2007 9:52 pm
There is NO such thing as "xindex".
http://www.tcl.tk/man/tcl8.4/TclCmd/
And what was posted was definitely not the "full" script.
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
flexboy
Voice
Posts: 8 Joined: Sun Feb 04, 2007 5:11 am
Post
by flexboy » Thu Mar 22, 2007 10:04 pm
Lol. NeverMind, i just keep mising with it untell i get it.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Mar 22, 2007 11:27 pm
flexboy wrote: I did i got this:
Code: Select all
<eggdrop> illegal channel option: 115
<eggdrop> Tcl Error: while executing
<eggdrop> Tcl Error: "channel set [xindex $arg 1] $s"
<eggdrop> Tcl Error: ("foreach" body line 3)
<eggdrop> Tcl Error: invoked from within
<eggdrop> Tcl Error: "foreach s [lrange $arg 2 end] {
You still haven't posted the whole code, we can't help you unless we see the whole script (of course, what you've posted is not near to "whole").
rosc2112
Revered One
Posts: 1454 Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania
Post
by rosc2112 » Fri Mar 23, 2007 9:50 pm
A quick search for 'xindex' and 'xrange' shows a couple of scripts that define them as custom procs, one is a filesharing script, another is a hub/relay script.. Neither seem to apply in this case.
hm2k
Halfop
Posts: 57 Joined: Mon Sep 11, 2006 7:27 am
Location: UK
Post
by hm2k » Tue Jan 22, 2008 10:06 am
Appears to be similar to harry.tcl...
Code: Select all
proc xindex {xr xr1} {
return [join [lrange [split $xr] $xr1 $xr1]]
}
proc xrange {xr xr1 xr2} {
return [join [lrange [split $xr] $xr1 $xr2]]
}
Relates to this post also:
http://forum.egghelp.org/viewtopic.php?p=70207