[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Followup #2: Need to create alias/script that affects scripts
On Fri, 01 Aug 2003 23:17:29 +0200
David Oftedal <david@start.no> wrote:
> As long as I'm solving my own problems here, I've come up with half a
> solution: I defined the usercommand DCCSEND as:
>
> exec dccsend -n %n 127.0.0.1 &3
>
> The problem is that 127.0.0.1 needs to be replaced with the IP of the
> nick defined in &2.
That goes beyond what usercommands can do, you'll need a script or plugin.
Something like:
int
dcc_cb (char *word[], char *word_eol[], void *userdata)
{
if (!strcasecmp(word[2], "SEND"))
{
find user's hostname using xchat_list_get()...
system("dccsend ...........");
return XCHAT_EAT_XCHAT;
}
return XCHAT_EAT_NONE; // let xchat do the normal dcc command
}
xchat_hook_command(ph, "DCC", XCHAT_PRI_NORM, dcc_cb, 0);
Also, this "dccsend" program needs to tell the receiver that it's offering a file.
How do you expect it to send a ctcp to the IRC server? I guess you plugin/script
would need to send that after doing the system().
A better option might be to implement "passive" dcc sends (receives are already
supported). I think there was a patch floating around somewhere...
--
Peter Zelezny.
--
XChat-discuss: mailing list for XChat users
Archive: http://mail.nl.linux.org/xchat-discuss/