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.

Tcl Error extra characters after close-quote

Old posts that have not been replied to for several years.
Locked
m
minotaur
Voice
Posts: 19
Joined: Sun Jul 06, 2003 8:36 pm

Tcl Error extra characters after close-quote

Post by minotaur »

Code: Select all

proc ssystem:need {chan type} {
global recoverbot
if ($recoverprot == "1") {
if([onchan "Q" $chan]) { 
	switch -- $type { 
	"op" { 
	   putserv "PRIVMSG Q :OP $chan" 
	   return 1 
	 } 
	"unban" { 
	   putserv "PRIVMSG Q :UNBANALL $chan" 
	   return 1 
	 } 
	"invite" { 
	   putserv "PRIVMSG Q :INVITE $chan" 
	   return 1 
	 } 
	"limit" { 
	   putserv "PRIVMSG Q :CHANFLAGS -impkl $chan" 
	   return 1 
	 }
	} 
}
if([onchan "L" $chan]) { 
	switch -- $type { 
	"op" { 
	   putserv "PRIVMSG L :OP $chan" 
	   return 1 
	 } 
	"unban" { 
	   putserv "PRIVMSG L :UNBANALL $chan" 
	   return 1 
	 } 
	"invite" { 
	   putserv "PRIVMSG L :INVITE $chan" 
	   return 1 
	 } 
	"limit" { 
	   putserv "PRIVMSG L :CLEARCHAN $chan" 
	   return 1 
	 }
	} 
} 
}
}
and then the error
[02:13] Tcl error [ssystem:need]: extra characters after close-quote
But i dont know why do you know the reason whats wrong???
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Just a guess, but it's probably because you used parenthesis ( ) instead of curly braces { } in all your if statements.
m
minotaur
Voice
Posts: 19
Joined: Sun Jul 06, 2003 8:36 pm

Post by minotaur »

I dont understand you very well whats the problem can you give me an example?
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

you usually get this eror because there is a missing " or in your case you have too many "" in your script.

try not to put more than a leadind " and a triling " in a same command

exemple :

Code: Select all

"op" { 
      putserv "PRIVMSG Q :OP $chan" 
      return 1 
here you should not put op between "" since you got "PRIVMSG Q :OP $chan" already between ""

hope it helps

Pitchat
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

minotaur wrote:I dont understand you very well whats the problem can you give me an example?
There are a couple of things in your script minotaur.

What stdragon means is that "if" constructs are made with curly braces, not with "(" and ")". This is the actual reason for the error message you are having.

Example:

Code: Select all

RIGHT: if { test } { ... }
WRONG: if ( test ) { ... }
Additionally, you have an "if([onchan "Q" $chan]) {". So, first you need to replace the "(" with a "{" and the ")" with a "}".
But also you need to include an extra space.

Example:

Code: Select all

RIGHT: if { test } { ... }
WRONG: if{ test } { ... }
WRONG: if { test }{ ... }
(note the subtle differences)
Third, your script introduces a global variable "recoverbot", but you test on the variable "recoverprot".

Code: Select all

proc ssystem:need {chan type} { 
   global recoverbot 
   if ($recoverprot == "1") {
   [snip]
Note that this if-statement also uses "(" and ")", which is wrong.
m
minotaur
Voice
Posts: 19
Joined: Sun Jul 06, 2003 8:36 pm

Post by minotaur »

Ok Thx to all guys :) 4 help

But i still have one question how can i finde if a variable like $nick is the Nick of the Current Bot or of an Bot in the Botnet?
Locked