Author Topic: Q&A  (Read 23517 times)

onthecuttingedge2005

  • Guest
Re: Q&A
« Reply #30 on: October 27, 2012, 12:11:36 am »
of course.

deitz75

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Q&A
« Reply #31 on: October 27, 2012, 08:50:54 am »
Do you recommend any books base on this type of programming?

onthecuttingedge2005

  • Guest
Re: Q&A
« Reply #32 on: October 27, 2012, 11:33:13 am »

deitz75

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Q&A
« Reply #33 on: October 27, 2012, 04:05:14 pm »
How about a way to introduce new line of questioning for a different ladder logic. Such as issues with Networking, Video, Audio, and Drive failure. Sub questions for different issues?

onthecuttingedge2005

  • Guest
Re: Q&A
« Reply #34 on: October 27, 2012, 08:37:31 pm »
you mean something like this:

Code: [Select]

Rem Type=Plugin
Rem Name=Network Diagnostics
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
Rem Host=Assistant
'If you want this plug-in global then change Assistant to All, AIM Bot is not working anymore because of AOL Oscar servers so leave it on Assistant until it is resolved.

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "For use of adding network diagnostic explanations"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

 Rem PLUGIN: CUSTOMMEM2
    'The preceding comment is actually a plug-in directive for
    'the Ultra Hal host application. It allows for code snippets
    'to be inserted here on-the-fly based on user configuration.


'Diagnostics code by aka onthecuttingedge2005, Idea concept from aka deitz
    'of the Zabaware forum.
    'If a user asked about diagnosing a tech problem we can add or use this
    'chain of code to do so.
   
    If InStr(1, LCase(OriginalSentence), "my network is not working", 1) Or _
       InStr(1, LCase(OriginalSentence), "my internet is not working", 1) Or _
       InStr(1, LCase(OriginalSentence), "my ethernet is not working", 1) Or _
       InStr(1, LCase(OriginalSentence), "my network is not functioning", 1) Then NetDiagnostics = True
   
    'Here we can add accociated responses to the above triggers.
    If NetDiagnostics = True Then
                 GetResponse = "Open a web browser and try to view a website by typing in its IP address, for example http:// 17.254.0.91 (apple.com).  If the page loads then either DNS is indeed down or the machine’s DNS settings are incorrect. tell me whether it worked."
    End If
   
    If PrevSent = "Open a web browser and try to view a website by typing in its IP address, for example http:// 17.254.0.91 (apple.com).  If the page loads then either DNS is indeed down or the machine’s DNS settings are incorrect. tell me whether it worked." Then
             If Yes(OriginalSentence) = True Then GetResponse = "If the page did load but DNS settings are correct then the computer is not auto-switching to another DNS provider.  This can be done manually but moving another DNS IP address to the top of the list in the Network control panel settings." 
             If No(OriginalSentence) = True Then GetResponse = "If the page fails to load by IP address, open up a command prompt and try to ping any machine on the Internet.  If no host responds then either the connection for the computer is not live or again the settings maybe incorrect for the network card."
             If Maybe(OriginalSentence) = True Then GetResponse = "Please verify that your computer can not connect to an I.P address and restart the network diagnostics query."
    End If
   
    If InStr(1, PrevSent, "If the page fails to load by IP address, open up a command prompt and try to ping any machine on the Internet.  If no host responds then either the connection for the computer is not live or again the settings maybe incorrect for the network card. do you suspect that the connection is dead?", 1) Then
            If Yes(OriginalSentence) = True Then GetResponse = "If you suspect that the connection is dead, try to verify this by either checking that computer’s connection on a different functioning computer in the local area or if there is a hub in the room and the questionable computer is plugged into that hub, verify that the other stations connected to that hub are functioning on the network"
            If No(OriginalSentence) = True Then GetResponse = "Then check to see if your ethernet cord is functioning if it is then check to see if any router you are using is functioning correctly."
            If Maybe(OriginalSentence) = True Then GetResponse = "please check to see if the page loads and restart this network diagnostics query."
    End If
   
   
Rem PLUGIN: FUNCTIONS
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.

'Here we can use the Yes, No, Maybe functions throughout the entire diagnostics script
'to direct our questions and answers more efficiently.

'direct Yes affirmation
Function Yes(OriginalSentence)
Yes = False
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " yes ", 1) Then Yes = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " affirmative ", 1) Then Yes = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " yep ", 1) Then Yes = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " yup ", 1) Then Yes = True
End Function
'direct No affirmation
Function No(OriginalSentence)
No = False
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " no ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " nope ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " it is not ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " negative ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " it did not load ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " it didn't load ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", "does not work ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", "doesn't work ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " did not work ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " didn't work ", 1) Then No = True
End Function
'if the user is not certain about the question then assume they are not certain.
Function Maybe(OriginalSentence)
Maybe = False
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i don't know ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i don't believe so ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i don't think so ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i'm not sure ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i never checked ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i didn't check ", 1) Then Maybe = True
End Function


