new toybox command ASCII

This commit is contained in:
joonicks
2018-03-26 01:52:24 +02:00
parent bb8893c188
commit c44d8598c6
7 changed files with 51 additions and 28 deletions

29
README
View File

@@ -93,7 +93,7 @@ support when running ./configure from the compiling section above.
Updated Files? Updated Files?
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
The main distro-site for the EnergyMech is: The main distribution site for the EnergyMech is:
https://github.com/MadCamel/energymech 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 THIS SOFTWARE IS PROVIDED AS IS. YOU ARE ENTIRELY ON YOUR OWN WHEN
IT COMES TO CONFIGURING AND USING IT. IT COMES TO CONFIGURING AND USING IT.

View File

@@ -1,5 +1,7 @@
3.0.99p4 -- WORK IN PROGRESS (~March, 2018) 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 * Fixed: Crash bug in BIGSAY
* Added: Signal handlers for SIGILL and SIGABRT ifdef DEBUG * Added: Signal handlers for SIGILL and SIGABRT ifdef DEBUG
* Added: New command: CRASH, for debugging/development... * Added: New command: CRASH, for debugging/development...

1
ascii/README Normal file
View File

@@ -0,0 +1 @@
Directory for ascii files for use with the ASCII command.

18
ascii/mech Normal file
View File

@@ -0,0 +1,18 @@
,-----------------------------------------------------------------.
| ,-----; ,------, ,-----; ,-------, ,----, , ,-. |
| / ,---' | ,. \ / ,---' | ,--, \ / ,-. \ /| | \ |
| | |___ | | \ \ | |___ | |__| ;| | `~' / | | | |
| | ,--' | | | || ,--' | |--; < | | ,--./ `-' | |
| | |__,-,| | | || |__,-,| | | || | \ |\___. | |
| | || | | || || | | || `~' | \ | |
| | || | | / | || | | / | | | | |
| `~~~~~`\/ `---' `/ `~~~~~`\/ `---' `/ `/~~~~~~' |,--' |
| ,---, ,---, ,-----; ,----. ,-. ,--. |
| | \ / | / ,---' / ,--' / | | | |
| | \/ || |___ | | | |__| | |
| | |\ /| || ,--' | | | ,--. | |
| | | \/ | || |__,-,| | /|| | | | |
| | | | || || `--' || | | | |
| | | | || || || | | / |
| `---' `---'`~~~~~`\/ `\___/~~~'`---' `/ |
`-----------------------------------------------------------------'

View File

@@ -158,6 +158,7 @@ struct
{ 0, "PICKUP", "do_random_msg", 50 | CCPW , RANDPICKUPFILE }, { 0, "PICKUP", "do_random_msg", 50 | CCPW , RANDPICKUPFILE },
{ 0, "RSAY", "do_random_msg", 50 | CCPW , RANDSAYFILE }, { 0, "RSAY", "do_random_msg", 50 | CCPW , RANDSAYFILE },
{ 0, "RT", "do_randtopic", 50 | CCPW | CAXS | ACCHAN }, { 0, "RT", "do_randtopic", 50 | CCPW | CAXS | ACCHAN },
{ 0, "ASCII", "do_ascii", 50 | CCPW | CAXS | CARGS },
#endif /* TOYBOX */ #endif /* TOYBOX */
#ifdef TRIVIA #ifdef TRIVIA
{ 0, "TRIVIA", "do_trivia", 50 | CCPW | CAXS | CARGS | CBANG }, { 0, "TRIVIA", "do_trivia", 50 | CCPW | CAXS | CARGS | CBANG },

View File

@@ -210,6 +210,9 @@ LS int SockOpts(void) __page(CORE_SEG);
/* tcl.c */ /* tcl.c */
/* telnet.c */ /* telnet.c */
/* toybox.c */ /* toybox.c */
LS void do_ascii(COMMAND_ARGS) __page(CMD1_SEG);
/* trivia.c */ /* trivia.c */
/* uptime.c */ /* uptime.c */
/* urlcap.c */ /* urlcap.c */

View File

@@ -344,4 +344,29 @@ void do_8ball(COMMAND_ARGS)
to_user_q(from,FMT_PLAIN,message); 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 */ #endif /* TOYBOX */