Skip to content

Commit

Permalink
Merge branch 'develop' into feature/python
Browse files Browse the repository at this point in the history
  • Loading branch information
vanosg authored Dec 10, 2023
2 parents 1dcb147 + f9a6087 commit 9de66e0
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 45 deletions.
22 changes: 11 additions & 11 deletions doc/man1/eggdrop.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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".
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx_source/tutorials/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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!
3 changes: 2 additions & 1 deletion doc/sphinx_source/using/tcl-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3427,7 +3427,7 @@ The following is a list of bind types and how they work. Below each bind type is

bind evnt <flags> <type> <proc>

procname <type>
procname <type> [arg]

Description: triggered whenever one of these events happen. flags are ignored. Pre-defined events triggered by Eggdrop are::

Expand All @@ -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.

Expand Down
1 change: 0 additions & 1 deletion language/core.french.lang
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# core.french.lang
# core language messages for eggdrop


# General stuff
0x001,Utilisation
0x002,A �chou�.\n
Expand Down
21 changes: 10 additions & 11 deletions language/core.german.lang
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# core.english.lang
# core.german.lang
# core language messages for eggdrop
#
# Original by C_Olli [email protected] (Bei Verbesserungsvorschlaegen
# bitte email an mich)
# Modified by Michael for 1.3.25.
# Written by C_Olli [email protected]
# Modified by Michael for 1.3.25
# Modified by rtc for 1.4.0

# General stuff
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down
28 changes: 24 additions & 4 deletions src/botcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" */
Expand Down
2 changes: 1 addition & 1 deletion src/mod/assoc.mod/language/assoc.portuguese.lang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# assoc.pt.lang
# assoc.portuguese.lang
# mensagens em português para o módulo assoc

0xb000,Sem nomes de canais
Expand Down
2 changes: 1 addition & 1 deletion src/mod/filesys.mod/language/filesys.german.lang
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
1 change: 1 addition & 0 deletions src/mod/irc.mod/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions src/mod/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
11 changes: 7 additions & 4 deletions src/mod/server.mod/servmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 0 additions & 1 deletion src/mod/transfer.mod/language/transfer.portuguese.lang
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# transfer.portuguese.lang
# portuguese language messages for transfer module

Expand Down
3 changes: 2 additions & 1 deletion src/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
26 changes: 25 additions & 1 deletion src/tclhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tclhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down
8 changes: 6 additions & 2 deletions src/tclmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading

0 comments on commit 9de66e0

Please sign in to comment.