deitz75

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Q&A
« Reply #35 on: October 27, 2012, 11:52:54 pm »
Would it work within the original diagnostics.uhp?
Example, or idea
Code: [Select]
Rem Type=Plugin
Rem Name=Diagnostics
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
Rem Host=Assistant
'If you want this plug-in global then change Assistant to All, AIM Bot is not working anymore because of AOL Oscar servers so leave it on Assistant until it is resolved.

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "For use of adding diagnostic explanations"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

 Rem PLUGIN: CUSTOMMEM2
    'The preceding comment is actually a plug-in directive for
    'the Ultra Hal host application. It allows for code snippets
    'to be inserted here on-the-fly based on user configuration.


'Diagnostics code by aka onthecuttingedge2005, Idea concept from aka deitz
    'of the Zabaware forum.
    'If a user asked about diagnosing a tech problem we can add or use this
    'chain of code to do so.
   
    If InStr(1, OriginalSentence, "My computer will not power on", 1) Or _
   InStr(1, OriginalSentence, "My computer won't power on", 1) Or _
   InStr(1, OriginalSentence, "My computer has no power", 1) Or _
   InStr(1, OriginalSentence, "My computer is not turning on", 1) Or _
   InStr(1, OriginalSentence, "My computer isn't turning on", 1) Or _
   InStr(1, OriginalSentence, "My computer has no video", 1) Or _
   InStr(1, OriginalSentence, "I cannot see anything on my computer screen", 1) Or _
   InStr(1, OriginalSentence, "Computer turns on, but there is no video", 1) Or _
   InStr(1, OriginalSentence, "Computer turns on, but there isn't any video", 1) Or _
   InStr(1, OriginalSentence, "Computer turns on, but has no video", 1) Or _
   InStr(1, OriginalSentence, "No video, but the computer turns on", 1) Or _
   InStr(1, OriginalSentence, "No video from the computer", 1) Or _
   InStr(1, OriginalSentence, "No video from my computer", 1) Then Diagnostics = True
   
    'Here we can add accociated responses to the above triggers.
    If Diagnostics = True Then
                 GetResponse = "I can assist you with most hardware issue relating to computers. Please answer yes or no to my questions, and I can determine a prognosis for you. Do you wish to continue?"
    End If
                       
    If InStr(1, PrevSent, "I can assist you with most hardware issue relating to computers. Please answer yes or no to my questions, and I can determine a prognosis for you. Do you wish to continue?", 1) Then
            If Yes(OriginalSentence) = True Then GetResponse = "Verify that your computer is plugged in. Does the computer power on at all? Keep in mind beeps, sounds, lights or LED's are an indication of power." 
            If No(OriginalSentence) = True Then GetResponse = "Ok, good luck! If you get stuck? Ask the primary question to restart the diagnostics query."
            If Maybe(OriginalSentence) = True Then GetResponse = "You must need help, if you don't know weither or not you need it. Ask the primary question to restart the diagnostics query."
    End If
   
    If InStr(1, PrevSent, "Verify that your computer is plugged in. Does the computer power on at all? Keep in mind beeps, sounds, lights or LED's are an indication of power.", 1) Then
             If Yes(OriginalSentence) = True Then GetResponse = "Does a boot screen appear on the display?" 
             If No(OriginalSentence) = True Then GetResponse = "Is the outlet that the computer is plugged into working properly?"
             If Maybe(OriginalSentence) = True Then GetResponse = "Please be sure the computer is plugged into the proper outlet. The primary question may be asked again to restart the diagnostics query. I need definitive answers in order to deliver a proper prognosis"
    End If
   
    If InStr(1, PrevSent, "Does a boot screen appear on the display?", 1) Then
            If Yes(OriginalSentence) = True Then GetResponse = "Does the computer boot up a second or third time?"
            If No(OriginalSentence) = True Then GetResponse = "Is there anything on the screen?"
            If Maybe(OriginalSentence) = True Then GetResponse =  "Please verify the display. The primary question may be asked again to restart the diagnostics query. I need definitive answers in order to deliver a proper prognosis"
    End If
           
    If InStr(1, PrevSent, "Does the computer boot up a second or third time?", 1) Then
            If Yes(OriginalSentence) = True Then GetResponse = "Possible Power OK signal failure. Unplug the computer for 30 seconds to clear error from power supply. If problem persists replace power supply to correct error." 
            If No(OriginalSentence) = True Then GetResponse = "Does the computer make any Beeping sounds?."
            If Maybe(OriginalSentence) = True Then GetResponse = "Test the outlet you are using with a multi meter. The primary question may be asked again to restart the diagnostics query. I need definitive answers in order to deliver a proper prognosis"
    End If

    If InStr(1, PrevSent, "Does the computer make any Beeping sounds?", 1) Then
            If Yes(OriginalSentence) = True Then GetResponse = "Motherboard Failure Currently under construction. I can no longer assist you. Have a nice day!" 
            If No(OriginalSentence) = True Then GetResponse = "Is there any new hardware installed?"
            If Maybe(OriginalSentence) = True Then GetResponse = "Are you hard of hearing? Get someone to assist you, and ask the primary question to restart the diagnostics query. I need definitive answers in order to deliver a proper prognosis."
    End If

    If InStr(1, LCase(OriginalSentence), "my network is not working", 1) Or _
       InStr(1, LCase(OriginalSentence), "my internet is not working", 1) Or _
       InStr(1, LCase(OriginalSentence), "my ethernet is not working", 1) Or _
       InStr(1, LCase(OriginalSentence), "my network is not functioning", 1) Then NetDiagnostics = True
   
    'Here we can add accociated responses to the above triggers.
    If NetDiagnostics = True Then
                 GetResponse = "Open a web browser and try to view a website by typing in its IP address, for example http:// 17.254.0.91 (apple.com).  If the page loads then either DNS is indeed down or the machine’s DNS settings are incorrect. tell me whether it worked."
    End If
   
    If PrevSent = "Open a web browser and try to view a website by typing in its IP address, for example http:// 17.254.0.91 (apple.com).  If the page loads then either DNS is indeed down or the machine’s DNS settings are incorrect. tell me whether it worked." Then
             If Yes(OriginalSentence) = True Then GetResponse = "If the page did load but DNS settings are correct then the computer is not auto-switching to another DNS provider.  This can be done manually but moving another DNS IP address to the top of the list in the Network control panel settings." 
             If No(OriginalSentence) = True Then GetResponse = "If the page fails to load by IP address, open up a command prompt and try to ping any machine on the Internet.  If no host responds then either the connection for the computer is not live or again the settings maybe incorrect for the network card."
             If Maybe(OriginalSentence) = True Then GetResponse = "Please verify that your computer can not connect to an I.P address and restart the network diagnostics query."
    End If
   
    If InStr(1, PrevSent, "If the page fails to load by IP address, open up a command prompt and try to ping any machine on the Internet.  If no host responds then either the connection for the computer is not live or again the settings maybe incorrect for the network card. do you suspect that the connection is dead?", 1) Then
            If Yes(OriginalSentence) = True Then GetResponse = "If you suspect that the connection is dead, try to verify this by either checking that computer’s connection on a different functioning computer in the local area or if there is a hub in the room and the questionable computer is plugged into that hub, verify that the other stations connected to that hub are functioning on the network"
            If No(OriginalSentence) = True Then GetResponse = "Then check to see if your ethernet cord is functioning if it is then check to see if any router you are using is functioning correctly."
            If Maybe(OriginalSentence) = True Then GetResponse = "please check to see if the page loads and restart this network diagnostics query."
    End If
   
   
