egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error: invalid command name ""

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ache
Voice


Joined: 14 Oct 2005
Posts: 14

PostPosted: Fri Nov 04, 2005 4:34 am    Post subject: Error: invalid command name "" Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Nov 04, 2005 7:16 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ache
Voice


Joined: 14 Oct 2005
Posts: 14

PostPosted: Fri Nov 04, 2005 7:44 am    Post subject: Reply with quote

Tried it but with no luck.
still the same error..
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Nov 04, 2005 9:49 am    Post subject: Reply with quote

remove the brackets from
Code:
[pub:addgreet $nick $greetnick $greetchannel $greettext]

(both)
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
ache
Voice


Joined: 14 Oct 2005
Posts: 14

PostPosted: Fri Nov 04, 2005 10:04 am    Post subject: Reply with quote

worked like charm!
thanks Sir_Fz
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Nov 04, 2005 8:31 pm    Post subject: Reply with quote

Damn, I must be blind. Laughing
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
ache
Voice


Joined: 14 Oct 2005
Posts: 14

PostPosted: Tue Nov 08, 2005 7:24 am    Post subject: Reply with quote

Alchera wrote:
Damn, I must be blind. Laughing

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 Razz
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Nov 08, 2005 9:11 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber