mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-29 16:14:43 +00:00
new toybox command ASCII
This commit is contained in:
29
README
29
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.
|
||||
|
||||
|
||||
2
VERSIONS
2
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...
|
||||
|
||||
1
ascii/README
Normal file
1
ascii/README
Normal file
@@ -0,0 +1 @@
|
||||
Directory for ascii files for use with the ASCII command.
|
||||
18
ascii/mech
Normal file
18
ascii/mech
Normal file
@@ -0,0 +1,18 @@
|
||||
,-----------------------------------------------------------------.
|
||||
| ,-----; ,------, ,-----; ,-------, ,----, , ,-. |
|
||||
| / ,---' | ,. \ / ,---' | ,--, \ / ,-. \ /| | \ |
|
||||
| | |___ | | \ \ | |___ | |__| ;| | `~' / | | | |
|
||||
| | ,--' | | | || ,--' | |--; < | | ,--./ `-' | |
|
||||
| | |__,-,| | | || |__,-,| | | || | \ |\___. | |
|
||||
| | || | | || || | | || `~' | \ | |
|
||||
| | || | | / | || | | / | | | | |
|
||||
| `~~~~~`\/ `---' `/ `~~~~~`\/ `---' `/ `/~~~~~~' |,--' |
|
||||
| ,---, ,---, ,-----; ,----. ,-. ,--. |
|
||||
| | \ / | / ,---' / ,--' / | | | |
|
||||
| | \/ || |___ | | | |__| | |
|
||||
| | |\ /| || ,--' | | | ,--. | |
|
||||
| | | \/ | || |__,-,| | /|| | | | |
|
||||
| | | | || || `--' || | | | |
|
||||
| | | | || || || | | / |
|
||||
| `---' `---'`~~~~~`\/ `\___/~~~'`---' `/ |
|
||||
`-----------------------------------------------------------------'
|
||||
@@ -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 },
|
||||
|
||||
3
src/h.h
3
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 */
|
||||
|
||||
25
src/toybox.c
25
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 */
|
||||
|
||||
Reference in New Issue
Block a user