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.
Old posts that have not been replied to for several years.
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 12:54 pm
error in my userlist:
Tcl error [user_list]: list element in quotes followed by "HOSTS"]" instead of space
The script:
Code:
Code: Select all
bind pub o|f !userlist user_list
proc user_list {nick uhost hand chan text} {
if {[userlist |amnovf $chan] == ""} {
putserv "NOTICE $nick :No users found in my userlist for $chan "
return 0
}
putquick "NOTICE $nick :Userlist for $chan "
foreach user [userlist |amnovf $chan] {
if {[set usersnick [hand2nick $user]] == ""}
putquick "NOTICE $nick :(( Handle: $user || Nickname: Offline, or not in any of the bots channels. || Host(s): [getuser $user "HOSTS"] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
} else {
if {[set usersnick [hand2nick $user]] != ""}
putquick "NOTICE $nick :(( Handle: $user || Nickname: $usersnick || Host(s): [getuser $user "hosts"] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
}
putquick "NOTICE $nick :End of list."
}
putlog "Userlist.tcl By Tosser^^ Loaded"
I dont know whats wrong, i tried [join [getuser $user "hosts"]" ","] but that dont work, please help ;p
Thanks in advance!![/code]
r0t3n @ #r0t3n @ Quakenet
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Jun 14, 2005 1:21 pm
or
should work fine.
PS: Make sure you don't have the line split with some enter by mistake after copy paste.
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 1:25 pm
ok, thanks Sir_fz
r0t3n @ #r0t3n @ Quakenet
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Jun 14, 2005 1:31 pm
nope, it's not that
is 100% equivalent to
the bug is most likely in the usage of [hand2nick], which may return a list - and you incorrectly assume it always returns a single nick
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 1:52 pm
Hmm, im not using the $usersnick var, im using $user so i should think thats not causing the error ...
r0t3n @ #r0t3n @ Quakenet
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Jun 14, 2005 1:56 pm
move those [getuser] and [chattr] out of the notice and use .set errorInfo to obtain full backtrace of the error
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Jun 14, 2005 1:59 pm
Tosser^^ wrote: Hmm, im not using the $usersnick var, im using $user so i should think thats not causing the error ...
you don't even know
your code
Code: Select all
if {[set usersnick [hand2nick $user]] != ""}
putquick "NOTICE $nick :(( Handle: $user || Nickname: $usersnick || Host(s): [getuser $user "hosts"] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 2:07 pm
Hmm, i got past that error now, something else is wrong, i cant seem to find the error because the eggdrop crashes before i have a chance
Code: Select all
bind pub o|f !userlist user_list
proc user_list {nick uhost hand chan text} {
if {[userlist |amnovf $chan] == ""} {
putserv "NOTICE $nick :No users found in my userlist for $chan "
return 0
}
putquick "NOTICE $nick :Userlist for $chan "
foreach user [userlist |amnovf $chan] {
set usersnick [hand2nick $user]
if {[$usersnick == ""} {
putquick "NOTICE $nick :(( Handle: $user || Nickname: Offline, or not in any of the bots channels. || Host(s): [getuser $user HOSTS] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
}
} else {
if {[$usersnick != ""} {
putquick "NOTICE $nick :(( Handle: $user || Nickname: $usersnick || Host(s): [getuser $user HOSTS] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
}
}
putquick "NOTICE $nick :End of list."
}
}
putlog "Userlist.tcl By Tosser^^ Loaded"
I think it maybe a bracket error, please help ;p
r0t3n @ #r0t3n @ Quakenet
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Jun 14, 2005 2:12 pm
crashes? care to post a log and DEBUG file?
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 2:27 pm
[19:25] Tcl error in file 'eggdrop.conf':
[19:25] invalid command name "}"
while executing
"}"
(file "scripts/userlist.tcl" line 21)
invoked from within
"source scripts/userlist.tcl"
(file "eggdrop.conf" line 1348)
[19:25] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
r0t3n @ #r0t3n @ Quakenet
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Jun 14, 2005 2:30 pm
that's not a crash dude
remove your script from bot's config, start your bot, log in on party-line, load your script (.tcl source scripts/yourscript.tcl), obtain error traceback (.set errorInfo)
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 2:36 pm
<[-Guard-]> [19:35] Tcl error in file 'eggdrop.conf':
<[-Guard-]> [19:35] invalid command name "}"
<[-Guard-]> while executing
<[-Guard-]> "}"
<[-Guard-]> (file "scripts/userlist.tcl" line 21)
<[-Guard-]> invoked from within
<[-Guard-]> "source scripts/userlist.tcl"
<[-Guard-]> (file "eggdrop.conf" line 1353)
<[-Guard-]> [19:35] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
-
DCC session closed
Thats the error i get
r0t3n @ #r0t3n @ Quakenet
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Tue Jun 14, 2005 2:43 pm
Err your script was a complete and utter mess. My 1 year old could do a better job.
If you use indentations properly you would see where you have gone wrong and you aren't using
else properly.
I didn't check your putquick lines but the script should not crash now.
try this.
Code: Select all
bind pub o|f !userlist user_list
proc user_list {nick uhost hand chan text} {
if { [userlist |amnovf $chan] == "" } {
putserv "NOTICE $nick :No users found in my userlist for $chan"
} else {
putquick "NOTICE $nick :Userlist for $chan"
foreach user [userlist |amnovf $chan] {
set usersnick [hand2nick $user]
if { $usersnick == "" } {
putquick "NOTICE $nick :(( Handle: $user || Nickname: Offline, or not in any of the bots channels. || Host(s): [getuser $user HOSTS] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
} else {
putquick "NOTICE $nick :(( Handle: $user || Nickname: $usersnick || Host(s): [getuser $user HOSTS] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))"
}
}
putquick "NOTICE $nick :End of list."
}
}
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Jun 14, 2005 2:47 pm
balance your braces, make sure you use [hand2nick] correctly, use proper indentation throughout your code
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 14, 2005 2:50 pm
Thanks dude, it works great, thanks again ;p !!
r0t3n @ #r0t3n @ Quakenet