/* get-ons.c * GloveNet Client.. GloveGet Version 2.0 * 2/1/92 * By David Barberi * Bot shell by Peyote Coyote * */ /*=====[ ons.c ]============================================================= This would be the only file for end users to confiure.. Has all the on_* functions that the parser recognizes. ============================================================================*/ #include "powerglove.h" #include "all-bot.h" #include #include #include static char buf[MAXLEN]; extern int writeln(); char *counter; char char_gesture[20], char_key[20]; /*=====[ on_join ]=========================================================== "who" has joined channel "channel" - do whatever ===========================================================================*/ void get_on_join(who, channel) char *who; char *channel; { #ifdef DBUG printf("On_join: who = %s, channel = %s\n", who, channel); #endif sprintf(buf, "PRIVMSG %s START GLOVE\n", channel); writeln(buf); #ifdef DBUG printf("Exiting on_join\n"); #endif } /*=====[ on_msg ]============================================================ A message was sent from "from" to "to", the text is in "msg" ===========================================================================*/ void get_on_msg(from, to, msg) char *from; char *to; char *msg; { char *replyto; char *you="you"; int count; char *glove; char *colon; char *gesture; char *key; char *com; #ifdef DBUG printf("Entering On_msg: from = %s, to = %s, msg = %s\n", from, to, msg); #endif if(strcasestr(msg, "JOIN")) { #ifdef DBUG printf("in JOIN, msg = %s\n", msg); #endif strtok(msg, " "); com = strtok(NULL, " "); sprintf(buf, "JOIN %s\n", com); writeln(buf); } if(strcasestr(msg, "NICK")) { #ifdef DBUG printf("in NICK, msg = %s\n", msg); #endif strtok(msg, " "); com = strtok(NULL, " "); sprintf(buf, "NICK %s\n", com); writeln(buf); } if(strcasestr(msg, "PART")) { strtok(msg, " "); com = strtok(NULL, " "); sprintf(buf, "PART %s\n", com); writeln(buf); } if(strcasestr(msg, "GLOVE")) { glove = strtok(msg, " "); counter = strtok(NULL, " "); colon = strtok(NULL, " "); pglove.x = atoi( strtok(NULL, " ") ); pglove.y = atoi( strtok(NULL, " ") ); pglove.z = atoi( strtok(NULL, " ") ); pglove.thumb = atoi( strtok(NULL, " ") ); pglove.one = atoi( strtok(NULL, " ") ); pglove.two = atoi( strtok(NULL, " ") ); pglove.three = atoi( strtok(NULL, " ") ); pglove.twist = atoi( strtok(NULL, " ") ); pglove.key = atoi( strtok(NULL, " ") ); intake( atoi(counter), pglove.x, pglove.y, pglove.z, pglove.thumb, pglove.one, pglove.two, pglove.three, pglove.twist, pglove.key, THEM); #ifdef DBUG printf("GET got: %s %s %s %i %i %i %i %i %i %i %i %i\n", glove, counter, colon, pglove.x, pglove.y, pglove.z, pglove.thumb, pglove.one, pglove.two, pglove.three, pglove.twist, pglove.key); #endif } #ifdef DBUG printf("Exiting on_msg\n"); #endif } int intake_from_get() { return( atoi(counter) ); } /**** End of get-ons.c *****/