Skip to content

Commit

Permalink
chatloop
Browse files Browse the repository at this point in the history
  • Loading branch information
candlewill committed Apr 5, 2017
1 parent 34ce345 commit 8691882
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 80 deletions.
41 changes: 39 additions & 2 deletions Bot_tools/Usage/Dialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
#include "common.h"
#include "evserver.h"

// char sourceInput_1[200];

void ChatLoop() // local machine loop
{

char user[MAX_WORD_SIZE];
*ourMainInputBuffer = 0;
sourceFile = stdin;
// if (*sourceInput_1) sourceFile = FopenReadNormal(sourceInput_1);
// else
if (userInitFile) sourceFile = userInitFile;
if (!*loginID)
{
printf((char*)"%s", (char*)"\r\nEnter user name: ");
ReadALine(user, stdin);
printf((char*)"%s", (char*)"\r\n");
if (*user == '*') // let human go first - say "*bruce
{
memmove(user, user + 1, strlen(user));
printf((char*)"%s", (char*)"\r\nEnter starting input: ");
ReadALine(ourMainInputBuffer, stdin);
printf((char*)"%s", (char*)"\r\n");
}
}
else strcpy(user, loginID);
PerformChat(user, computerID, ourMainInputBuffer, NULL, ourMainOutputBuffer); // unknown bot, no input,no ip
printf("%s %s", "output: ", ourMainOutputBuffer);

retry:
ProcessInputFile();
sourceFile = stdin;
*ourMainInputBuffer = 0;
ourMainInputBuffer[1] = 0;
if (!quitting) goto retry;
}

int main(int argc, char * argv[])
{
for (int i = 1; i < argc; ++i)
Expand All @@ -9,7 +45,7 @@ int main(int argc, char * argv[])
{
chdir((char*)argv[i] + 5);
}
}
}

FILE* in = FopenStaticReadOnly((char*)"SRC/dictionarySystem.h"); // SRC/dictionarySystem.h
if (!in) // if we are not at top level, try going up a level
Expand All @@ -21,7 +57,8 @@ int main(int argc, char * argv[])
if (!server)
{
quitting = false; // allow local bots to continue regardless
MainLoop();
// MainLoop();
ChatLoop();
}
else if (quitting) { ; } // boot load requests quit
CloseSystem();
Expand Down
1 change: 1 addition & 0 deletions Bot_tools/Usage/LOGS/bugs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ BUG in facts.txt at 0: Error opening binary write file DICT/ENGLISH/facts.bin:
BUG in facts.txt at 0: Error opening binary write file DICT/ENGLISH/facts.bin: No such file or directory
BUG in facts.txt at 0: Error opening binary write file DICT/ENGLISH/facts.bin: No such file or directory
BUG in facts.txt at 0: Error opening binary write file DICT/ENGLISH/facts.bin: No such file or directory
BUG in facts.txt at 0: Error opening binary write file DICT/ENGLISH/facts.bin: No such file or directory
2 changes: 2 additions & 0 deletions Bot_tools/Usage/LOGS/log1024.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
in facts.txt at 0:
Error opening binary write file DICT/ENGLISH/facts.bin: No such file or directory
in facts.txt at 0:
Error opening binary write file DICT/ENGLISH/facts.bin: No such file or directory
in facts.txt at 0:

