diff --git a/doc/man1/eggdrop.1 b/doc/man1/eggdrop.1 index bab49069f..a9fe4406f 100644 --- a/doc/man1/eggdrop.1 +++ b/doc/man1/eggdrop.1 @@ -20,12 +20,12 @@ .\" distribute this file as part of a program that contains a .\" configuration script generated by Autoconf, you may include it under .\" the same distribution terms that you use for the rest of that program. -.\" .\" Originally by Robey Pointer, redone by rtc .\" * 1999-11-08 rtc A line wasn't displayed .\" * 2000-10-07 Fabian Updated and slightly re-organized. .\" * 2004-08-08 Wcc Updated. -.TH eggdrop 1 "August 2004" "Eggheads Development Team" "IRC Tools" +.\" * 2023-03-11 mortmann Typos and fixse +.TH eggdrop 1 "March 2023" "Eggheads Development Team" "IRC Tools" .SH NAME eggdrop \- an IRC bot .SH SYNOPSIS @@ -34,9 +34,9 @@ eggdrop \- an IRC bot .RB [ config-file ] .SH DESCRIPTION .B Eggdrop -is the World's most popular Internet Relay Chat (IRC) bot; it is freely +is the world's most popular Internet Relay Chat (IRC) bot; it is freely distributable under the GNU General Public License (GPL). Eggdrop -is a feature rich program designed to be easily used and expanded upon by both +is a feature-rich program designed to be easily used and expanded upon by both novice and advanced IRC users on a variety of hardware and software platforms. .PP An IRC bot is a program that sits on an IRC channel and performs automated @@ -73,11 +73,11 @@ things while the bot is running. With \-n, you won't return to the shell prompt until the bot exits (which won't normally happen until it's killed). By default, \-n will send all log entries to the console. .TP -.B \-nt +.B \-t Don't background, use terminal. This is just like \-n, except that instead of seeing log entries, your console will simulate a DCC chat with the bot. .TP -.B \-nc +.B \-c Don't background, show channel info. This is just like \-n, except that instead of seeing log entries, every 10 seconds your screen will clear and you will see the current channel status, sort of like "top". @@ -88,7 +88,7 @@ one and give owner status to the first person that introduces himself or herself to it. You'll need to do this when you first set up your bot. .TP .B \-v -Show version info, then quit. +Show version info and exit. .SH SIGNALS .TP .B SIGCHLD @@ -109,9 +109,9 @@ registering with the EVNT bind and returning 1. .SH "ENVIRONMENT VARIABLES" .TP .B EGG_LANG -This variable can be set to the language in which you want Eggdrop to speak - to you. It defaults to English, but German, French, Finnish, and Danish -are supported, too. +This variable can be set to the language in which you want Eggdrop to speak to +you. It defaults to English, but Danish, Finnish, French, German, Italian and +Portuguese are supported, too. .TP .B EGG_LANGDIR Specifies the directory where all your language files are stored. @@ -138,7 +138,7 @@ of Eggdrop. .SH "REPORTING BUGS" See \fBdoc/BUG-REPORT\fR. .PP -Bugs can either be reported directly via GitHub at +Bugs can be reported directly via GitHub at \fBhttps://github.com/eggheads/eggdrop/issues\fR. .SH COPYRIGHT Copyright (C) 1997 Robey Pointer diff --git a/doc/sphinx_source/tutorials/setup.rst b/doc/sphinx_source/tutorials/setup.rst index f5ef4e162..dac600327 100644 --- a/doc/sphinx_source/tutorials/setup.rst +++ b/doc/sphinx_source/tutorials/setup.rst @@ -159,6 +159,6 @@ No show? If your bot didn't appear on IRC, you should log in to the shell and view the bot's logfile (the default in the config file is "logs/eggdrop.log"). Note that logfile entries are not written to disk immediately unless quick-logs is enabled, so you may have to wait a few minutes before the logfile appears, or contains messages that indicate why your bot isn't showing up. -Additionally, you can kill the bot via the command line (``kill pid``, the pid is shown to you when you started the bot or can be viewed by running ``ps x``) and then restart it with the -mnt flag, which will launch you directly into the partyline, to assist with troubleshooting. Note that if you use the -nt flag, the bot will not persist and you will kill it once you quit the partyline. +Additionally, you can kill the bot via the command line (``kill pid``, the pid is shown to you when you started the bot or can be viewed by running ``ps x``) and then restart it with the -mnt flag, which will launch you directly into the partyline, to assist with troubleshooting. Note that if you use the -t flag, the bot will not persist and you will kill it once you quit the partyline. If you're still unsure what the problem is, try asking in #eggdrop on Libera, and be sure to include any relevant information from the logfile. Good luck! diff --git a/doc/sphinx_source/using/tcl-commands.rst b/doc/sphinx_source/using/tcl-commands.rst index f6e46a9da..f4997834a 100644 --- a/doc/sphinx_source/using/tcl-commands.rst +++ b/doc/sphinx_source/using/tcl-commands.rst @@ -3427,7 +3427,7 @@ The following is a list of bind types and how they work. Below each bind type is bind evnt - procname + procname [arg] Description: triggered whenever one of these events happen. flags are ignored. Pre-defined events triggered by Eggdrop are:: @@ -3448,6 +3448,7 @@ The following is a list of bind types and how they work. Below each bind type is disconnect-server - called when we disconnect from our IRC server fail-server - called when an IRC server fails to respond hidden-host - called after the bot's host is hidden by the server + got-chanlist - called after Eggdrop receives the channel userlist from the server. Passes a second [arg] value to the Tcl proc Note that Tcl scripts can trigger arbitrary events, including ones that are not pre-defined or used by Eggdrop. diff --git a/language/core.french.lang b/language/core.french.lang index a9e33eca9..607408beb 100644 --- a/language/core.french.lang +++ b/language/core.french.lang @@ -1,7 +1,6 @@ # core.french.lang # core language messages for eggdrop - # General stuff 0x001,Utilisation 0x002,A échoué.\n diff --git a/language/core.german.lang b/language/core.german.lang index bc2698c39..f33e80462 100644 --- a/language/core.german.lang +++ b/language/core.german.lang @@ -1,9 +1,8 @@ -# core.english.lang +# core.german.lang # core language messages for eggdrop # -# Original by C_Olli oliver.vogel@gmx.net (Bei Verbesserungsvorschlaegen -# bitte email an mich) -# Modified by Michael for 1.3.25. +# Written by C_Olli oliver.vogel@gmx.net +# Modified by Michael for 1.3.25 # Modified by rtc for 1.4.0 # General stuff @@ -66,7 +65,7 @@ die mitgelieferte Konfigurationsdatei.\n 0x407,Beschaedigter Benutzerdatensatz 0x408,Doppelter Benutzerdatensatz 0x409,Passwort konnte nicht zurueckgesetzt werden fuer -0x40a,Ignorierte Banns fuer den/die channel(s): +0x40a,Ignorierte Banns fuer den/die Channel(s): 0x40b,Schreibe Benutzerdatei... 0x40c,FEHLER beim Schreiben der Benutzerdatei. 0x40d,FEHLER beim Schreiben der Benutzerdatei, die zur Uebertragung vorgesehen war. @@ -98,7 +97,7 @@ die mitgelieferte Konfigurationsdatei.\n 0x50e,Wechsle Logdateien... 0x512,untaetig 0x513,ABWESEND -# Ueberarbeiten, brauche kontext: +# Ueberarbeiten, brauche Kontext: 0x516,Verbindung getrennt 0x517,ungueltiger Bot 0x518,Schleife entdeckt: zwei Bots mit Namen @@ -162,7 +161,7 @@ Baue eine Telnetverbindung zu dem Bot auf und gib 'NEW' als Deinen Nickname ein. 0x611,Bekanntschaft gemacht mit %s von %s 0x612,Du hast ein Passwort. 0x613,Du hast kein Passwort. -0x615,Du hast bereits ein Passwort eingestellt. +0x615,Du hast bereits ein Passwort gesetzt. 0x616,Bitte benutze mindestens 6 Zeichen. 0x617,Passwort gesetzt auf: 0x618,Falsches Passwort. @@ -213,7 +212,7 @@ Baue eine Telnetverbindung zu dem Bot auf und gib 'NEW' als Deinen Nickname ein. 0x648,Server-Queue ist bei 0x649,Hilfe-Queue ist bei 0x64a,Der Vhost, der in der Konfig eingestellt ist, kann nicht benutzt werden um zu dieser IP-Adresse zu verbinden -0x64b,Der Vhost, der in der Konfig eingestellt ist, ist auf diesem Computer nicht verfügbar +0x64b,Der Vhost, der in der Konfig eingestellt ist, ist auf diesem Computer nicht verfuegbar 0x64c,Bearbeite Channel 0x64d,Channel #need context @@ -222,11 +221,11 @@ Baue eine Telnetverbindung zu dem Bot auf und gib 'NEW' als Deinen Nickname ein. # verspaetet? 0x650,verspaetetes +o -- Lahme Verbindung 0x651,verspaetetes -o -- Lahme Verbindung -0x652,verspaeteter kick +0x652,verspaeteter Kick #need context 0x653,VOM SERVER ERTEILER SCHEIN-CHANOP 0x654,Ende der Channel Informationen. -0x655,Massen-kick, ab in die Ecke +0x655,Massen-Kick, ab in die Ecke 0x656,Entfernter Bann 0x657,Hmm, Mode-Information von einem Channel auf dem ich nicht bin 0x658,...und danke, dass Du mitgespielt hast. @@ -235,7 +234,7 @@ Baue eine Telnetverbindung zu dem Bot auf und gib 'NEW' als Deinen Nickname ein. 0x65b,Bin auf zu vielen Channels -- kann %s nicht betreten 0x65c,Channel ueberfuellt -- kann %s nicht betreten 0x65d,Channel nur auf Einladung -- kann %s nicht betreten -0x65e,Vom channel verbannt -- kann %s nicht betreten +0x65e,Vom Channel verbannt -- kann %s nicht betreten 0x65f,Server meint, ich sei nicht auf dem Channel: %s 0x660,Falscher Schluessel -- kann %s nicht betreten 0x661,NOTICE %s :Alle Befehle erfolgen via /MSG. Fuer eine vollstaendige Liste, /MSG %s help CU!\n diff --git a/src/botcmd.c b/src/botcmd.c index 6f2418fde..e4fb59713 100644 --- a/src/botcmd.c +++ b/src/botcmd.c @@ -668,14 +668,24 @@ static void bot_nlinked(int idx, char *par) dcc[idx].nick); simple_sprintf(s, "%s %s (%s)", MISC_DISCONNECTED, dcc[idx].nick, MISC_INVALIDBOT); - dprintf(idx, "error invalid eggnet protocol for 'nlinked'\n"); +#ifndef NO_OLD_BOTNET + if (b_numver(idx) < NEAT_BOTNET) + dprintf(idx, "error invalid eggnet protocol for 'nlinked'\n"); + else +#endif + dprintf(idx, "e invalid eggnet protocol for 'nlinked'\n"); } else if ((in_chain(newbot)) || (!strcasecmp(newbot, botnetnick))) { /* Loop! */ putlog(LOG_BOTS, "*", "%s %s (mutual: %s)", BOT_LOOPDETECT, dcc[idx].nick, newbot); simple_sprintf(s, "%s %s: disconnecting %s", MISC_LOOP, newbot, dcc[idx].nick); - dprintf(idx, "error Loop (%s)\n", newbot); +#ifndef NO_OLD_BOTNET + if (b_numver(idx) < NEAT_BOTNET) + dprintf(idx, "error Loop (%s)\n", newbot); + else +#endif + dprintf(idx, "e Loop (%s)\n", newbot); } if (!s[0]) { for (p = newbot; *p; p++) @@ -690,14 +700,24 @@ static void bot_nlinked(int idx, char *par) next, newbot); simple_sprintf(s, "%s: %s %s", BOT_BOGUSLINK, dcc[idx].nick, MISC_DISCONNECTED); - dprintf(idx, "error %s (%s -> %s)\n", BOT_BOGUSLINK, next, newbot); +#ifndef NO_OLD_BOTNET + if (b_numver(idx) < NEAT_BOTNET) + dprintf(idx, "error %s (%s -> %s)\n", BOT_BOGUSLINK, next, newbot); + else +#endif + dprintf(idx, "e %s (%s -> %s)\n", BOT_BOGUSLINK, next, newbot); } if (bot_flags(dcc[idx].user) & BOT_LEAF) { putlog(LOG_BOTS, "*", "%s %s (%s %s)", BOT_DISCONNLEAF, dcc[idx].nick, newbot, BOT_LINKEDTO); simple_sprintf(s, "%s %s (to %s): %s", BOT_ILLEGALLINK, dcc[idx].nick, newbot, MISC_DISCONNECTED); - dprintf(idx, "error %s\n", BOT_YOUREALEAF); +#ifndef NO_OLD_BOTNET + if (b_numver(idx) < NEAT_BOTNET) + dprintf(idx, "error %s\n", BOT_YOUREALEAF); + else +#endif + dprintf(idx, "e %s\n", BOT_YOUREALEAF); } if (s[0]) { putlog(LOG_BOTS, "*", "%s.", s); diff --git a/src/main.h b/src/main.h index f346d5cdf..75faf4625 100644 --- a/src/main.h +++ b/src/main.h @@ -122,7 +122,7 @@ extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW, # define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */ #endif /* BORGCUBES */ -/* Handle for the user that's used when starting eggdrop with -tn */ +/* Handle for the user that's used when starting eggdrop with -t */ #define EGG_BG_HANDLE "-HQ" /* Default recommended flags for this user, use | as splitter */ #define EGG_BG_CONMASK LOG_MISC /* "o" */ diff --git a/src/mod/assoc.mod/language/assoc.portuguese.lang b/src/mod/assoc.mod/language/assoc.portuguese.lang index 5878ecee3..d629dfa56 100644 --- a/src/mod/assoc.mod/language/assoc.portuguese.lang +++ b/src/mod/assoc.mod/language/assoc.portuguese.lang @@ -1,4 +1,4 @@ -# assoc.pt.lang +# assoc.portuguese.lang # mensagens em português para o módulo assoc 0xb000,Sem nomes de canais diff --git a/src/mod/filesys.mod/language/filesys.german.lang b/src/mod/filesys.mod/language/filesys.german.lang index b58f733fe..cb95bcdb2 100644 --- a/src/mod/filesys.mod/language/filesys.german.lang +++ b/src/mod/filesys.mod/language/filesys.german.lang @@ -1,7 +1,7 @@ # filesys.german.lang # language messages for filesys module # -# german translation by rtc +# Written by rtc 0x300,Konvertiere Dateisystem-Abbild in %s ... 0x301,filedb-update: kann Verzeichnis nicht oeffnen! diff --git a/src/mod/irc.mod/chan.c b/src/mod/irc.mod/chan.c index 036eb06e6..94807f6e8 100644 --- a/src/mod/irc.mod/chan.c +++ b/src/mod/irc.mod/chan.c @@ -1289,6 +1289,7 @@ static int got315(char *from, char *msg) sync_members(chan); chan->status |= CHAN_ACTIVE; chan->status &= ~CHAN_PEND; + check_tcl_event_arg("got-chanlist", chname); if (!ismember(chan, botname)) { /* Am I on the channel now? */ putlog(LOG_MISC | LOG_JOIN, chan->dname, "Oops, I'm not really on %s.", chan->dname); diff --git a/src/mod/module.h b/src/mod/module.h index a1ce7c9b5..9b674577b 100644 --- a/src/mod/module.h +++ b/src/mod/module.h @@ -527,9 +527,11 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr #define USERENTRY_ACCOUNT (*(struct user_entry_type *)(global[316])) #define get_user_by_account ((struct userrec * (*)(char *))global[317]) #define delaccount_by_handle ((int(*)(char *,char *))global[318]) -#define bind_bind_entry ((int(*)(tcl_bind_list_t *, const char *, const char *, const char *))global[319]) +#define check_tcl_event_arg ((void (*) (const char *,const char *))global[319]) /* 320 - 323 */ -#define unbind_bind_entry ((int(*)(tcl_bind_list_t *, const char *, const char *, const char *))global[320]) +#define bind_bind_entry ((int(*)(tcl_bind_list_t *, const char *, const char *, const char *))global[320]) +#define unbind_bind_entry ((int(*)(tcl_bind_list_t *, const char *, const char *, const char *))global[321]) + /* hostmasking */ diff --git a/src/mod/server.mod/servmsg.c b/src/mod/server.mod/servmsg.c index 2fdcf6df6..956fdaf4c 100644 --- a/src/mod/server.mod/servmsg.c +++ b/src/mod/server.mod/servmsg.c @@ -1523,21 +1523,24 @@ static int gotauthenticate(char *from, char *msg) return 0; } -/* Got 900: RPL_SASLLOGGEDIN, user account name is set */ +/* Got 900: RPL_LOGGEDIN, users account name is set (whether by SASL or otherwise) */ static int got900(char *from, char *msg) { newsplit(&msg); /* nick */ newsplit(&msg); /* nick!ident@host */ newsplit(&msg); /* account */ fixcolon(msg); - putlog(LOG_SERV, "*", "SASL: %s", msg); + putlog(LOG_SERV, "*", "%s: %s", from, msg); return 0; } -/* Got 901: RPL_LOGGEDOUT, user account is logged out */ +/* Got 901: RPL_LOGGEDOUT, users account name is unset (whether by SASL or otherwise) */ static int got901(char *from, char *msg) { - putlog(LOG_SERV, "*", "SASL: Account has been logged out"); + newsplit(&msg); /* nick */ + newsplit(&msg); /* nick!ident@host */ + fixcolon(msg); + putlog(LOG_SERV, "*", "%s: %s", from, msg); return 0; } diff --git a/src/mod/transfer.mod/language/transfer.portuguese.lang b/src/mod/transfer.mod/language/transfer.portuguese.lang index 57be6cb7b..7d914407b 100644 --- a/src/mod/transfer.mod/language/transfer.portuguese.lang +++ b/src/mod/transfer.mod/language/transfer.portuguese.lang @@ -1,4 +1,3 @@ - # transfer.portuguese.lang # portuguese language messages for transfer module diff --git a/src/modules.c b/src/modules.c index 194f97eb5..5fe8b0543 100644 --- a/src/modules.c +++ b/src/modules.c @@ -626,8 +626,9 @@ Function global_table[] = { (Function) & USERENTRY_ACCOUNT, /* struct user_entry_type * */ (Function) get_user_by_account, (Function) delhost_by_handle, - (Function) bind_bind_entry, + (Function) check_tcl_event_arg, /* 320 - 323 */ + (Function) bind_bind_entry, (Function) unbind_bind_entry }; diff --git a/src/tclhash.c b/src/tclhash.c index e34e47011..ab9e78e0b 100644 --- a/src/tclhash.c +++ b/src/tclhash.c @@ -51,6 +51,7 @@ static int builtin_cron STDVAR; static int builtin_char STDVAR; static int builtin_chpt STDVAR; static int builtin_chjn STDVAR; +static int builtin_evnt STDVAR; static int builtin_idxchar STDVAR; static int builtin_charidx STDVAR; static int builtin_chat STDVAR; @@ -235,7 +236,7 @@ void init_bind(void) H_bcst = add_bind_table("bcst", HT_STACKABLE, builtin_chat); H_away = add_bind_table("away", HT_STACKABLE, builtin_chat); H_act = add_bind_table("act", HT_STACKABLE, builtin_chat); - H_event = add_bind_table("evnt", HT_STACKABLE, builtin_char); + H_event = add_bind_table("evnt", HT_STACKABLE, builtin_evnt); H_die = add_bind_table("die", HT_STACKABLE, builtin_char); H_log = add_bind_table("log", HT_STACKABLE, builtin_log); #ifdef TLS @@ -593,6 +594,21 @@ static int builtin_chjn STDVAR return TCL_OK; } +static int builtin_evnt STDVAR +{ + Function F = (Function) cd; + + BADARGS(2, 3, " event ?arg?"); + + CHECKVALIDITY(builtin_evnt); + if (argc==2) { + F(argv[1]); + } else { + F(argv[1], argv[2]); + } + return TCL_OK; +} + static int builtin_idxchar STDVAR { Function F = (Function) cd; @@ -1212,6 +1228,14 @@ void check_tcl_event(const char *event) MATCH_EXACT | BIND_STACKABLE); } +void check_tcl_event_arg(const char *event, const char *arg) +{ + Tcl_SetVar(interp, "_event1", (char *) event, TCL_GLOBAL_ONLY); + Tcl_SetVar(interp, "_event2", (char *) arg, TCL_GLOBAL_ONLY); + check_tcl_bind(H_event, event, 0, " $::_event1 $::_event2", + MATCH_EXACT | BIND_STACKABLE); +} + int check_tcl_signal(const char *event) { int x; diff --git a/src/tclhash.h b/src/tclhash.h index 2d13e8959..c7ebb50b3 100644 --- a/src/tclhash.h +++ b/src/tclhash.h @@ -100,6 +100,7 @@ void check_tcl_nkch(const char *, const char *); void check_tcl_away(const char *, int, const char *); void check_tcl_chatactbcst(const char *, int, const char *, tcl_bind_list_t *); void check_tcl_event(const char *); +void check_tcl_event_arg(const char *, const char *); int check_tcl_signal(const char *); void check_tcl_die(char *); void check_tcl_log(int, char *, char *); diff --git a/src/tclmisc.c b/src/tclmisc.c index c6d15804c..cfa6d5420 100644 --- a/src/tclmisc.c +++ b/src/tclmisc.c @@ -646,9 +646,13 @@ static int tcl_reloadhelp STDVAR static int tcl_callevent STDVAR { - BADARGS(2, 2, " event"); + BADARGS(2, 3, " event ?arg?"); - check_tcl_event(argv[1]); + if (argc == 2) { + check_tcl_event(argv[1]); + } else { + check_tcl_event_arg(argv[1], argv[2]); + } return TCL_OK; } diff --git a/src/userrec.c b/src/userrec.c index 6ebd58153..4fd8eaef3 100644 --- a/src/userrec.c +++ b/src/userrec.c @@ -591,7 +591,7 @@ void write_userfile(int idx) strlcpy(s1, ctime(&tt), sizeof s1); fprintf(f, "#4v: %s -- %s -- written %s", ver, botnetnick, s1); ok = 1; - /* Add all users except the -tn user */ + /* Add all users except the -t user */ for (u = userlist; u && ok; u = u->next) if (strcasecmp(u->handle, EGG_BG_HANDLE) && !write_user(u, f, idx)) ok = 0; @@ -622,7 +622,7 @@ int change_handle(struct userrec *u, char *newh) if (!u) return 0; - /* Don't allow the -tn handle to be changed */ + /* Don't allow the -t handle to be changed */ if (!strcasecmp(u->handle, EGG_BG_HANDLE)) return 0; /* Nothing that will confuse the userfile */