#include main(int argc, char *argv[]) { if(argc<2) { printf("\nSyntax:\n configure -quick for a quick install\n configure -all for a complete install\n"); exit(0); } if(!strcasecmp(argv[1],"-quick",strlen(argv[1]))) easy(); else if(!strcasecmp(argv[1],"-all",strlen(argv[1]))) hard(); else { printf("\nSyntax:\n configure -quick for a quick install\n configure -all for a complete install\n"); exit(0); } } easy() { FILE *fp; char temp[255]; char temp2[255]; char chan[255]; system("cp config.h config.old"); fp = fopen("config.h","w"); printf("\n\n\n\n\n\nQuick install"); printf("\n\nWelcome to MudBot configuration!\nThis will make the config.h file to follow your needs.\n"); printf("You must answer something to all questions.\nThis config is for MudBot2.x"); fputs("/* Main config file - Dont forget to 'make clean' and 'make' after\n",fp); fputs("* any change here.*/\n",fp); fputs("/* print to screen stuff from the server */\n",fp); fputs("#undef TERMINAL\n",fp); fputs("/* command char [char] */\n",fp); printf("\nWhat command char do you want to use ( ie. ! ) ? "); gets(temp); fputs("#define CMDCHAR '",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("!",fp); fputs("'\n",fp); fputs("/* go to background on startup [define|undef] */\n",fp); fputs("#define BACKGROUND\n",fp); fputs("/* time for the play command [number] */\n",fp); fputs("#define PLAY_SLEEPTIME 15\n",fp); fputs("/* sleep time in secs between commands.. recommended value = 1 [number]*/\n",fp); fputs("#define SLEEP_TIME 1\n",fp); fputs("/* umodes for the bots */\n",fp); fputs("#define UMODES \"+is-wd\"\n",fp); fputs("/* your account name (or fake if you dont use identd) */\n",fp); printf("\nWhat is your account login? "); gets(temp); fputs("#define ACCOUNTNAME \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* who to /msg when the bot sees netsplits. Put a dummy channel\n",fp); fputs("* or change the UMODES to -s if you dont want it reported [channel] */\n",fp); printf("\nWhat will be this bot's main channel? (ie. #bots) ? "); gets(temp); if(cas_cmp(temp,"")) strcpy(chan,temp); else strcpy(chan,"#bots"); fputs("#define REPORTS \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* send warnings when kicked or modes to that channel [channel|undef] */\n",fp); fputs("#undef WARNINGS\n",fp); fputs("/* autobans file [filename] */\n",fp); fputs("#define AUTOBAN \"autoban.file\"\n",fp); fputs("/* local users file. [filename] */\n",fp); fputs("#define LOCALFILE \"local.file\"\n",fp); fputs("/* working dir where the files must be [path] */\n",fp); printf("\nIn what path is the bot in (ie. /home/elfboy/mudbot) ? "); gets(temp); fputs("#define PATH \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* do we allow people with level 8 or more to kill? of course the\n",fp); fputs("* bot need to be opered for that */\n",fp); fputs("#undef ALLOW_KILL\n",fp); fputs("/* allow level 8 users to masskill? [define|undef] (EXPERIMENTAL) */\n",fp); fputs("#undef ALLOW_MASSKILL\n",fp); fputs("/* do we want to allow people to rehash, make the bot oper up, and\n",fp); fputs("* wallops? */\n",fp); fputs("#undef OPER_CMDS\n",fp); fputs("/* deop everyone that gets oped by everyone except the bot [define|undef] */\n",fp); fputs("#undef BITCH\n",fp); fputs("/* allow level 10 to shutdown the bot [define|undef] */\n",fp); fputs("#define ALLOW_EXIT\n",fp); fputs("/* channels are public channels. You can use local with & [char]*/\n",fp); fputs("#define CHANCHAR \"#\"\n",fp); fputs("/* jump to default server on disconnect? [define|undef] */\n",fp); fputs("#define JUMPONERROR\n",fp); fputs("/* who is my master? Must be a nick [string] */\n",fp); printf("\nWho is the master of this bot? must be a nick (ie. Drow) ? "); fputs("#define MASTER \"",fp); gets(temp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* do I report commands from level 0 users to the master? [define|undef] */\n",fp); fputs("#undef SPY\n",fp); fputs("/* Undernet Cservice file [filename] */\n",fp); fputs("#define CSFILE \"undernet.file\"\n",fp); fputs("/* default servers names. there are 4 defines, dont add/rem some [string]*/\n",fp); printf("\nDefault server #1 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERA \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); printf("\nDefault server #2 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERB \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); printf("\nDefault server #3 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERC \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); printf("\nDefault server #4 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERD \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); fputs("/* default port [int]*/\n",fp); fputs("#define DEFAULTPORT 6667\n",fp); fputs("/* password for the server if you need one [string|undef]*/\n",fp); fputs("#undef PASS\n",fp); fputs("/* news file [filename] */\n",fp); fputs("#define NEWSFILE \"news.file\"\n",fp); printf("\nWhat nick do you want for the bot (ie. MudBot) ? "); gets(temp); fputs("/* bot nick [string] */\n",fp); fputs("#define BOTNAME \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* bot second nick [string] */\n",fp); printf("\nWhat second nick do you want for the bot (ie. Mud) ? "); gets(temp); fputs("#define BOTSECNAME \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* bot real name [string] */\n",fp); printf("\nWhat RealName do you want for the bot (ie. The Best!) ? "); gets(temp); fputs("#define BOTDESC \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* your URL or the bot's URL or whatever... [string|undef]*/\n",fp); fputs("#define URL \"http://mudbot.darkelf.net\"\n",fp); fputs("/* what to play on connect. must be in raw IRC [filename]*/\n",fp); fputs("#define STARTSCRIPT \"script.file\"\n",fp); fputs("/* users file [filename] */\n",fp); fputs("#define USERFILE \"user.file\"\n",fp); fputs("/* where do we log [filename|undef] */\n",fp); fputs("#undef LOGFILE_MSG\n",fp); fputs("#define LOGFILE_CMD \"mudbot-cmd.log\"\n",fp); fputs("#undef LOGFILE_PUB\n",fp); fputs("/* where to report errors [filename|undef] */\n",fp); fputs("#define LOGERRORS \"errors.log\"\n",fp); fputs("/* where to put the silence list [filename] */\n",fp); fputs("#define SILENCEFILE \"silence.file\"\n",fp); fputs("/* fix mem leaks problems [define|undef] */\n",fp); fputs("#define MEMLEAK\n",fp); fputs("/* allow users 0 (anyone) to use channel specific commands [define|undef]*/\n",fp); fputs("#undef BAR\n",fp); fputs("/* path of the html dir.. FILES IN THAT DIR WILL BE DELETED [path]*/\n",fp); printf("\nWhat html path do you want for the bot? FILES IN THAT DIR WILL BE DELETED (ie. /home/urlogin/public_html/mudbot) ? "); gets(temp); fputs("#define HTMLDIR \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* Use as NickServ? must also define allowkill and opercmds [define|undef] */\n",fp); fputs("#undef NICKSERV\n",fp); fputs("/* make the help command for nickserv only? [define|undef] */\n",fp); fputs("#undef USE_AS_NICKSERV_ONLY\n",fp); fputs("/* view kill/glines/etc. made for ircu may have bugs on dal/ircd [chan|undef]*/\n",fp); fputs("#undef OPERVIEW\n",fp); fputs("/* Show the GLINE's reason [define|undef] */\n",fp); fputs("#undef OPERVIEW_G_REASON\n",fp); fputs("/* do we report even kills? (OPERVIEW must be defined) [define|undef] */\n",fp); fputs("#undef VIEWKILLS\n",fp); fputs("/* view kills reasons? (VIEWKILLS must be defined) [define|undef] */\n",fp); fputs("#undef KILLS_REASONS\n",fp); fputs("/* to see tru the bot's eyes what's going on online [undef|define]\n",fp); fputs("* You can also use MudBot as your IRC client if you undef background and\n",fp); fputs("* define this */\n",fp); fputs("#undef VIEW\n",fp); fputs("/* define this if you want to allow level 9 users to use shell commands */\n",fp); fputs("#undef ALLOW_EXEC\n",fp); fputs("/* use alias.file aliases? [define|undef]*/\n",fp); fputs("#define USE_ALIASES\n",fp); fputs("/* Allow mult aliases for a single word? [define|undef]*/\n",fp); fputs("#define MULT_ALIASES\n",fp); fputs("/* Kick on '-oooooo' ? [define|undef] */\n",fp); fputs("#define MASSDEOP\n",fp); fputs("/* Use this MudBot as FTP manager to manage this server' annonymous FTP\n",fp); fputs("* server? You usualy need root to hands you management of it.[define|undef]*/\n",fp); fputs("#undef FTPMGR\n",fp); fputs("/* FTP root where to put the server's files in (you need root to chown it\n",fp); fputs("* to your account) [path] */\n",fp); fputs("#define FTPROOT \"/home/ftp\"\n",fp); fputs("/* Use validate passwords? [define|undef] */\n",fp); fputs("#define USE_VALIDATE\n",fp); fputs("/* Debug option. LOGERRORS must be defined for this. [define|undef]*/\n",fp); fputs("#undef LOG_ERRNO\n",fp); fputs("/* Allows you to share user files. Be carefull with that [def|undef]*/\n",fp); fputs("#undef SHARE_USERFILE\n",fp); fputs("/* Use interactive Web interface [define|undef] (EXPERIMENTAL)*/\n",fp); fputs("#undef INTER_WEB\n",fp); fputs("/* CGI-BIN URL [url] */\n",fp); fputs("#define CGI_BIN \"/cgi-bin\"\n",fp); fputs("/* Use crypt passwords [define|undef] (EXPERIMENTAL) */\n",fp); fputs("#define USE_CRYPT_PASSWD\n",fp); fputs("/* !kb's kick message [msg] */\n",fp); fputs("#define KB_MSG \"Bye...\"\n",fp); fputs("/* reports commands in REPORTS channel [define|undef]*/\n",fp); fputs("#undef REPORT_COMMANDS\n",fp); fputs("/* Stop trying after how many failed connects [int] */\n",fp); fputs("#define MAX_CONNECT_COUNT 30\n",fp); fputs("/* Most commands wont work if set. Usefull to use with 1 specific mudscript. [define|undef]*/\n",fp); fputs("#undef QUIET\n",fp); fputs("/* Bind to an IP [undef|ip] */\n",fp); fputs("#undef VIRTUAL\n",fp); fputs("/* Flood protection level [0,1,2,3] */\n",fp); fputs("#define FLOOD_PROTECT 1\n",fp); fputs("\n",fp); fputs("/* BINDS\n",fp); fputs(" * Use these binds to make the bot do commands on specific actions.\n",fp); fputs(" * Like if you wanted it to msg anyone who join a channel the bot's in:\n",fp); fputs(" * #define BIND_JOIN \"privmsg $nick :Welcome to my $channel $nick !\"\n",fp); fputs(" * $nick, $channel, %0, %1.. %6 are reconized by the bot.\n",fp); fputs("*/\n",fp); fputs("#define USE_BINDS\n",fp); fputs("#undef BIND_MODE\n",fp); fputs("#undef BIND_JOIN\n",fp); fputs("#undef BIND_PART\n",fp); fputs("#undef BIND_PRIVMSG\n",fp); fputs("#undef BIND_NOTICE\n",fp); fputs("/* Service server.. Allows level 8 users to do special commands [def|undef]\n",fp); fputs(" * Read the README.operserv for more info */\n",fp); fputs("#undef SERVICE\n",fp); fputs("/* Server will link to... [server name] */\n",fp); fputs("#define SERVICE_UPLINK \"irc.dummy.net\"\n",fp); fputs("/* The service server will have name... [server name] */\n",fp); fputs("#define SERVICE_SERVER_NAME \"services.dummy.net\"\n",fp); fputs("/* Port to link to... [port] */\n",fp); fputs("#define SERVICE_PORT 6667\n",fp); fputs("/* Server password to send [pass] */\n",fp); fputs("#define SERVICE_PASS \"password\"\n",fp); fputs("/* Service server description [string] */\n",fp); fputs("#define SERVICE_DESC \"This is MudBot's Service Server\"\n",fp); fputs("/* Allows masked glines [define|undef]*/\n",fp); fputs("#undef MASKED_GLINES\n",fp); fputs("/* Gline time [time in secs] */\n",fp); fputs("#define GLINE_TIME 3600\n",fp); fputs("/* Use the bot's help as OperServ's help */\n",fp); fputs("#undef USE_AS_OPERSERV_ONLY\n",fp); fputs("/* Shows everything the server received to the screen. Debug tool [def|undef]*/\n",fp); fputs("#undef SERVICE_TERMINAL\n",fp); fputs("/* Channel Service. Allows users to register channels [define|undef]\n",fp); fputs(" * Read the README.chanserv for more info */\n",fp); fputs("#undef CHANSERV\n",fp); fputs("/* Server will link to... [server name] */\n",fp); fputs("#define CHANSERV_UPLINK \"irc.dummy.net\"\n",fp); fputs("/* The server will have name... [server name] */\n",fp); fputs("#define CHANSERV_SERVER_NAME \"channels.dummy.net\"\n",fp); fputs("/* Port to link to... [port] */\n",fp); fputs("#define CHANSERV_PORT 6667\n",fp); fputs("/* Server password to send [pass] */\n",fp); fputs("#define CHANSERV_PASS \"password\"\n",fp); fputs("/* Service server description [string] */\n",fp); fputs("#define CHANSERV_DESC \"This is MudBot's Service Server\"\n",fp); fputs("/* Shows everything the server received to the screen. Debug tool [def|undef]*/\n",fp); fputs("#undef CHANSERV_TERMINAL\n",fp); printf("\nConfig should be ok. Now you can 'make clean' and 'make'. Edit the config.h file for other options or debug options. Most features are disabled by default, so you can customize what you need in config.h\n\n"); fclose(fp); fp=fopen("user.file","w"); printf("\nLet's configure the user file.\nWhat nick do you want (ie. Drow) ?\n"); strcpy(temp2,"10:"); gets(temp); strcat(temp2,temp); strcat(temp2,":"); printf("\nWhat mask user@host do you want (ie. *el@*.darkelf.net) ?\n"); gets(temp); strcat(temp2,temp); strcat(temp2,":"); printf("\nWhat password (8 chars or less) do you want to use (ie. lalala) ?\n"); gets(temp); strcat(temp2,do_cryptit(temp)); strcat(temp2,":0:0:"); printf("\nWhat email do you want to use (ie. drow@wildstar.net) ?\n"); gets(temp); printf("\n\nPlease read the README file.\n"); strcat(temp2,temp); strcat(temp2,":\n"); fputs(temp2,fp); fclose(fp); sprintf(temp,"echo %s Main bot channel >> channels.file \n",chan); system(temp); exit(0); } do_cryptit(str) char str[255]; { char salt[3]; salt[0]='z'; salt[1]='0'; salt[2]='\0'; return crypt(str,salt); } hard() { FILE *fp; char temp[255]; char temp2[255]; char chan[255]; int t,m; system("cp config.h config.old"); fp = fopen("config.h","w"); printf("\n\n\n\n\n\n\n\nComplete install"); printf("\n\nWelcome to MudBot configuration!\nThis will make the config.h file to follow your needs\n"); printf("Please answer something to all questions.\nThis config is for MudBot2.x\nYou must answer in lower case letters for yes/no\n"); fputs("/* Main config file - Dont forget to 'make clean' and 'make' after\n",fp); fputs("* any change here.*/\n",fp); fputs("/* print to screen stuff from the server */\n",fp); fputs("#undef TERMINAL\n",fp); fputs("/* command char [char] */\n",fp); printf("\nWhat command char do you want to use ( ie. ! ) ? "); gets(temp); fputs("#define CMDCHAR '",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("!",fp); fputs("'\n",fp); fputs("/* go to background on startup [define|undef] */\n",fp); fputs("#define BACKGROUND\n",fp); fputs("/* time for the play command [number] */\n",fp); printf("\nHow many secs between !play lines? (ie. 15) "); gets(temp); fputs("#define PLAY_SLEEPTIME ",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("15",fp); fputs("\n",fp); fputs("/* sleep time in secs between commands.. recommended value = 1 [number]*/\n",fp); printf("\nHow many secs between every output lines? (ie. 1) "); gets(temp); fputs("#define SLEEP_TIME ",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("1",fp); fputs("\n",fp); fputs("/* umodes for the bots */\n",fp); printf("\nWhat umodes should the bot be? (ie. +is-wd) "); gets(temp); fputs("#define UMODES \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("+is-wd",fp); fputs("\"\n",fp); fputs("/* your account name (or fake if you dont use identd) */\n",fp); printf("\nWhat is your account login? "); gets(temp); fputs("#define ACCOUNTNAME \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* who to /msg when the bot sees netsplits. Put a dummy channel\n",fp); fputs("* or change the UMODES to -s if you dont want it reported [channel] */\n",fp); printf("\nWhat will be this bot's main channel? (ie. #bots) ? "); gets(temp2); strcpy(chan,temp2); fputs("#define REPORTS \"",fp); fputs(temp2,fp); fputs("\"\n",fp); fputs("/* send warnings when kicked or modes to that channel [channel|undef] */\n",fp); fputs("#undef WARNINGS\n",fp); fputs("/* autobans file [filename] */\n",fp); fputs("#define AUTOBAN \"autoban.file\"\n",fp); fputs("/* local users file. [filename] */\n",fp); fputs("#define LOCALFILE \"local.file\"\n",fp); fputs("/* working dir where the files must be [path] */\n",fp); printf("\nIn what path is the bot in (ie. /home/elfboy/mudbot) ? "); gets(temp); fputs("#define PATH \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* do we allow people with level 8 or more to kill? of course the\n",fp); fputs("* bot need to be opered for that */\n",fp); fputs("#undef ALLOW_KILL\n",fp); fputs("/* allow level 8 users to masskill? [define|undef] (EXPERIMENTAL) */\n",fp); fputs("#undef ALLOW_MASSKILL\n",fp); fputs("/* do we want to allow people to rehash, make the bot oper up, and\n",fp); fputs("* wallops? */\n",fp); printf("\nDo you want the bot to be oper'ed? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef OPER_CMDS\n",fp); if(temp[0]=='y') fputs("#define OPER_CMDS\n",fp); fputs("/* deop everyone that gets oped by everyone except the bot [define|undef] */\n",fp); printf("\nDo you want the bot in bitch mode? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef BITCH\n",fp); if(temp[0]=='y') fputs("#define BITCH\n",fp); fputs("/* allow level 10 to shutdown the bot [define|undef] */\n",fp); fputs("#define ALLOW_EXIT\n",fp); fputs("/* channels are public channels. You can use local with & [char]*/\n",fp); fputs("#define CHANCHAR \"#\"\n",fp); fputs("/* jump to default server on disconnect? [define|undef] */\n",fp); printf("\nMake the bot jump when it gets an error? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef JUMPONERROR\n",fp); if(temp[0]=='y') fputs("#define JUMPONERROR\n",fp); fputs("/* who is my master? Must be a nick [string] */\n",fp); printf("\nWho is the master of this bot? must be a nick (ie. Drow) ? "); fputs("#define MASTER \"",fp); gets(temp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* do I report commands from level 0 users to the master? [define|undef] */\n",fp); fputs("#undef SPY\n",fp); fputs("/* Undernet Cservice file [filename] */\n",fp); fputs("#define CSFILE \"undernet.file\"\n",fp); fputs("/* default servers names. there are 4 defines, dont add/rem some [string]*/\n",fp); printf("\nDefault server #1 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERA \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); printf("\nDefault server #2 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERB \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); printf("\nDefault server #3 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERC \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); printf("\nDefault server #4 (ie. okc.ok.us.undernet.org) ? "); gets(temp); fputs("#define SERVERD \"",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("okc.ok.us.undernet.org",fp); fputs("\"\n",fp); fputs("/* default port [int]*/\n",fp); printf("\nWhat port do I use? (ie. 6667) "); gets(temp); fputs("#define DEFAULTPORT ",fp); if(cas_cmp(temp,"")) fputs(temp,fp); else fputs("6667",fp); fputs("\n",fp); fputs("/* password for the server if you need one [string|undef]*/\n",fp); fputs("#undef PASS\n",fp); fputs("/* news file [filename] */\n",fp); fputs("#define NEWSFILE \"news.file\"\n",fp); printf("\nWhat nick do you want for the bot (ie. MudBot) ? "); gets(temp); fputs("/* bot nick [string] */\n",fp); fputs("#define BOTNAME \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* bot second nick [string] */\n",fp); printf("\nWhat second nick do you want for the bot (ie. Mud) ? "); gets(temp); fputs("#define BOTSECNAME \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* bot real name [string] */\n",fp); printf("\nWhat RealName do you want for the bot (ie. The Best!) ? "); gets(temp); fputs("#define BOTDESC \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* your URL or the bot's URL or whatever... [string|undef]*/\n",fp); fputs("#define URL \"http://mudbot.darkelf.net\"\n",fp); fputs("/* what to play on connect. must be in raw IRC [filename]*/\n",fp); fputs("#define STARTSCRIPT \"script.file\"\n",fp); fputs("/* users file [filename] */\n",fp); fputs("#define USERFILE \"user.file\"\n",fp); fputs("/* where do we log [filename|undef] */\n",fp); fputs("#undef LOGFILE_MSG\n",fp); fputs("#define LOGFILE_CMD \"mudbot-cmd.log\"\n",fp); fputs("#undef LOGFILE_PUB\n",fp); fputs("/* where to report errors [filename|undef] */\n",fp); printf("\nDo you want it to log errors? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef LOGERRORS\n",fp); if(temp[0]=='y') fputs("#define LOGERRORS \"errors.log\"\n",fp); fputs("/* where to put the silence list [filename] */\n",fp); fputs("#define SILENCEFILE \"silence.file\"\n",fp); fputs("/* fix mem leaks problems [define|undef] */\n",fp); fputs("#define MEMLEAK\n",fp); fputs("/* allow users 0 (anyone) to use channel specific commands [define|undef]*/\n",fp); printf("\nAllow users 0 (anyone) to use channel specific commands? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef BAR\n",fp); if(temp[0]=='y') fputs("#define BAR\n",fp); fputs("/* path of the html dir.. FILE IN THAT DIR WILL BE DELETED [path] */\n",fp); printf("\nWhat html path do you want for the bot? FILE IN THAT DIR WILL BE DELETED (ie. /home/urlogin/public_html/mudbot) "); gets(temp); fputs("#define HTMLDIR \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* Use as NickServ? must also define allowkill and opercmds [define|undef] */\n",fp); printf("\nDo you want to use the bot as NickServ? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef NICKSERV\n",fp); if(temp[0]=='y') fputs("#define NICKSERV\n",fp); fputs("/* make the help command for nickserv only? [define|undef] */\n",fp); fputs("#undef USE_AS_NICKSERV_ONLY\n",fp); fputs("/* view kill/glines/etc. made for ircu may have bugs on dal/ircd [chan|undef]*/\n",fp); printf("\nEnable OPERVIEW? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef OPERVIEW\n",fp); if(temp[0]=='y') { fputs("#define OPERVIEW \"",fp); fputs(temp2,fp); fputs("\"\n",fp); } fputs("/* Show the GLINE's reason [define|undef] */\n",fp); fputs("#undef OPERVIEW_G_REASON\n",fp); fputs("/* do we report even kills? (OPERVIEW must be defined) [define|undef] */\n",fp); fputs("#undef VIEWKILLS\n",fp); fputs("/* view kills reasons? (VIEWKILLS must be defined) [define|undef] */\n",fp); fputs("#undef KILLS_REASONS\n",fp); fputs("/* to see tru the bot's eyes what's going on online [undef|define]\n",fp); fputs("* You can also use MudBot as your IRC client if you undef background and\n",fp); fputs("* define this */\n",fp); fputs("#undef VIEW\n",fp); fputs("/* define this if you want to allow level 9 users to use shell commands */\n",fp); printf("\nAllow level 9 users to use the EXEC command? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef ALLOW_EXEC\n",fp); if(temp[0]=='y') fputs("#define ALLOW_EXEC\n",fp); fputs("/* use alias.file aliases? [define|undef]*/\n",fp); fputs("#define USE_ALIASES\n",fp); fputs("/* Allow mult aliases for a single word? [define|undef]*/\n",fp); fputs("#define MULT_ALIASES\n",fp); fputs("/* Kick on '-oooooo' ? [define|undef] */\n",fp); printf("\nKick on '-oooooo' ? [y/n] "); gets(temp); if(temp[0]=='n') fputs("#undef MASSDEOP\n",fp); if(temp[0]=='y') fputs("#define MASSDEOP\n",fp); fputs("/* Use this MudBot as FTP manager to manage this server' annonymous FTP\n",fp); fputs("* server? You usualy need root to hands you management of it.[define|undef]*/\n",fp); fputs("#undef FTPMGR\n",fp); fputs("/* FTP root where to put the server's files in (you need root to chown it\n",fp); fputs("* to your account) [path] */\n",fp); fputs("#define FTPROOT \"/home/ftp\"\n",fp); fputs("/* Use validate passwords? [define|undef] */\n",fp); printf("\nUse validation and passwords? [y/n] "); gets(temp); if(temp[0]=='n') { fputs("#undef USE_VALIDATE\n",fp); m=0; } if(temp[0]=='y') { fputs("#define USE_VALIDATE\n",fp); m=1; } fputs("/* Debug option. LOGERRORS must be defined for this. [define|undef]*/\n",fp); fputs("#undef LOG_ERRNO\n",fp); fputs("/* Allows you to share user files. Be carefull with that [def|undef]*/\n",fp); fputs("#undef SHARE_USERFILE\n",fp); fputs("/* Use interactive Web interface [define|undef] (EXPERIMENTAL)*/\n",fp); fputs("#undef INTER_WEB\n",fp); fputs("/* CGI-BIN URL [url] */\n",fp); fputs("#define CGI_BIN \"/cgi-bin\"\n",fp); fputs("/* Use crypt passwords [define|undef] (EXPERIMENTAL) */\n",fp); printf("\nUse crypt passwords? [y/n] "); gets(temp); if(temp[0]=='n') { fputs("#undef USE_CRYPT_PASSWD\n",fp); t=0; } if(temp[0]=='y') { fputs("#define USE_CRYPT_PASSWD\n",fp); t=1; } printf("\n!kb's kick message? (ie. Bye...) "); gets(temp); fputs("/* !kb's kick message [msg] */\n",fp); fputs("#define KB_MSG \"",fp); fputs(temp,fp); fputs("\"\n",fp); fputs("/* report commands in REPORTS channel [define|undef] */\n",fp); fputs("#undef REPORT_COMMANDS\n",fp); fputs("/* Stop trying after how many failed connects [int] */\n",fp); fputs("#define MAX_CONNECT_COUNT 30\n",fp); fputs("/* Most commands wont work if set. Usefull to use with 1 specific mudscript only [define|undef]*/\n",fp); fputs("#undef QUIET\n",fp); fputs("/* Bind to an IP [undef|ip] */\n",fp); fputs("#undef VIRTUAL\n",fp); fputs("/* Flood protection level [0,1,2,3] */\n",fp); fputs("#define FLOOD_PROTECT 1\n",fp); fputs("\n",fp); fputs("/* BINDS\n",fp); fputs(" * Use these binds to make the bot do commands on specific actions.\n",fp); fputs(" * Like if you wanted it to msg anyone who join a channel the bot's in:\n",fp); fputs(" * #define BIND_JOIN \"privmsg $nick :Welcome to my $channel $nick !\"\n",fp); fputs(" * $nick, $channel, %0, %1.. %6 are reconized by the bot.\n",fp); fputs("*/\n",fp); fputs("#define USE_BINDS\n",fp); fputs("#undef BIND_MODE\n",fp); fputs("#undef BIND_JOIN\n",fp); fputs("#undef BIND_PART\n",fp); fputs("#undef BIND_PRIVMSG\n",fp); fputs("#undef BIND_NOTICE\n",fp); fputs("/* Service server.. Allows level 8 users to do special commands [def|undef]*/\n",fp); fputs("#undef SERVICE\n",fp); fputs("/* Server will link to... [server name] */\n",fp); fputs("#define SERVICE_UPLINK \"irc.dummy.net\"\n",fp); fputs("/* The service server will have name... [server name] */\n",fp); fputs("#define SERVICE_SERVER_NAME \"services.dummy.net\"\n",fp); fputs("/* Port to link to... [port] */\n",fp); fputs("#define SERVICE_PORT 6667\n",fp); fputs("/* Server password to send [pass] */\n",fp); fputs("#define SERVICE_PASS \"password\"\n",fp); fputs("/* Service server description [string] */\n",fp); fputs("#define SERVICE_DESC \"This is MudBot's Service Server\"\n",fp); fputs("/* Allows masked glines [define|undef]*/\n",fp); fputs("#undef MASKED_GLINES\n",fp); fputs("/* Gline time [time in secs] */\n",fp); fputs("#define GLINE_TIME 3600\n",fp); fputs("/* Use bot's help as OperServ's help*/\n",fp); fputs("#undef USE_AS_OPERSERV_ONLY\n",fp); fputs("/* Shows everything the server received to the screen. Debug tool [def|undef]*/\n",fp); fputs("#undef SERVICE_TERMINAL\n",fp); fputs("/* Channel Service. Allows users to register channels [define|undef]\n",fp); fputs(" * Read the README.chanserv for more info */\n",fp); fputs("#undef CHANSERV\n",fp); fputs("/* Server will link to... [server name] */\n",fp); fputs("#define CHANSERV_UPLINK \"irc.dummy.net\"\n",fp); fputs("/* The server will have name... [server name] */\n",fp); fputs("#define CHANSERV_SERVER_NAME \"channels.dummy.net\"\n",fp); fputs("/* Port to link to... [port] */\n",fp); fputs("#define CHANSERV_PORT 6667\n",fp); fputs("/* Server password to send [pass] */\n",fp); fputs("#define CHANSERV_PASS \"password\"\n",fp); fputs("/* Service server description [string] */\n",fp); fputs("#define CHANSERV_DESC \"This is MudBot's Service Server\"\n",fp); fputs("/* Shows everything the server received to the screen. Debug tool [def|undef]*/\n",fp); fputs("#undef CHANSERV_TERMINAL\n",fp); printf("\nConfig should be ok. Now you can 'make clean' and 'make'. Check the config.h for more options.\n"); fclose(fp); fp=fopen("user.file","w"); printf("\nLet's configure the user file.\nWhat nick do you want (ie. Drow) ?\n"); strcpy(temp2,"10:"); gets(temp); strcat(temp2,temp); strcat(temp2,":"); printf("\nWhat mask user@host do you want (ie. *el@*.darkelf.net) ?\n"); gets(temp); strcat(temp2,temp); strcat(temp2,":"); printf("\nWhat password (8 chars or less) do you want to use (ie. lalala) ?\n"); gets(temp); if(t==1) strcat(temp2,do_cryptit(temp)); if(t==0) strcat(temp2,temp); if(m==1) strcat(temp2,":0:0:"); if(m==0) strcat(temp2,":1:0:"); printf("\nWhat email do you want to use (ie. drow@wildstar.net) ?\n"); gets(temp); printf("\n\nPlease read the README file and edit the channels file.\n"); strcat(temp2,temp); strcat(temp2,":\n"); fputs(temp2,fp); fclose(fp); exit(0); } int cas_cmp(char *case1,char *case2) { return (strcasecmp(case1,case2,strlen(case1))); }