1 change: 1 addition & 0 deletions Bot_tools/Usage/LOGS/startlog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ System startup createsystem Fri Mar 31 14:21:47 2017
System startup createsystem Fri Mar 31 14:24:47 2017
System startup Test reset Fri Mar 31 14:24:53 2017
System startup createsystem Fri Mar 31 14:24:53 2017
System startup createsystem Wed Apr 05 11:52:06 2017
15 changes: 11 additions & 4 deletions Bot_tools/Usage/TMP/backup-user_test.bin
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
USERS/topic_user_test.txt
jul2116 Mar31'17-11:03:24 Mar31'17-14:35:19 1490941570-7.9.0 |
1 75 0 DY 0 10 10 0 # start, input#, no rejoinder, #0topics, #1topics, layer2
jul2116 Mar31'17-11:03:24 Apr05'17-11:52:11 1490941570-7.9.0 |
77 78 0 DY 0 10 10 0 # start, input#, no rejoinder, #0topics, #1topics, layer2
~welcome #pending
~welcome + 2 jLJgm iaga S 0 0
~welcome + 2 jLJgm iaga 31 0 0
#`end topics
$cs_trace=0
$cs_randindex=1228
$cs_bot=Test
$cs_login=user
$cs_token=132863
$cs_control_main=~control
$userprompt=user: >
$botprompt=Bot:
$cs_trace=0
#`end variables
0 #set flags
#`end fact sets
Expand All @@ -32,6 +32,9 @@ $botprompt=Bot:
我 不是
那 你 是猪 ?
为什么 骂 我
nihao
你好
#`end user
我竟然无言以对,人家还是个宝宝
不要欺负本宝宝了,人家还在长大
Expand All @@ -49,4 +52,8 @@ $botprompt=Bot:
那是谁?
喂什么吃什么。。
不要欺负本宝宝了,人家还在长大
你好
我竟然无言以对,人家还是个宝宝
Hello
#`end chatbot
4 changes: 4 additions & 0 deletions Bot_tools/Usage/USERS/log-user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,7 @@ Respond: user:user bot:test ip: (~welcome) 73 我 不是 ==> 那是谁? Wh
Respond: user:user bot:test ip: (~welcome) 74 那 你 是猪 ? ==> 操 When:Mar31'17-14:35:04 Why:~xiaohuangji.4858.0.~control.9.0 F:5
Respond: user:user bot:test ip: (~welcome) 75 为什么 骂 我 ==> 喂什么吃什么。。 When:Mar31'17-14:35:19 Why:~xiaohuangji.4671.0.~control.9.0 F:5
Respond: user:user bot:test ip: (~welcome) 76 靠 ==> 不要欺负本宝宝了,人家还在长大 When:Mar31'17-14:35:25 Why:~control.9.0 F:6
Start: user:user bot:test ip: rand:1305 (~welcome) 76 ==> 你好 When:Apr05'17-11:52:06 Version:7.3 Build0: Build1:Mar31'17-14:24:53 0:Mar31'17-11:03:24 F:1490941570-7.9.0 P:Mar31'17-14:35:25 Why:~welcome.1.0.~control.0.0
Respond: user:user bot:test ip: (~welcome) 77 nihao ==> 我竟然无言以对,人家还是个宝宝 When:Apr05'17-11:52:09 Why:~control.9.0 F:6
Respond: user:user bot:test ip: (~welcome) 78 你好 ==> Hello When:Apr05'17-11:52:11 Why:~welcome.6.0.~control.9.0 F:0
Respond: user:user bot:test ip: (~welcome) 79 :q ==> 我竟然无言以对,人家还是个宝宝 When:Apr05'17-11:52:13 Why:~control.9.0 F:5
15 changes: 11 additions & 4 deletions Bot_tools/Usage/USERS/topic_user_test.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
USERS/topic_user_test.txt
jul2116 Mar31'17-11:03:24 Mar31'17-14:35:25 1490941570-7.9.0 |
1 76 0 DY 0 10 10 0 # start, input#, no rejoinder, #0topics, #1topics, layer2
jul2116 Mar31'17-11:03:24 Apr05'17-11:52:13 1490941570-7.9.0 |
77 79 0 DY 0 10 10 0 # start, input#, no rejoinder, #0topics, #1topics, layer2
~welcome #pending
~welcome + 2 jLJgm iaga S 0 0
~welcome + 2 jLJgm iaga 31 0 0
#`end topics
$cs_trace=0
$botprompt=Bot:
$userprompt=user: >
$cs_control_main=~control
$cs_token=132863
$cs_login=user
$cs_bot=Test
$cs_randindex=1228
$cs_trace=0
#`end variables
0 #set flags
#`end fact sets
Expand All @@ -33,6 +33,9 @@ $cs_trace=0
那 你 是猪 ?
为什么 骂 我
nihao
你好
:q
#`end user
我竟然无言以对,人家还是个宝宝
不要欺负本宝宝了,人家还在长大
Expand All @@ -51,4 +54,8 @@ $cs_trace=0
喂什么吃什么。。
不要欺负本宝宝了,人家还在长大
你好
我竟然无言以对,人家还是个宝宝
Hello
我竟然无言以对,人家还是个宝宝
#`end chatbot
Binary file not shown.
70 changes: 0 additions & 70 deletions Bot_tools/Usage/build/CMakeFiles/Makefile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,81 +11,16 @@ set(CMAKE_MAKEFILE_DEPENDS
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
"CMakeFiles/3.7.2/CMakeSystem.cmake"
"CMakeFiles/feature_tests.c"
"CMakeFiles/feature_tests.cxx"
"/usr/local/share/cmake-3.7/Modules/CMakeCCompiler.cmake.in"
"/usr/local/share/cmake-3.7/Modules/CMakeCCompilerABI.c"
"/usr/local/share/cmake-3.7/Modules/CMakeCInformation.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeCXXCompiler.cmake.in"
"/usr/local/share/cmake-3.7/Modules/CMakeCXXCompilerABI.cpp"
"/usr/local/share/cmake-3.7/Modules/CMakeCXXInformation.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeCompilerIdDetection.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineCCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineCXXCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineCompileFeatures.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineCompilerABI.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineCompilerId.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeDetermineSystem.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeFindBinUtils.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeGenericSystem.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeLanguageInformation.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeParseArguments.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeParseImplicitLinkInfo.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeSystem.cmake.in"
"/usr/local/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeTestCompilerCommon.cmake"
"/usr/local/share/cmake-3.7/Modules/CMakeUnixFindMake.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/ADSP-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Borland-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Clang-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Cray-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GHS-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GNU-C-FeatureTests.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GNU-C.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GNU-CXX-FeatureTests.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GNU-CXX.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GNU-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/GNU.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/HP-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/HP-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/IAR-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Intel-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/MIPSpro-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/MSVC-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/PGI-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/PathScale-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/SCO-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/TI-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/Watcom-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/XL-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/XL-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake"
"/usr/local/share/cmake-3.7/Modules/Internal/FeatureTesting.cmake"
"/usr/local/share/cmake-3.7/Modules/Platform/Linux-Determine-CXX.cmake"
"/usr/local/share/cmake-3.7/Modules/Platform/Linux-GNU-C.cmake"
"/usr/local/share/cmake-3.7/Modules/Platform/Linux-GNU-CXX.cmake"
"/usr/local/share/cmake-3.7/Modules/Platform/Linux-GNU.cmake"
Expand All @@ -101,11 +36,6 @@ set(CMAKE_MAKEFILE_OUTPUTS

# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/3.7.2/CMakeSystem.cmake"
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
"CMakeFiles/CMakeDirectoryInformation.cmake"
)

Expand Down

0 comments on commit 8691882

Please sign in to comment.