| View previous topic :: View next topic |
| Author |
Message |
ache Voice
Joined: 14 Oct 2005 Posts: 14
|
Posted: Fri Nov 04, 2005 4:34 am Post subject: Error: invalid command name "" |
|
|
I have one more problem.
I get this error:
| Code: |
Tcl error [pub:checkgreet]: invalid command name ""
|
This is the code i have for the pub:checkgreet proc atm:
| Code: |
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: |
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. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Nov 04, 2005 7:16 am Post subject: |
|
|
Try changing:
| Code: | | elseif {[string range $greetchannel 0 2]=="all"} { |
To:
| Code: | | elseif {([string range $greetchannel 0 2] == "all")} { |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
ache Voice
Joined: 14 Oct 2005 Posts: 14
|
Posted: Fri Nov 04, 2005 7:44 am Post subject: |
|
|
Tried it but with no luck.
still the same error.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Nov 04, 2005 9:49 am Post subject: |
|
|
remove the brackets from
| Code: | | [pub:addgreet $nick $greetnick $greetchannel $greettext] |
(both) _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
ache Voice
Joined: 14 Oct 2005 Posts: 14
|
Posted: Fri Nov 04, 2005 10:04 am Post subject: |
|
|
worked like charm!
thanks Sir_Fz |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Nov 04, 2005 8:31 pm Post subject: |
|
|
Damn, I must be blind.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
ache Voice
Joined: 14 Oct 2005 Posts: 14
|
Posted: Tue Nov 08, 2005 7:24 am Post subject: |
|
|
| Alchera wrote: | Damn, I must be blind.  |
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  |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Nov 08, 2005 9:11 am Post subject: |
|
|
Sometimes you just cannot see for the trees. LOL _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|