diff --git a/README b/README index eb9bd44..94c00a7 100644 --- a/README +++ b/README @@ -93,7 +93,7 @@ support when running ./configure from the compiling section above. Updated Files? ~~~~~~~~~~~~~~ -The main distro-site for the EnergyMech is: +The main distribution site for the EnergyMech is: https://github.com/MadCamel/energymech @@ -103,33 +103,6 @@ Files, documentation and tips can be found at: ---*--- -More Help? -~~~~~~~~~~ - -Read the website for goodness sake! Thats what its there for! - - #emech is not a help channel - -If you HAVE to ask a question in #emech then make damn sure that -its not covered by the website documentation and try to ask it in -a way so that we dont have to type half a book just to tell you -the answer. - -Do NOT ask to be guided in #emech. We will under no circumstances -help you compile, configure or run a bot. - -We absolutely hate people who come into the channel asking utterly -simple questions like `Why doesnt my bot connect', `Whats the -command to add a user', etc. If you manage to stay in the channel -after asking something like that its simply because we're too damn -lazy to kickban your ass. - -We will NOT teach you how to work with UNIX shells or how to use -your mech, you have to learn that by yourself. Im noting this here -since it seems to be a common misconception that we would. - -In short: - THIS SOFTWARE IS PROVIDED AS IS. YOU ARE ENTIRELY ON YOUR OWN WHEN IT COMES TO CONFIGURING AND USING IT. diff --git a/VERSIONS b/VERSIONS index 1ba2bab..bd5a03b 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,5 +1,7 @@ 3.0.99p4 -- WORK IN PROGRESS (~March, 2018) + * Added: New toybox command: ASCII, load an ascii file and line + buffer it to target * Fixed: Crash bug in BIGSAY * Added: Signal handlers for SIGILL and SIGABRT ifdef DEBUG * Added: New command: CRASH, for debugging/development... diff --git a/ascii/README b/ascii/README new file mode 100644 index 0000000..d4b3940 --- /dev/null +++ b/ascii/README @@ -0,0 +1 @@ +Directory for ascii files for use with the ASCII command. diff --git a/ascii/mech b/ascii/mech new file mode 100644 index 0000000..3aedfa4 --- /dev/null +++ b/ascii/mech @@ -0,0 +1,18 @@ +,-----------------------------------------------------------------. +| ,-----; ,------, ,-----; ,-------, ,----, , ,-. | +| / ,---' | ,. \ / ,---' | ,--, \ / ,-. \ /| | \ | +| | |___ | | \ \ | |___ | |__| ;| | `~' / | | | | +| | ,--' | | | || ,--' | |--; < | | ,--./ `-' | | +| | |__,-,| | | || |__,-,| | | || | \ |\___. | | +| | || | | || || | | || `~' | \ | | +| | || | | / | || | | / | | | | | +| `~~~~~`\/ `---' `/ `~~~~~`\/ `---' `/ `/~~~~~~' |,--' | +| ,---, ,---, ,-----; ,----. ,-. ,--. | +| | \ / | / ,---' / ,--' / | | | | +| | \/ || |___ | | | |__| | | +| | |\ /| || ,--' | | | ,--. | | +| | | \/ | || |__,-,| | /|| | | | | +| | | | || || `--' || | | | | +| | | | || || || | | / | +| `---' `---'`~~~~~`\/ `\___/~~~'`---' `/ | +`-----------------------------------------------------------------' diff --git a/src/gencmd.c b/src/gencmd.c index 01ca596..9714bf7 100644 --- a/src/gencmd.c +++ b/src/gencmd.c @@ -158,6 +158,7 @@ struct { 0, "PICKUP", "do_random_msg", 50 | CCPW , RANDPICKUPFILE }, { 0, "RSAY", "do_random_msg", 50 | CCPW , RANDSAYFILE }, { 0, "RT", "do_randtopic", 50 | CCPW | CAXS | ACCHAN }, + { 0, "ASCII", "do_ascii", 50 | CCPW | CAXS | CARGS }, #endif /* TOYBOX */ #ifdef TRIVIA { 0, "TRIVIA", "do_trivia", 50 | CCPW | CAXS | CARGS | CBANG }, diff --git a/src/h.h b/src/h.h index f6ae3e8..88bbc7d 100644 --- a/src/h.h +++ b/src/h.h @@ -210,6 +210,9 @@ LS int SockOpts(void) __page(CORE_SEG); /* tcl.c */ /* telnet.c */ /* toybox.c */ + +LS void do_ascii(COMMAND_ARGS) __page(CMD1_SEG); + /* trivia.c */ /* uptime.c */ /* urlcap.c */ diff --git a/src/toybox.c b/src/toybox.c index de6d5d5..809101c 100644 --- a/src/toybox.c +++ b/src/toybox.c @@ -344,4 +344,29 @@ void do_8ball(COMMAND_ARGS) to_user_q(from,FMT_PLAIN,message); } +char *ascii_from; + +int read_ascii(char *rest) +{ + to_user_q(ascii_from,FMT_PLAIN,rest); +} + +void do_ascii(COMMAND_ARGS) +{ + char fname[MSGLEN]; + int fd; + + Strcat(Strcpy(fname,"ascii/"),rest); +#ifdef DEBUG + debug("(do_ascii) file = \"%s\"\n",fname); +#endif + if (is_safepath(fname,FILE_MUST_EXIST) != FILE_IS_SAFE) + return; + if ((fd = open(fname,O_RDONLY)) < 0) + return; + + ascii_from = from; + readline(fd,&read_ascii); /* readline closes fd */ +} + #endif /* TOYBOX */