alien_fx_fiend

Basic ChatBot

Jun 25th, 2020
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class frmChat
  2.  
  3.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  4.         Randomize()
  5.         Dim rndNum As Integer
  6.         rndNum = Int(Rnd() * 3) + 1
  7.         Dim input As String
  8.         input = txtInput.Text
  9.         If input.Contains("family") Then
  10.             txtBot.AppendText("tell me more about your family" & vbNewLine)
  11.         ElseIf input.Contains("I am") Then
  12.             If rndNum = 1 Then
  13.                 txtBot.AppendText("that is interesting" & vbNewLine)
  14.             ElseIf rndNum = 2 Then
  15.                 txtBot.AppendText("cool" & vbNewLine)
  16.             ElseIf rndNum = 3 Then
  17.                 txtBot.AppendText("great" & vbNewLine)
  18.             End If
  19.         End If
  20.     End Sub
  21. End Class
Add Comment
Please, Sign In to add comment