Advertisement
T3RRYT3RR0R

Batch Trainable Chat Bot

Mar 26th, 2020
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.89 KB | None | 0 0
  1. @echo off & setlocal DisableDelayedExpansion
  2. Set "/Ex=^!"
  3.  
  4.  
  5. Setlocal EnableDelayedExpansion
  6.  
  7. If Exist "Bot.bat" Call :main
  8.  
  9. Echo(@echo off^&Setlocal EnableDelayedExpansion>Bot.bat
  10. Echo(Set /A RandAnswer=(%%Random%% * 3 / 32768 + 1^)>>Bot.bat
  11. Echo(Call :%%~1 2^>Nul>>Bot.bat
  12. Echo(If Errorlevel 1 Echo.You're not making much sense.>>Bot.bat
  13. Echo(Exit /B>>Bot.bat
  14.  
  15. :Training
  16. For /L %%A in (1,1,1000)do (
  17.     Set "Question="
  18.     Set /P "Question=Question:"
  19.     If /I "!Question!"=="End" Exit
  20.     Echo(:!Question!>>Bot.bat
  21.     For /L %%B in (1,1,3)do (
  22.         Set /P "Answer[%%B]=Answer[%%B]:"
  23.         Echo(Set "Answer[%%B]=!Answer[%%B]!">>Bot.bat
  24.     )
  25.     Echo(Set "Answer=%/Ex%Answer[%%RandAnswer%%]%/Ex%">>Bot.bat
  26.     Echo(Echo."%/Ex%Answer%/Ex%">>Bot.bat
  27.     Echo(Exit /B>>Bot.bat
  28. )
  29.  
  30. :main
  31. Set /P "Question=Question:"
  32. If /I "!Question!"=="Train" Goto :Training
  33. Call "Bot.bat" "!Question!"
  34. Set "Question="
  35. Goto :main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement