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.

"can't read "chan": no such variable"

Old posts that have not been replied to for several years.
Locked
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

"can't read "chan": no such variable"

Post by Weirdo »

Is there a way i can get the bot to recognise the console channel as $chan?

(PS Damn subject :P)
Last edited by Weirdo on Wed Feb 05, 2003 7:54 am, edited 1 time in total.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

See tcl-commands.doc.

Console channels are on a user-by-users basis. It's not a case of one person changes the console, so all consoles change.

As such, you have to tell the command which user you are trying to lookup.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

all i can find in my TCL-Commands about the console is the command console which sets their channel and modes. Thinking that i would have to find the idx of the user first. And then run another command to find what channel that idx is on. I dont think that the partyline channel thingy would work either :)

I had a deep look into this earlier on, most likely i have missed something.

I had thought that the Get user command might have done this, but it evidently only picks up from the userfile. Tis quite confusing
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Weirdo wrote:all i can find in my TCL-Commands about the console is the command console which sets their channel and modes. Thinking that i would have to find the idx of the user first. And then run another command to find what channel that idx is on. I dont think that the partyline channel thingy would work either :)

I had a deep look into this earlier on, most likely i have missed something.

I had thought that the Get user command might have done this, but it evidently only picks up from the userfile. Tis quite confusing
It seems you want to find the console channel (?)

Code: Select all


bind dcc - mycommand dcc:mycommand

proc dcc:mycommand { handle idx arg } {
   set channel [lindex [console $idx] 0]
   putdcc $idx "Your channel: $channel"
}

p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I aint sure what your define as the console channel.

The console channel, as defined by eggdrop, is the channel, for which a user is seeing channel specific putlog lines, which are based on IRC channels. This is changed using .console command.

Do you mean this, or partyline channel, which can be changed using ".chat"?

The IRC console channels, the "console" command can be used, so long as the user is on the partyline.

I have tested the getuser command too. "getuser <handle> CONSOLE" will return the console settings.

As for obtaining the partyline channel, this requires a IDX.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Yep, trying to find the console channel for the handle that does the command. So i can use a kick script that uses the channel of the person doing the command

i not sure why, might be the way i copied the code, but getting this on the script you gave me

[12:51:24] <Minako> [12:51] Tcl error [dcc:conchan]: invalid command name " "

Bit odd :)
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Yeah, discovered there were 3 different channels

the one i want was the one defined in the log below

[12:50:00] <Minako> [12:50] @#weirdo (+trn) : [m/2 o/2 h/0 v/0 n/0 b/0 e/- I/-]

Since that is defined by the console setting, that was what i wanted to retrieve. With a rewrite of Egghead's code, i was able to get it working, and am going to try and put it into my script. Hopefully it should work :)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Weirdo wrote:
i not sure why, might be the way i copied the code, but getting this on the script you gave me

[12:51:24] <Minako> [12:51] Tcl error [dcc:conchan]: invalid command name " "

Bit odd :)
A bit Weirdo indeed.

http://members.fortunecity.com/eggheadt ... le.tcl.txt
Weirdo wrote: With a rewrite of ... [snip]
Did you need to rewrite it? I'm curious what was the problem and how you solved it.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

I figured it was an error in the copy n paste, so i typed it all out again, and deleted the code i copied. Looks like a stray character.

Code: Select all

bind dcc - conchan dcc:conchan
proc dcc:conchan {hand idx arg} {
	global conchan
	set conchan [lindex [console $idx] 0]
	putdcc $idx "Your channel: $conchan"
	}
Slight question. How can i add this little procedure into my main code so that when the main bit is run, it runs this channel checking procedure and so the $conchan keeps accurate.

I added the dcc:conchan into the code before, and during rehash, this error occured

[13:01:14] <Minako> [13:01] Tcl error [dcc:dragon]: wrong # args: should be "dcc:conchan hand idx arg"

added the hand idx and arg after dcc:conchan, and got Invalid IDX error.

So its been taken out of the main script, evidently i doing it wrong :P
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There should be no need to use the code you have pasted, and only means you have to do more work, to make a kick.

You don't need to do sotmhing the way we tell you, we simply provide work examples, that can be converted, used and/or incorpirated into your own scripts.

Again, you shouldn't keep it exactly the same, and should addapt it to your own needs.

Can you please tell me.

Where is the kick command typed?

If in the partyline, why create a seperate command to work out the console channel, then the kick command to do the kick?

As you noted, this way,t he console channel will go out of sync. Simply incorporate the code directly into the kick command, and it can't go out of sync.

If it's in a IRC message, ont he channel or private, then you can use the "getuser <handle> console" command, to obtain the details.

When you said you wanted to incorporate it, and you needed help. This usualy means you need to provide the information for us to show you. If we where looking over your sholder, you wouldn't need the forum.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

i ended up chucking the little line into the script

Code: Select all

set conchan [lindex [console $idx] 0]

The script itself is one that i am using to produce a kick log to a text file. Figured why it wasnt working, it seems i forgot to make the file in the first place :)

It is a partyline command. Guess i forgot to give the vital information you needed. sorry for that. The line above works pretty nicely and it solves problems i have found in a couple of my scripts where i have wanted this ability, and have been unable to find it :) Thanks :)
Locked