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.

DCC Console Settings

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

DCC Console Settings

Post by TCL_no_TK »

Yo :) looking for a way to return the console channel of a dcc user? looked at doc's file and couldn't find it. :?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

doc/tcl-commands.doc wrote:hand2idx <handle>
Returns: the idx (a number greater than or equal to zero) for the user given if the user is on the party line in chat mode (even if she is currently on a channel or in chat off), the file area, or in the control of a script. -1 is returned if no idx is found. If the user is on multiple times, the oldest idx is returned.
Module: core
Something like that?
NML_375
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

R sorry :oops: the .console <#channel> [args] settings. Seems the console module documents as well, didn't have anything on this.
I looked at some of the modules that have dcc commands like .op .kickban ...etc for how they return the users .console <#channel> and found
dcc[idx].u.chat->con_chan
dunno much about it, just read it and see that.
chan = findchan_by_dname(dcc[idx].u.chat->con_chan);
if (chan)
chn = chan->dname;
else {
dprintf(idx, "Invalid console channel.\n");
return;
hope this some help. Dosen't really make sense to me. :/ sorry :(
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Ahh, sorry, guess I didn't read your post thorough enough.
Once you've got the idx, just use the console tcl command:
console <idx> [channel] [console-modes]
Description: changes a dcc user's console mode, either to an absolute mode (like "mpj") or just adding/removing flags (like "+pj" or "-moc" or "+mp-c"). The user's console channel view can be changed also (as long as the new channel is a valid channel).
Returns: a list containing the user's (new) channel view and (new) console modes, or nothing if that user isn't currently on the partyline
Module: core
Of course, if you're in the making of a module, it would be far easier to simply access the dcc table, like illustrated in your previous post.
NML_375
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

lol Thanks alot, great help. :D
Post Reply