// oracle_h - This function will handle everything that is needed // for the conversation with the oracle. // By Deva Bryson Winblood. 05/02/2005 /////////////////////////////////////////////////////////////////////// string fnOracleStrip(string sIn) { // PURPOSE: To strip inconsequentials and set it all to lower-case string sRet=""; int nPos=0; string sChar; while(nPos0) { // word remains nRet=fnOracleExpand(sParse); nCount=nCount+nRet; SetLocalInt(oMe,"nNumWords",nCount); } // word remains } // fnOracleParse() int fnOracleNumWords() { // PURPOSE:return number of words return GetLocalInt(OBJECT_SELF,"nNumWords"); } // fnOracleNumWords() string fnOracleWord(int nWordNum) { // PURPOSE: To return specific word return GetLocalString(OBJECT_SELF,"sWord"+IntToString(nWordNum)); } // fnOracleWord() void fnOracleProfanity() { // PURPOSE: To handle responses to any statement or question // that contains profanity } // fnOracleProfanity() string fnGetPID(object oPC) { // PURPOSE: Return the player ID return GetPCPlayerName(oPC)+GetPCPublicCDKey(oPC)+GetName(oPC); } // fnGetPID() void fnOracleYou() { // PURPOSE: To handle reactions to statements that begin with // the word you } // fnOracleYou() void fnOracleGreetings() { // PURPOSE: To handle response to what appear to be greetings // statements } // fnOracleGreetings() void fnOracleWhat() { // PURPOSE: To handle responses to questions beginning with what } // fnOracleWhat() void fnOracleWhy() { // PURPOSE: To handle responses to questions beginning with why } // fnOracleWhy() void fnOracleHow() { // PURPOSE: To handle responses to question beginning with how } // fnOracleHow() void fnOracleWho() { // PURPOSE: To handle responses to questions beginning with who } // fnOracleWho() void fnOracleWhen() { // PURPOSE: To handle responses to questions beginning with when } // fnOracleWhen() void fnOracleWhere() { // PURPOSE: To handle responses to questions beginning with where } // fnOracleWhere() void fnOracleI() { // PURPOSE: To handle responses to statements beginning with I } // fnOracleI void fnOracleMy() { // PURPOSE: To handle responses to statements beginning with my } // fnOracleMy() void fnOracleWe() { // PURPOSE: To handle responses to statements beginning with we } // fnOracleWe() void fnOracleWill() { // PURPOSE: To handle responses to questions beginning with will } // fnOracleWill() void fnOracleTell() { // PURPOSE: To handle responses to questions beginning with tell } // fnOracleTell() void fnOracleActions() { // PURPOSE: To handle responding to any statements telling the // oracle to do something that is plainly not possible } // fnOracleActions() void fnOracleDo() { // PURPOSE: To handle responses to questions beginning with do } // fnOracleDo() void fnOracleConfusion() { // PURPOSE: To handle things the oracle does not understand } // fnOracleConfusion() void fnOracle(string sStatements) { // PURPOSE: The main oracle function object oMe=OBJECT_SELF; string sWord; int nCount; AssignCommand(oMe,fnOracleParse(sStatements)); nCount=fnOracleNumWords(); sWord=fnOracleWord(1); if (sWord=="go"||sWord=="walk"||sWord=="jump"||sWord=="open") fnOracleActions(); else if (sWord=="you") fnOracleYou(); else if (sWord=="i") fnOracleI(); else if (sWord=="we") fnOracleWe(); else if (sWord=="what") fnOracleWhat(); else if (sWord=="where") fnOracleWhere(); else if (sWord=="why") fnOracleWhy(); else if (sWord=="when") fnOracleWhen(); else if (sWord=="tell") fnOracleTell(); else if (sWord=="will") fnOracleWill(); else if (sWord=="hello"||sWord=="hi"||sWord=="greetings") fnOracleGreetings(); else if (sWord=="how") fnOracleHow(); else if (sWord=="my") fnOracleMy(); else if (sWord=="do") fnOracleDo(); else if (sWord=="eat"||sWord=="talk"||sWord=="shout"||sWord=="run"||sWord=="climb") fnOracleActions(); else if (sWord=="swim"||sWord=="fart"||sWord=="scream") fnOracleActions(); else if (sWord=="fuck"||sWord=="shit"||sWord=="damn"||sWord=="bitch"||sWord=="ass"||sWord=="asshole") fnOracleProfanity(); else if (sWord=="pussy"||sWord=="shithead"||sWord=="cunt") fnOracleProfanity(); else { fnOracleConfusion(); } } // fnOracle() //void main(){}