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.

Error: invalid command name ""

Help for those learning Tcl or writing their own scripts.
Post Reply
a
ache
Voice
Posts: 14
Joined: Fri Oct 14, 2005 7:27 am

Error: invalid command name ""

Post by ache »

I have one more problem.
I get this error:

Code: Select all

Tcl error [pub:checkgreet]: invalid command name ""
This is the code i have for the pub:checkgreet proc atm:

Code: Select all

proc pub:checkgreet { nick uhost handle channel arguments } {
  list arguments $arguments
  set greetnick [lindex $arguments 0]
  set greetchannel [lindex $arguments 1]
  set greettext [lrange $arguments 2 end]
  if {([string index $greetchannel 0]=="#")} {
    [pub:addgreet $nick $greetnick $greetchannel $greettext]
	}	elseif {[string range $greetchannel 0 2]=="all"} {
    [pub:addgreet $nick $greetnick $greetchannel $greettext]
  } else {
    putquick "NOTICE $nick : Please state a channel to greet in. \026!chelp !addgreet\026 for more info."
    return
  }
}
And this is the code i have for the pub:addgreet proc:

Code: Select all

proc pub:addgreet {nick greetnick greetchannel greettext} {
  set greetdb "scripts/charlie.tcl/greets.db"
  set greet "$greetchannel $greetnick $greettext"
  set searchString "$greetchannel $greetnick"
  set greetData [main:filetodata $greetdb]
  set greetIndex [lsearch $greetData $searchString*]
  if {($greetIndex >= "0")} {
    set greetData [lreplace $greetData $greetIndex $greetIndex $greet]
    putquick "NOTICE $nick : Changed greet message for $greetnick on $greetchannel."
  } else {
    lappend greetData "$greet"
    putquick "NOTICE $nick : Added greet message for $greetnick on $greetchannel."
  }
  set greetChannel [open $greetdb "w"]
  set greetData [lsort $greetData]
  set greetData [join $greetData "\n"]
  puts -nonewline $greetChannel "$greetData\n"
  close $greetChannel
}
thanks for any help.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Try changing:

Code: Select all

elseif {[string range $greetchannel 0 2]=="all"} {
To:

Code: Select all

elseif {([string range $greetchannel 0 2] == "all")} {
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
a
ache
Voice
Posts: 14
Joined: Fri Oct 14, 2005 7:27 am

Post by ache »

Tried it but with no luck.
still the same error..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

remove the brackets from

Code: Select all

[pub:addgreet $nick $greetnick $greetchannel $greettext]
(both)
a
ache
Voice
Posts: 14
Joined: Fri Oct 14, 2005 7:27 am

Post by ache »

worked like charm!
thanks Sir_Fz
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Damn, I must be blind. :lol:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
a
ache
Voice
Posts: 14
Joined: Fri Oct 14, 2005 7:27 am

Post by ache »

Alchera wrote:Damn, I must be blind. :lol:
exactly what i though when i got the solution.
err not that you would be blind, but me.
so simple.. that will probably never happen again :P
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Sometimes you just cannot see for the trees. LOL
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply