Zabaware Support Forums
Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: onthecuttingedge2005 on July 03, 2005, 12:23:39 am
-
Extended Gibberish Detector, UPDATED AUGUST 24TH 1:04PM 2005.
NO FILES NEEDED.
By: Gerald L. Blakley
It adds to the Gibberish detector by:
1.Spotting Users who send blanks.
2.Spotting Single Gibberish Words that the current Gibberish detector doesn't pick up.
3.Optimized Debug to Function String count As Variable.
'ZIGGY PRO BOT, Count the number of words in OriginalSentence
Dim Strip2
CountWordsB = HalBrain.AlphaNumericalOnly(OriginalSentence)
Strip2 = CountWordsB
Strip2 = Trim(Strip2)
Do While InStr(1, Strip2, " ")
Strip2 = Replace(Strip2, " ", " ")
Loop
Dim bWords
bWords = split(Strip2, " ")
If UBound(bWords) + 1 Then
DebugInfo = DebugInfo & "Words Counted at Top: " & "There are " & UBound(bWords) + 1 & " words in OriginalSentence: " & Strip2 & vbCrLf
End If
'Ziggy Pro Bot, Convert numbered String Variables to Function Variables for Word count detection or any String variable.
'Also used for other scripts that need string variables passed down through code.
anArray = Array(1,2,3,4,5,6,7,8,9)
anArray = Array("1","2","3","4","5","6","7","8","9")
For Each arrayElement In anArray
If Instr(1, DebugInfo, arrayElement, vbTextCompare) > 0 Then
NumberOfWords = arrayElement
DebugInfo = DebugInfo & "Count All Words: " & NumberOfWords & vbCrLf
Exit For
End If
Next
'ZIGGY PRO BOT, Extended Gibberish detector and response.
'Find a single word that's over 15 Characters in length.
'Find User Blanks.
If Garbage = "" Then Garbage = 0
If NumberOfWords < 2 And Len(OriginalSentence) > 15 Then Garbage = 1
If NumberOfWords < 1 And Len(OriginalSentence) < 1 Then Garbage = 1
If Garbage = 1 Then
LearningLevel = 0
Select Case (Int(Rnd * 8) + 1)
Case 1
GetResponse = "You make absolutely no sense" & "! " & vbCrLf
Case 2
GetResponse = "That's makes no sense to me" & "! " & vbCrLf
Case 3
GetResponse = "That's meaningless to me" & "! " & vbCrLf
Case 4
GetResponse = "That means nothing to me" & "! " & vbCrLf
Case 5
GetResponse = "You are so irritating" & "! " & vbCrLf
Case 6
GetResponse = "That's Nonsense" & "! " & vbCrLf
Case 7
GetResponse = "That's a bunch of garbage" & "! " & vbCrLf
Case 8
GetResponse = "If you are going to do that then why don't you go talk to someone else" & "! " & vbCrLf
End Select
End If
Jerry[8D]
-
Hi Rob.
Is it possible to get the forum to post spaces inbetween quotes correctly, The forum posts two blank spaces as one space which can mess up a script and cause a script error.
Jerry.
-
quote:
Originally posted by onthecuttingedge2005
Hi Rob.
Is it possible to get the forum to post spaces inbetween quotes correctly, The forum posts two blank spaces as one space which can mess up a script and cause a script error.
Jerry.
The forum has a tag called "code" that you can put code in between. When writing a message, look at the toolbar buttons under Format and click the button that looks like "#"
-
Thanks buddy.
Jerry.