PDA

View Full Version : [C] Basic example


apusnaias
07-02-2004, 09:35 AM
Hello,

I just want to try to program a very basic little C module to attach to the eggdrop.

Please can someone give a little example, just to do smthing like this :

when i do "!test message" on the irc chan, a TCL script call a test.exe program which is written in C with "!test meassage" in parameter,the program do smthing with, and the program return to the channel smthing like "nick say bla bla".

Can someone write me thr TCL script, and the part of C program to return smthing plz ?

I hope my msg is clear :)

THx in advance.

FTPServerTools
07-02-2004, 01:32 PM
#include <stdio.h>
#include <stdlib.h>
void main(int argc, char *argv[])
{
int i;
for (i=0;i<argc;i++)
printf("Arg[%d]=s\n",i,argv[i]);
}
compile as mytool.exe

In tcl:
set reply [exec -- "c:/mytools/mytool.exe"]

apusnaias
07-05-2004, 04:37 AM
thx a lot, this will help for sure :)