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 [chan_checkon]: extra characters after close-quote

Old posts that have not been replied to for several years.
Locked
t
tedbundy

Tcl error [chan_checkon]: extra characters after close-quote

Post by tedbundy »

I'm making a little script, that makes my bot rejoin a channel, when it's status is trying (.status)

But there is one channel, I not want it to rejoin...

Code: Select all

proc chan_checkon { min hour day month year } {
	foreach chan [channels] {
		if {[botonchan $chan] == 0} {
			if{[string tolower $chan] == "#mytestchan"} {
				puthelp "PRIVMSG #mytestchan :Not listening on $chan - but not rejoining"
			} else {
				puthelp "PRIVMSG #mytestchan :Not listening on $chan"
			}
		}
	}
}
I keep getting this error - think it's at the == "#mytestchan"

What should I do?
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Try this code:

Code: Select all

proc chan_checkon {min hour day month year} { 
  foreach chan [channels] { 
    if {[botonchan $chan] == 0} { 
      if{[string match -nocase "#mytestchan" "$chan"]} { 
        puthelp "PRIVMSG #mytestchan :Not listening on $chan - but not rejoining" 
        } else { 
        puthelp "PRIVMSG #mytestchan :Not listening on $chan" 
      } 
    } 
  } 
}
Should worked, not tested :)
Xpert.
t
tedbundy

Post by tedbundy »

Thanks for the quick reply - but now I recieve this error message:
Tcl error [chan_checkon]: invalid command name "if{0}"

I'm quite new at TCL so don't know what I'm doing wrong!
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Code: Select all

proc chan_checkon {min hour day month year} { 
  foreach chan [channels] { 
    if {![botonchan $chan]} { 
      if{[string match -nocase "#mytestchan" "$chan"]} { 
        puthelp "PRIVMSG #mytestchan :Not listening on $chan - but not rejoining" 
        } else { 
        puthelp "PRIVMSG #mytestchan :Not listening on $chan" 
      } 
    } 
  } 
}
:P
Xpert.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Xpert wrote:

Code: Select all

proc chan_checkon {min hour day month year} { 
  foreach chan [channels] { 
    if {![botonchan $chan]} { 
      if{[string match -nocase "#mytestchan" "$chan"]} { 
        puthelp "PRIVMSG #mytestchan :Not listening on $chan - but not rejoining" 
        } else { 
        puthelp "PRIVMSG #mytestchan :Not listening on $chan" 
      } 
    } 
  } 
}
:P
The error wasn't generated from

Code: Select all

if {[botonchan $chan] == 0} { 
it was generated from

Code: Select all

      if{[string match -nocase "#mytestchan" "$chan"]} { 
There is a space missing between the "if" and the { ...
change it to:

Code: Select all

      if {[string match -nocase "#mytestchan" "$chan"]} { 
t
tedbundy

Post by tedbundy »

Thank you strikelight - it worked! :)
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Woops.... sorry, my computer :-?
Xpert.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

computer? :mrgreen: you meant "mistake" don't you? :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Yes and no.... :P
Xpert.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Xpert wrote:Oh ****!
Please delete this flood, i didn't mean to :(
Blame the computer! :wink:
Have you ever read "The Manual"?
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

lol, when i blame the computer, it returns to me (the flood above....) :-?
Xpert.
Locked