Author: Mark
Date: Sat May 21 05:26:51 2005
New Revision: 2606
Added:
trunk/modules/textserv/waitress (contents, props changed)
Modified:
trunk/modules/textserv/help.c
trunk/modules/textserv/main.c
Log:
add restaurant style database to textserv
Modified: trunk/modules/textserv/help.c
==============================================================================
--- trunk/modules/textserv/help.c (original)
+++ trunk/modules/textserv/help.c Sat May 21 05:26:51 2005
@@ -34,12 +34,10 @@
const char ts_help_list_oneline[] ="List databases";
const char *ts_help_add[] = {
- "Syntax: \2ADD <database> <nick> <channel>\2",
+ "Syntax: \2ADD <database> <channel>\2",
"",
"Register a database with textserv.",
"<database> is the name of the database to load",
- "<nick> is the optional name of the bot you want to use. If not",
- "specified, the database name is used as the nick",
"<channel> is the optional channel you want the bot to join. If not",
"specified, the bot will not join a channel",
NULL
Modified: trunk/modules/textserv/main.c
==============================================================================
--- trunk/modules/textserv/main.c (original)
+++ trunk/modules/textserv/main.c Sat May 21 05:26:51 2005
@@ -21,6 +21,13 @@
** $Id$
*/
+/* TODO:
+ * - Help on individual commands
+ * - Database sanity checking
+ * - Parameter support
+ * - Multiple channel per bot support
+ */
+
#include "neostats.h"
#include "textserv.h"
@@ -576,12 +583,7 @@
return NS_SUCCESS;
}
os_fclose( fp );
- if( cmdparams->ac > 1 && ValidateNick( cmdparams->av[1] ) != NS_SUCCESS )
- {
- irc_prefmsg( ts_bot, cmdparams->source, "%s is an invalid nick", cmdparams->av[1] );
- return NS_SUCCESS;
- }
- if( cmdparams->ac > 2 && ValidateChannel( cmdparams->av[2] ) != NS_SUCCESS )
+ if( cmdparams->ac > 1 && ValidateChannel( cmdparams->av[1] ) != NS_SUCCESS )
{
irc_prefmsg( ts_bot, cmdparams->source, "%s is an invalid channel", cmdparams->av[2] );
return NS_SUCCESS;
@@ -589,11 +591,7 @@
db = ns_calloc( sizeof( dbbot ) );
strlcpy( db->database.name, cmdparams->av[0], MAXNICK );
if( cmdparams->ac > 1 )
- strlcpy( db->database.nick, cmdparams->av[1], MAXNICK );
- else
- strlcpy( db->database.nick, cmdparams->av[0], MAXNICK );
- if( cmdparams->ac > 2 )
- strlcpy( db->database.channel, cmdparams->av[2], MAXCHANLEN );
+ strlcpy( db->database.channel, cmdparams->av[1], MAXCHANLEN );
hnode_create_insert( tshash, db, db->database.name );
DBAStore( "databases", db->database.name,( void * )db, sizeof( dbentry ) );
BuildBot( db );
Added: trunk/modules/textserv/waitress
==============================================================================
--- (empty file)
+++ trunk/modules/textserv/waitress Sat May 21 05:26:51 2005
@@ -0,0 +1,16 @@
+VERSION|3.0.a3-dev
+ABOUT|Restaurant Service.
+CREDITS|Copyright (c) 1999-2005, NeoStats. http://www.neostats.net/
+BURGER|<TYPE>|Order a burger & fries|ACTION fixes up a %M burger and fries, and brings it to %F
+FRIES|<NONE>|Basket of our famous seasoned fries|ACTION fills a basket of our famous seasoned french fries, and brings it to %F's table
+PIZZA|<TYPE>|Hot pizza of your choice|ACTION bakes a %M pizza and brings it over to %F.
+BREAD|<TYPE>|Hot breadsticks of your choice|ACTION bakes some %M breadsticks and puts them in a basket. Then brings them over to %F.
+NACHOS|<NONE>|Big plate of nachos with melted cheese|ACTION prepares a heaping plate of nachos for %F, with melted cheese, beef, beans, sour cream and quacomole
+POTATO|<NONE>|Big plate of potato skins|ACTION brings out a large plate of potato skins and sour cream for %F, Careful its hot.
+WINGS|<TEMP>|Wings as spicy as you want|ACTION cooks a dozen wings %M and brings them over to %F!
+SALAD|<TYPE>|Fresh tossed salad|ACTION tosses a fresh %M salad for %F.
+BUYPIZZA|<NICK><PIZZA>|Buy someone a pizza|ACTION gives %T a %M pizza, Compliments of %F.
+DELIVER|<WHO><ITEMS>|Deliver items to someone|ACTION delivers %M to %T. Compliments of %F.
+TIP|<AMOUNT>|Give me a tip|ACTION takes the %M, 'Thanks %F!'", rest, nickfrom);
+PAY|<AMOUNT>|Pay your bill|ACTION accepts payment of %M from %F and rips up the bill, That about covers it!
+PIZZACHAN|<NONE>|Buy pizza for the entire channel|ACTION hands out pizza to the entire channel, Compliments of %F.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.