Rem PLUGIN: FUNCTIONS
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.

'Here we can use the Yes, No, Maybe functions throughout the entire diagnostics script
'to direct our questions and answers more efficiently.

'direct Yes affirmation
Function Yes(OriginalSentence)
Yes = False
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " yes ", 1) Then Yes = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " affirmative ", 1) Then Yes = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " yep ", 1) Then Yes = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " yup ", 1) Then Yes = True
End Function
'direct No affirmation
Function No(OriginalSentence)
No = False
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " no ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " nope ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " it is not ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " negative ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " it did not load ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " it didn't load ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", "does not work ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", "doesn't work ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " did not work ", 1) Then No = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " didn't work ", 1) Then No = True
End Function
'if the user is not certain about the question then assume they are not certain.
Function Maybe(OriginalSentence)
Maybe = False
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i don't know ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i don't believe so ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i don't think so ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i'm not sure ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i never checked ", 1) Then Maybe = True
If InStr(1, " " & Lcase(HalBrain.AlphaNumericalOnly(OriginalSentence)) & " ", " i didn't check ", 1) Then Maybe = True
End Function


onthecuttingedge2005

  • Guest
Re: Q&A
« Reply #36 on: October 28, 2012, 12:24:46 am »
sure if you wanna mix them, I don't see why not. as long as they don't conflict with another.

deitz75

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Q&A
« Reply #37 on: October 28, 2012, 12:58:16 am »
I have all the the flow charts I'll be using. Most issues like video, power, motherboard, drive, and conflict issues, can be chained pretty easily. You can even loop the GetResponse if the PrevSent is already written. So pretty much if the flow charts suggests skipping to another section, it will, and does not cause any conflicts. I am very happy with this function!

Unfortunately other issue like networking, audio, and laptops do not apply to the original chain, so I would like to have a different set of questions to operate within a different chain, outside of the original, but within the original Diagnostic.uhp

If this doesn't make sense? Just let me know. All I need is a sample or example, and I'm on my way to carpal tunnel syndrome.
Right now I have a little over 350 lines. That is just power supply, video failure, and Motherboard, CPU, and RAM failure. I still have 6 more ares to apply. I'm looking at a possible 3000 lines when I'm done.
« Last Edit: October 28, 2012, 01:04:54 am by deitz75 »

deitz75

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Q&A
« Reply #38 on: October 28, 2012, 05:44:11 pm »
Never mind I figured it out

hudson-killian

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Q&A
« Reply #39 on: January 26, 2013, 10:31:07 pm »
I think what you are aiming is an "If then else" program. Just wondering what if it doesn't give the exact response?
"Blessed are those who can give without remembering and take without forgetting."  choose hot tubs direct