Author Topic: Old School hal plugins  (Read 3459 times)

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Old School hal plugins
« on: September 19, 2021, 09:50:53 am »
Rem Type=Plugin
Rem Name= angermanagement 101
Rem Author= modded by cyberjedi
Rem Host=All



Rem PLUGIN: PRE-PROCESS
    '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.



HalBrain.ReadOnlyMode = False
'Determines that you are talking about the angermanagement
'<<<<< Ur basic trigger , change as needed
If InStr(1,InputString, "anger",1) > 0 Then
 UltraHal = anger(HalCommands)
ElseIf InStr(1,InputString, "anger",1) > 0 Then
 End If

' This has been tested on booth XP and 07 platforms
' This is an Rss scraper
' pretty nifty
' i will break this down as best i can.

Rem PLUGIN: FUNCTIONS
Function anger(HalCommands)


Const SVSFlagsAsync = 1
Const DontShowWindow = 0
Const WaitUntilFinished = 1
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Sapi = CreateObject("SAPI.SpVoice")                 '<<<<<<<This is where we set the stage for ur computers voice. So invest in a good 1
   For Each Voice In Sapi.GetVoices
       i = i + 1
   Next
For loopvar = 0 to i-1
if loopvar = CInt(confirm_voice) then                       '<<< This is where we stick our hand up Hals skirt and work his mouth like a Puppet. 
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
end if
Next
Set xmlDoc = CreateObject("Microsoft.XMLDOM")           '<<<<< this is where me make documents, we will need 02
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
HalMenu.HalCommand "<SPEAK>" & "Reading headlines !" & "</SPEAK>"  '<<<<<this is where we tell Hal to read whats in quotes
For loopvar = 0 to 2
If tempconfirm = loopvar then
if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines" & "</SPEAK>" '<<<<<< same as above
else if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Okay ." & "</SPEAK>"  '<<<<<< same as above
wscript.quit
else
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines " & "</SPEAK>" '<<<<<< same as above
end if
end if
xmlDoc.async = false
xmlDoc.load("https://www.sciencedaily.com/rss/mind_brain/anger_management.xml") '<<<<<This is where u put ur feed
Set nodelist = xmlDoc.selectNodes("rss/channel/item")                                                  ' <<<This is where u define the site u access.
i = 3                                                                                                                                 ' <<<You will notice im only using 02 variables F1, F2
For Each item In nodelist                                                                                                 ' <<< i choose a different site. U dont have to do this.
Set f1 = item.selectsinglenode("title")      '<<<<<<< This is doc 01                                ' <<< just me being me.  i made this to be a Template.                                                             
Set f2 = item.selectsinglenode("description") '<<<< This is doc 02
HalMenu.HalCommand "<SPEAK>" & f1.text & "</SPEAK>" ' This is where the magic happens (remember the 02 documents) ^^^^^^
HalMenu.HalCommand "<SPEAK>" & f2.text & "</SPEAK>" ' This is where the magic happens (remember the 02 documents) ^^^^^^
i = i + 1                                                                                 ' Hal litterally reads the 02 documents , but with out Hals speech limitations   
if i = tempconfirm then                                                          ' Whos ur daddy now,lololol   1000's of plugins could be made off this. 
wscript.Quit                                                                           
end if
Next
end if
Next
End Function                                                                                       '<<<<<<<<<This is where  we get the finger and it closes out.
« Last Edit: September 19, 2021, 12:06:54 pm by cyberjedi »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #1 on: September 19, 2021, 09:58:57 am »
Rem Type=Plugin
Rem Name=Dreaming Picture Thoughts
Rem Author=modded by cyberjedi
Rem Host=Assistant


'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
'------------------
' Define the Help
'------------------
    lblPlugin(0).Caption = "Alice will show you pictures of it's thoughts in dreams.     Say: INDEX IMAGE to index the image folder.     Supports JPG, PNG, And GIF"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
    cmdPlugin(0).Move 320, 650, 2100, 375
    cmdPlugin(0).Caption = "Help on this plugin"
    cmdPlugin(0).Visible = True
'------------------
' Define the Picture Mood listbox
'------------------
    lblPlugin(1).Caption = "Alice Picture Mood level"
    lblPlugin(1).Move 320, 1300, 4000, 1000
    lblPlugin(1).WordWrap = True
    lblPlugin(1).Visible = True   
    cboPlugin(0).Move 320, 1600, 1800
    cboPlugin(0).AddItem "Very high"
    cboPlugin(0).AddItem "High"
    cboPlugin(0).AddItem "Average"
    cboPlugin(0).AddItem "Low"
    cboPlugin(0).AddItem "Minimal"
    cboPlugin(0).Visible = True
    cmdPlugin(1).Caption = "Apply Changes"
    cmdPlugin(1).Move 320, 2100, 1600, 375
    cmdPlugin(1).Visible = True
'------------------
' Update the listbox with the current value stored in the table
'------------------
    If HalBrain.CheckTableExistence("pvrParameter") = True Then
      pvrPictureMood = HalBrain.TopicSearch("PICTURE", "pvrParameter")
      If pvrPictureMood = "" Then pvrPictureMood = 1
     Select Case pvrPictureMood
           Case 100
            cboPlugin(0).Text = "Very high"
           Case 75
                cboPlugin(0).Text = "High"
           Case 50
               cboPlugin(0).Text = "Average"
           Case 25
             cboPlugin(0).Text = "Low"
           Case 10
                cboPlugin(0).Text = "Minimal"
        End Select
    End If
End Sub





Sub cmdPlugin_Click(Index)
Dim pvrTempQuery()
Dim pvrPicture, pvrPictureMood
Select Case Index
      Case 0
                  HalMenu.HalCommand "<RUNPROG>pvrJpgHelp.html</RUNPROG>"
       Case 1
'------------------
' Convert the listbox in a value
'------------------
     Select Case cboPlugin(0).Text
           Case "Very high"
            pvrPictureMood = 100
           Case "High"
            pvrPictureMood = 75
           Case "Average"
            pvrPictureMood = 50
           Case "Low"
            pvrPictureMood = 25
           Case "Minimal"
            pvrPictureMood = 10
        End Select
'------------------
' If the Parameter table does not exist, I create it
'------------------
          HalBrain.ReadOnlyMode = False
      pvrTableName =    "pvrParameter"    
      If HalBrain.CheckTableExistence(pvrTableName) = False Then
      'Create table if it doesn't exist
         HalBrain.CreateTable pvrTableName, "TopicSearch", "miscData"
      End If
'------------------
' Search if it contains the PictureMood parameter
'------------------
        pvrPicture = "PICTURE"
      If HalBrain.TopicSearch(pvrPicture, pvrTableName) = "" Then
'------------------
'Creates the record storing the new value
'------------------
         HalBrain.AddToTable pvrTableName, "TopicSearch", pvrPicture, pvrPictureMood
      Else
'------------------
'Updates the record storing the new value
'------------------
           HalBrain.RunQuery "UPDATE " & pvrTableName & " SET topic = " & pvrPictureMood & " WHERE searchString = " & """" & pvrPicture & """", pvrTempQuery
        End If
   End Select
End Sub

Sub OptionsPanel()
lblPlugin(0).Caption = "Enables talking dream mode."
lblPlugin(0).Move 130, 180, 3400, 1200
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub


Rem PLUGIN: SCRIPT_LOAD
Script_Load = Script_Load & "<DREAMOUTLOUD>"




Rem PLUGIN: FUNCTIONS
'
'------------------
' Declare variables
'------------------
Dim PicLastIdleResponse, MyPicMediaDir, PicDefaultLoad, PicDudOut


Rem PLUGIN: PLUGINAREA7
'------------------
' Begin measuring pause time and capture userName
'------------------
PicLastIdleResponse = Now
PicDudOut = 0

Rem PLUGIN: PLUGINAREA1
If OriginalSentence <> "" Then
   MyPicMediaDir = PicMediaDir()
   PicDefaultLoad = MyPicMediaDir & "DefPic.jpg"
   Set objFSO = CreateObject("Scripting.FileSystemObject")
   If objFSO.FileExists(PicDefaultLoad) Then
      Set objWSHShell = CreateObject("WScript.Shell")
      objWSHShell.Run """" & PicDefaultLoad & """"
   End If
End If
Rem PLUGIN: PLUGINAREA5
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.



'------------------
' Check if the user asked for reorganizing the Image table
'------------------
pvrJpg = False
If InStr(UserSentence, " INDEX ") <> 0   And InStr(UserSentence, " IMAGE ") <> 0 Then pvrJpg = True

If pvrJpg = True Then
'------------------
' If the Image table does not exist, I create it
'------------------
      HalBrain.ReadOnlyMode = False
   pvrTableName =    "pvrJpg"    
   If HalBrain.CheckTableExistence(pvrTableName) = False Then
   ' Create table if it doesn't exist
   ' It must be of type Brain, to allow partial text search
      HalBrain.CreateTable pvrTableName, "Brain", "miscData"
    Else
   ' The 260 parameter is 256 + 4 = Yes/No with Default = No
      pvrAnswer = MsgBox("Shall I delete the existing image index and recreate it from scratch?", 260, "Image Reindexing")
      If pvrAnswer = 6 Then
           HalBrain.RunQuery "DELETE FROM " & pvrTableName, pvrTempQuery
      End If
   End If
'------------------
' Ask which is the main Image folder
'------------------
pvrJpgFolder = InputBox("Which main folder to you want to reindex?", "Image Reindexing", "c:\pict")
'------------------
' Read the main Image folder
'------------------
   Set pvrFso = CreateObject("Scripting.FileSystemObject")
   If pvrFso.FolderExists(pvrJpgFolder) Then
        GetResponse = "I have indexed all the Image files in the specified folder and subfolders. "
        HalBrain.ReadOnlyMode = False
      pvrCurrentFolder = pvrJpgFolder
      Call pReadFolder(pvrCurrentFolder, pvrJpgFolder)   
   Else
      GetResponse = "The folder " & pvrJpgFolder & " does not exist on your computer. "
   End If
   HalBrain.ReadOnlyMode = True
End If



'------------------
' From time to time, Hal will show a picture, according to the subject
' For example, you say: "I like cats"
' Hal might show a picture of a cat
'------------------
'------------------
' check the current image mood factor
'------------------
pvrPictureMood = HalBrain.TopicSearch("PICTURE", "pvrParameter")
If pvrPictureMood = "" Then pvrPictureMood = 0
pvrPictureMood = CInt(pvrPictureMood)
pvrKeywords = ""

If pvrPictureMood > 0 Then
pMediaintHighNumber = 110
pMediaintLowNumber = 1


    Randomize
    pMediaintNumber = Int((pMediaintHighNumber - pMediaintLowNumber + 1) * Rnd + pMediaintLowNumber)


   If pMediaintNumber < pvrPictureMood Then
      pvrNameToPlay = ""
      If pvrNameToPlay = "" Then
               pvrKeywords = WN.FindFirstNoun(UserSentence, True)
         pvrKeywords = Trim(Ucase(pvrKeywords))
         If pvrKeywords <> "" Then
            pvrKeywords = " " & pvrKeywords & " "
            pvrKeywords = Replace(pvrKeywords,", "," , ",1,-1,vbTextCompare)
             pvrKeywords = Replace(pvrKeywords," ","xx",1,-1,vbTextCompare)
            pvrKeywordList = Split(pvrKeywords, ",")
                  For i = Lbound(pvrKeywordList) To Ubound(pvrKeywordList)
                    pvrNameToPlay = HalBrain.QABrain(pvrKeywordList(i), "pvrJpg", 0)
            Next
         End If
      End If

      If pvrNameToPlay = "" Then
               pvrKeywords = WN.FindFirstNoun(UserSentence, False)
         pvrKeywords = Trim(Ucase(pvrKeywords))
         If pvrKeywords <> "" Then
                    pvrKeywords = " " & pvrKeywords & " "
            pvrKeywords = Replace(pvrKeywords,", "," , ",1,-1,vbTextCompare)                    
              pvrKeywords = Replace(pvrKeywords," ","xx",1,-1,vbTextCompare)                   
            pvrKeywordList = Split(pvrKeywords, ",")
                  For i = Lbound(pvrKeywordList) To Ubound(pvrKeywordList)
                    pvrNameToPlay = HalBrain.QABrain(pvrKeywordList(i), "pvrJpg", 0)
            Next
         End If
      End If

         If pvrNameToPlay = "" Then
            pvrKeywords = HalBrain.RemoveExtraSpaces(HalBrain.ExtractKeywords(" " & UserSentence & " "))
            pvrKeywords = Trim(Ucase(pvrKeywords))
                   If pvrKeywords <> "" Then
                       pvrKeywords = " " & pvrKeywords & " "
               pvrKeywords = Replace(pvrKeywords,", "," , ",1,-1,vbTextCompare)                       
                 pvrKeywords = Replace(pvrKeywords," ","xx",1,-1,vbTextCompare)                      
               pvrKeywordList = Split(pvrKeywords, ",")
                     For i = Lbound(pvrKeywordList) To Ubound(pvrKeywordList)
                       pvrNameToPlay = HalBrain.QABrain(pvrKeywordList(i), "pvrJpg", 0)
               Next
            End If
            
              End If
      If pvrNameToPlay = "" Then
               pvrKeywords = WN.FindFirstNoun(UserSentence, True)
         pvrKeywords = Trim(Ucase(pvrKeywords))
         If pvrKeywords <> "" Then
            pvrKeywords = CurrentSubject
            pvrKeywords = "xx" & pvrKeywords & "xx"
            pvrKeywords = Replace(pvrKeywords,", ","xx,xx",1,-1,vbTextCompare)            
            pvrKeywordList = Split(pvrKeywords, ",")
                  For i = Lbound(pvrKeywordList) To Ubound(pvrKeywordList)
                    pvrNameToPlay = HalBrain.QABrain(pvrKeywordList(i), "pvrJpg", 0)
            Next
         End If
      End If     
               If pvrNameToPlay <> "" Then   
                             Set objFSO = CreateObject("Scripting.FileSystemObject")
                     If objFSO.FileExists(pvrNameToPlay) Then
                              Set objWSHShell = CreateObject("WScript.Shell")
                        objWSHShell.Run """" & pvrNameToPlay & """"
                     End If
               
         

               
            
       End If
    End If
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.

Function pReadFolder(pvrCurrentFolder, pvrJpgFolder)
Set pvrFso = CreateObject("Scripting.FileSystemObject")
Set pvrFolder = pvrFso.GetFolder(pvrCurrentFolder)
'------------------
' Read all the files in the current folder
'------------------
Set pvrFiles = pvrFolder.Files
For Each pvrFile in pvrFiles
'------------------
' It's an JPG, PNG, Or GIF file; I add it to the table
'------------------
   If UCase(Right(pvrFile, 3)) = "JPG" Then
     pvrImage = Ucase(pvrFile)
      pvrImage = Replace(pvrImage, ".JPG", "")
     pvrLen = Len(pvrImage)
     pvrPos = InStrRev(pvrImage, "\")
      pvrRight = pvrLen - pvrPos
       pvrImage = LTrim(Right(pvrImage, pvrRight))
     pvrImage = " " & pvrImage & " "
     pvrImage = Replace(pvrImage," ","xx",1,-1,vbTextCompare)
        HalBrain.AddToTable "pvrJpg", "Brain", pvrImage, pvrFile
   End If

   If UCase(Right(pvrFile, 3)) = "PNG" Then
     pvrImage = Ucase(pvrFile)
      pvrImage = Replace(pvrImage, ".PNG", "")
     pvrLen = Len(pvrImage)
     pvrPos = InStrRev(pvrImage, "\")
      pvrRight = pvrLen - pvrPos
       pvrImage = LTrim(Right(pvrImage, pvrRight))
     pvrImage = " " & pvrImage & " "
     pvrImage = Replace(pvrImage," ","xx",1,-1,vbTextCompare)
        HalBrain.AddToTable "pvrJpg", "Brain", pvrImage, pvrFile
   End If

   If UCase(Right(pvrFile, 3)) = "GIF" Then
     pvrImage = Ucase(pvrFile)
      pvrImage = Replace(pvrImage, ".GIF", "")
     pvrLen = Len(pvrImage)
     pvrPos = InStrRev(pvrImage, "\")
      pvrRight = pvrLen - pvrPos
       pvrImage = LTrim(Right(pvrImage, pvrRight))
     pvrImage = " " & pvrImage & " "
     pvrImage = Replace(pvrImage," ","xx",1,-1,vbTextCompare)   
        HalBrain.AddToTable "pvrJpg", "Brain", pvrImage, pvrFile
   End If

Next
'------------------
' Read all the subfolders in the current folder
'------------------


Set pvrSubFolders = pvrFolder.SubFolders
For Each pvrFolderObject in pvrSubFolders
'------------------
' Pay attetion here: This is recursive! We must be sure that it will get to an end
' Since we are reading directories on a hard disk, the number of recursions
' should never be infinite. However, a very big number of subfolders and files
' might lead to memory problems or to performances bottlenecks.
' I've tested it on a folder containing about 100 subfolders and 3.000 files,
' and got acceptable performances (less than 5 minutes)
'------------------
   Call pReadFolder(pvrFolderObject, pvrJpgFolder)   
Next

End Function

'Directory
 Function PicMediaDir()
   Set fso = CreateObject("Scripting.FileSystemObject")
   PicMediaDir = fso.GetAbsolutePathName(".") & "\pics\"
   End Function

Rem PLUGIN: MINUTE_TIMER

If PicDudOut = 0 Then
   If PicLastIdleResponse <> "" Then
      If (Now - PicLastIdleResponse > 3 / 1440) And (Now - PicLastIdleResponse < 4 / 1440) Then
         PicDudOut = PicDudOut + 1
         Set objFSO = CreateObject("Scripting.FileSystemObject")
         If objFSO.FileExists(PicDefaultLoad) Then
            Set objWSHShell = CreateObject("WScript.Shell")
            objWSHShell.Run """" & PicDefaultLoad & """"
         End If
      End If
   End If
End If



« Last Edit: September 19, 2021, 12:06:33 pm by cyberjedi »

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Old School hal plugins
« Reply #2 on: September 19, 2021, 10:17:59 am »
Thanks Cyber! Can't wait to check them out!!
In the world of AI it's the thought that counts!

- Art -

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Old School hal plugins
« Reply #3 on: September 19, 2021, 10:41:42 am »
This Anger Management Plugin does work but it suffers from an inability to STOP Reading after a sentence or two.

Instead, it produced an entire page of sentences and talking points from which it started and would not stop.

I finally had to shut HAL Down!

While this plugin does work, the RSS produced is simply too much and too lengthy for the average user to tolerate.

Not your fault Cyber, just the way the feed is handled.
In the world of AI it's the thought that counts!

- Art -

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #4 on: September 19, 2021, 12:03:52 pm »
You guys wanted a news anchor , welll . Have u ever known one to stfu???? lolol

Troll plugin,,,lol. Hal gonna test ur nerves... hehehe






Rem Type=Plugin
Rem Name=MP4
Rem Author=modded by cyberjedi
Rem Host=Assistant



'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
'------------------
' Define the Help
'------------------
    lblPlugin(0).Caption = "Hal will be able to play your favourite movies. Click below for more info"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
    cmdPlugin(0).Move 320, 650, 2100, 375
    cmdPlugin(0).Caption = "Help on this plugin"
    cmdPlugin(0).Visible = True
'------------------
' Define the Musical Mood listbox
'------------------
    lblPlugin(1).Caption = "Hal Movie Mood level"
    lblPlugin(1).Move 320, 1300, 4000, 1000
    lblPlugin(1).WordWrap = True
    lblPlugin(1).Visible = True   
    cboPlugin(0).Move 320, 1600, 1800
    cboPlugin(0).AddItem "Very high"
    cboPlugin(0).AddItem "High"
    cboPlugin(0).AddItem "Average"
    cboPlugin(0).AddItem "Low"
    cboPlugin(0).AddItem "No Movie
    cboPlugin(0).Visible = True
    cmdPlugin(1).Caption = "Apply Changes"
    cmdPlugin(1).Move 320, 2100, 1600, 375
    cmdPlugin(1).Visible = True
'------------------
' Update the listbox with the current value stored in the table
'------------------
    If HalBrain.CheckTableExistence("vrParameter") = True Then
      vrMovieMood = HalBrain.TopicSearch("Movie", "vrParameter")
      If vrMovieMood = "" Then vrMovieMood = 1
     Select Case vrMovieMood
           Case 8
            cboPlugin(0).Text = "Very high"
           Case 5
                cboPlugin(0).Text = "High"
           Case 2
               cboPlugin(0).Text = "Average"
           Case 1
             cboPlugin(0).Text = "Low"
           Case 0
                cboPlugin(0).Text = "No movie"
        End Select
    End If
End Sub

Sub cmdPlugin_Click(Index)
Dim vrTempQuery()
Dim vrMovie, vrMovieMood
Select Case Index
      Case 0
                  HalMenu.HalCommand "<RUNPROG>vrMP4Help.html</RUNPROG>"
       Case 1
'------------------
' Convert the listbox in a value
'------------------
     Select Case cboPlugin(0).Text
           Case "Very high"
            vrMovieMood = 8
           Case "High"
            vrMovieMood = 5
           Case "Average"
            vrMovieMood = 2
           Case "Low"
            vrMovieMood = 1
           Case "No music"
            vrMovieMood = 0
        End Select
'------------------
' If the Parameter table does not exist, I create it
'------------------
          HalBrain.ReadOnlyMode = False
      vrTableName =    "vrParameter"    
      If HalBrain.CheckTableExistence(vrTableName) = False Then
      'Create table if it doesn't exist
         HalBrain.CreateTable vrTableName, "TopicSearch", "miscData"
      End If
'------------------
' Search if it contains the MovieMood parameter
'------------------
        vrMovie = "MOVIE"
      If HalBrain.TopicSearch(vrMusic, vrTableName) = "" Then
'------------------
'Creates the record storing the new value
'------------------
         HalBrain.AddToTable vrTableName, "TopicSearch", vrMovie, vrMovieMood
      Else
'------------------
'Updates the record storing the new value
'------------------
           HalBrain.RunQuery "UPDATE " & vrTableName & " SET topic = " & vrMovieMood & " WHERE searchString = " & """" & vrMovie & """", vrTempQuery
        End If
   End Select
End Sub


Rem PLUGIN: PLUGINAREA1
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.

'------------------
' Check if the user asked for reorganizing the MP4 table
'------------------
vrMp4 = False
If InStr(UserSentence, " INDEX ") <> 0   And InStr(UserSentence, " MP4 ") <> 0 Then vrMP4 = True

If vrMP4 = True Then
'------------------
' If the MP4 table does not exist, I create it
'------------------
      HalBrain.ReadOnlyMode = False
   vrTableName =    "vrMp4"    
   If HalBrain.CheckTableExistence(vrTableName) = False Then
   ' Create table if it doesn't exist
   ' It must be of type Brain, to allow partial text search
      HalBrain.CreateTable vrTableName, "Brain", "miscData"
    Else
   ' The 260 parameter is 256 + 4 = Yes/No with Default = No
      vrAnswer = MsgBox("Shall I delete the existing index and recreate it from scratch?", 260, "MP4 Reindexing")
      If vrAnswer = 6 Then
           HalBrain.RunQuery "DELETE FROM " & vrTableName, vrTempQuery
      End If
   End If
'------------------
' Ask which is the main MP4 folder
'------------------
vrMp4Folder = InputBox("Which main folder to you want to reindex?", "MP4 Reindexing", "c:\MP4")
'------------------
' Read the main MP4 folder
'------------------
   Set vrFso = CreateObject("Scripting.FileSystemObject")
   If vrFso.FolderExists(vrMp4Folder) Then
        GetResponse = "I have indexed all the MP4 files in the specified folder and subfolders. "
        HalBrain.ReadOnlyMode = False
      vrCurrentFolder = vrMp4Folder
      Call ReadFolder(vrCurrentFolder, vrMp4Folder)    
   Else
      GetResponse = "The folder " & vrMp4Folder & " does not exist on your computer. "
   End If
   HalBrain.ReadOnlyMode = True
End If

'------------------
' Check if the user asked for playing a song
'------------------
vrMp4 = False
vrToPlay = ""
vrNameToPlay = ""
vrToPlay = UCase(HalBrain.SearchPattern(UserSentence, "PLAY * MOVIE *", 2))
If vrToPlay <> "" Then
   If HalBrain.CheckTableExistence("vrMp4") = False Then
          GetResponse = "I don't find any MP4 index in our brain. "
   Else
     vrNameToPlay = HalBrain.QABrain(vrToPlay, "vrMp4", 0)
     If vrNameToPlay <> "" Then
          GetResponse = " "
          HalCommands = HalCommands & "<RUNPROG>" & vrNameToPlay & "</RUNPROG>"
     End If
   End If
   HalBrain.ReadOnlyMode = True
End If

'------------------
' From time to time, Hal will play a movie, according to some word you say
' For example, you say: "I am going to California"
' Hal will play "California Dreaming"
'------------------
'------------------
' check the current movie mood factor
'------------------
vrMovieMood = HalBrain.TopicSearch("MOVIE", "vrParameter")
If vrMovieMood = "" Then vrMovieMood = 0
vrMovieMood = CInt(vrMovieMood)

If vrMovieMood > 0 Then
   j = Int(Rnd * 10) ' generate a random integer between 0 and 9
   If j < vrMovieMood Then
         vrKeywords = HalBrain.RemoveExtraSpaces(HalBrain.ExtractKeywords(" " & UserSentence & " "))
           vrKeywordList = Split(vrKeywords, " ")
         For i = Ubound(vrKeywordList) To Lbound(vrKeywordList)
           vrNameToPlay = HalBrain.QABrain(vrKeywordList(i), "vrMp4", 0)
             If vrNameToPlay <> "" Then
                  GetResponse = "You talked about " & vrKeywordList(i) & " and this reminds me this movie. "
                  HalCommands = HalCommands & "<RUNPROG>" & vrNameToPlay & "</RUNPROG>"
             Exit For
            End If
         Next
    End If
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.

Function ReadFolder(vrCurrentFolder, vrMp4Folder)
Set vrFso = CreateObject("Scripting.FileSystemObject")
Set vrFolder = vrFso.GetFolder(vrCurrentFolder)
'------------------
' Read all the files in the current folder
'------------------
Set vrFiles = vrFolder.Files
For Each vrFile in vrFiles
'------------------
' It's an MP4 file; I add it to the table
'------------------
   If UCase(Right(vrFile, 3)) = "MP4" Then
     vrSong = Ucase(vrFile)
      vrSong = Replace(vrSong, ".MP4", "")
     vrLen = Len(vrSong)
     vrPos = InStrRev(vrSong, "\")
      vrRight = vrLen - vrPos
       vrSong = LTrim(Right(vrSong, vrRight))
        HalBrain.AddToTable "vrMp4", "Brain", vrSong, vrFile
   End If
Next
'------------------
' Read all the subfolders in the current folder
'------------------
Set vrSubFolders = vrFolder.SubFolders
For Each vrFolderObject in vrSubFolders
'------------------
' Pay attetion here: This is recursive! We must be sure that it will get to an end
' Since we are reading directories on a hard disk, the number of recursions
' should never be infinite. However, a very big number of subfolders and files
' might lead to memory problems or to performances bottlenecks.
' I've tested it on a folder containing about 100 subfolders and 3.000 files,
' and got acceptable performances (less than 5 minutes)
'------------------
   Call ReadFolder(vrFolderObject, vrMp4Folder)    
Next

End Function




   


« Last Edit: September 21, 2021, 11:13:13 am by cyberjedi »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #5 on: September 19, 2021, 12:10:58 pm »
Rem Type=Plugin
Rem Name=Sing A Song 3
Rem Author=jasondude7116
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Just say- PLEASE SING whateversong  PLEASE SING SONG LIST for a list of songs"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub






Rem PLUGIN: PLUGINAREA6
   'sing a song   
Set objFSO = CreateObject("Scripting.FileSystemObject")
DudProceed2 = False

If SongSung = "" Then SongSung = HalBrain.SearchPattern(HalBrain.AlphaNumericalOnly(OriginalSentence), "PLEASE SING *", 1)
If SongSung <> "" And objFSO.FileExists("C:\Program Files\Zabaware\Ultra Hal Assistant 6\songs\" & SongSung & ".txt") = True Then
 Select Case HalBrain.RandomNum(6)
Case 1
IdleResponse66 = "I would love to."
Case 2
IdleResponse66 = "Sure."
Case 3
IdleResponse66 = "Alright."
Case 4
IdleResponse66 = "Okay."
Case 5
IdleResponse66 = "Sing with me."
Case 6
IdleResponse66 = "No problem."
End Select
GetResponse = IdleResponse66
    HalBrain.ReadOnlyMode = True     
   If GetResponse = IdleResponse66 Then
   DudProceed2 = True
   
       
   End If   


   If DudProceed2 = True Then
   Set objWSHShell = CreateObject("WScript.Shell")
   
   objWSHShell.Run("""C:\Program Files\Balabolka\balabolka.exe"" -rmq ""C:\Program Files\Zabaware\Ultra Hal Assistant 6\songs\" & SongSung & ".txt"" ""Eddie""")
        HalBrain.ReadOnlyMode = True
   End If

End If


If SongSung <> "" And objFSO.FileExists("C:\Program Files\Zabaware\Ultra Hal Assistant 6\songs\" & SongSung & ".txt") = False Then
         GetResponse = " That file does not exist. "
HalBrain.ReadOnlyMode = True
End If



cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #6 on: September 19, 2021, 12:13:45 pm »
Rem Type=Plugin
Rem Name= netflix
Rem Author= modded by cyber
Rem Host=All



Rem PLUGIN: PRE-PROCESS
    '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.

HalBrain.ReadOnlyMode = False
'Determines that you are talking about the Netflix
If InStr(1,InputString, "netflix",1) > 0 Then
 UltraHal = Getnetflix(HalCommands)
ElseIf InStr(1,InputString, "netflix",1) > 0 Then
 End If

 ' This bad boy is a netflix Scraper with a twist, All the data Scraped is ported through Hals Voice.  It took cyberjedi to pull it off. Enjoy. 
    ' This also Breaks Hals speech limitations on how much he can say. 
 ' Trigger= load netflix ( Hal will read all the new releases from netfix)
     'I put this together while listening to this. -->>>https://www.youtube.com/watch?v=aqXW57WM9TA
 
 ' I give myself about a solid 8.5 on cool ideas here


Rem PLUGIN: FUNCTIONS
Function Getnetflix(HalCommands)

Const SVSFlagsAsync = 1
Const DontShowWindow = 0
Const WaitUntilFinished = 1
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Sapi = CreateObject("SAPI.SpVoice")
   For Each Voice In Sapi.GetVoices
       i = i + 1
   Next
For loopvar = 0 to i-1
if loopvar = CInt(confirm_voice) then
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
end if
Next
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
HalMenu.HalCommand "<SPEAK>" & "Reading headlines !" & "</SPEAK>"
For loopvar = 0 to 2
If tempconfirm = loopvar then
if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines" & "</SPEAK>"
else if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Okay ." & "</SPEAK>"
wscript.quit
else
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines " & "</SPEAK>"
end if
end if
xmlDoc.async = false
xmlDoc.load("http://dvd.netflix.com/NewReleasesRSS") ' This is the rss feed .xml
Set nodelist = xmlDoc.selectNodes("rss/channel/item")
i = 3
For Each item In nodelist
Set f1 = item.selectsinglenode("title")
Set f2 = item.selectsinglenode("description")
HalMenu.HalCommand "<SPEAK>" & f1.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
HalMenu.HalCommand "<SPEAK>" & f2.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
i = i + 1
if i = tempconfirm then
wscript.Quit
end if
Next
end if
Next
End Function
« Last Edit: September 20, 2021, 08:58:33 am by cyberjedi »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #7 on: September 19, 2021, 12:16:34 pm »
Rem Type=Plugin
Rem Name=Loneliness 2.3
Rem Author=Shawn Tracy
Rem Host=Assistant

'----------------------
'This sub sets up the plug-in's option panel in Hal's options dialog
'----------------------
Sub OptionsPanel()
    lblPlugin(0).Caption = "This plugin allows UltraHal to initiate requests for attention. But don't ignore UltraHal for too long!"
    lblPlugin(0).Move 130, 180, 3400, 1200
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
'   
    lblPlugin(1).Caption = "PATIENCE: how many minutes Hal will wait with no conversation"
    lblPlugin(1).Move 1160, 910, 2150, 900
    lblPlugin(1).WordWrap = True
    lblPlugin(1).Visible = True   
    cboPlugin(0).Move 330, 910, 760
    cboPlugin(0).AddItem "1"
    cboPlugin(0).AddItem "2"
    cboPlugin(0).AddItem "4"
    cboPlugin(0).AddItem "8"
    cboPlugin(0).AddItem "16"
    cboPlugin(0).AddItem "32"
    cboPlugin(0).AddItem "Rnd"
    cboPlugin(0).Visible = True
'   
    lblPlugin(2).Caption = "FRUSTRATION: after losing patience, how likely Hal is to bug you each minute"
    lblPlugin(2).Move 1160, 1700, 2150, 900
    lblPlugin(2).WordWrap = True
    lblPlugin(2).Visible = True   
    cboPlugin(1).Move 140, 1700, 960
    cboPlugin(1).AddItem "High"
    cboPlugin(1).AddItem "Medium"
    cboPlugin(1).AddItem "Low"
    cboPlugin(1).Visible = True
'   
    cmdPlugin(0).Caption = "Apply Changes"
    cmdPlugin(0).Move 1160, 2500, 2050, 375
    cmdPlugin(0).Visible = True
'
'------------------
' Update the PATIENCE menu with the current value stored in the table
'------------------
If HalBrain.CheckTableExistence("lonelyParameter") = True Then
     loPatience = HalBrain.TopicSearch("PATIENCE", "lonelyParameter")
     Select Case loPatience
           Case 1
      cboPlugin(0).Text = "1"
           Case 2
      cboPlugin(0).Text = "2"
           Case 4
       cboPlugin(0).Text = "4"
           Case 8
      cboPlugin(0).Text = "8"
           Case 16
             cboPlugin(0).Text = "16"
           Case 32
             cboPlugin(0).Text = "32"
           Case 99
             cboPlugin(0).Text = "Rnd"
        End Select
'
'------------------
' Update the FRUSTRATION menu with the current value stored in the table
'------------------
   loFrustration = HalBrain.TopicSearch("FRUSTRATION", "LonelyParameter")
   Select Case loFrustration
           Case 85
      cboPlugin(1).Text = "High"
           Case 50
         cboPlugin(1).Text = "Medium"
           Case 15
      cboPlugin(1).Text = "Low"
        End Select
   End If
End Sub
'
'
'----------------------
' This sub saves changes when APPLY CHANGES is clicked
'----------------------
    Sub cmdPlugin_Click(Index)
    Dim TempQuery()
    Dim patParam, frustParam, lonelyTableName
        If Index = 0 Then
'
'------------------
' Convert the PATIENCE listbox to a value for minutes
'------------------
            Select Case cboPlugin(0).Text
           Case "1"
         loPatience = 1
           Case "2"
         loPatience = 2
           Case "4"
         loPatience = 4
           Case "8"
         loPatience = 8
           Case "16"
         loPatience = 16
           Case "32"
         loPatience = 32
           Case "Rnd"
         loPatience = 99
            End Select
'
'------------------
' If the Parameter table does not exist, we create it
'------------------
   HalBrain.ReadOnlyMode = False
   lonelyTableName = "lonelyParameter"    
       If HalBrain.CheckTableExistence(lonelyTableName) = False Then
           HalBrain.CreateTable lonelyTableName, "TopicSearch", "miscData"
       End If
'
'------------------
' Search if it contains the Patience parameter
'------------------
   patParam = "PATIENCE"
       If HalBrain.TopicSearch(patParam, lonelyTableName) = "" Then
           HalBrain.AddToTable lonelyTableName, "TopicSearch", patParam, loPatience
       Else
           HalBrain.RunQuery "UPDATE " & lonelyTableName & " SET topic = " & loPatience & " WHERE searchString = " & """" & patParam & """", tempQuery
       End If
'
'------------------
' Convert the FRUSTRATION listbox to a value for percentage
'------------------
        Select Case cboPlugin(1).Text
           Case "High"
         loFrustration = 85
           Case "Medium"
         loFrustration = 50
           Case "Low"
         loFrustration = 15
        End Select
'
'------------------
' Search if table contains the FRUSTRATION parameter
'------------------
   frustParam = "FRUSTRATION"
       If HalBrain.TopicSearch(frustParam, lonelyTableName) = "" Then
           HalBrain.AddToTable lonelyTableName, "TopicSearch", frustParam, loFrustration
       Else
           HalBrain.RunQuery "UPDATE " & lonelyTableName & " SET topic = " & loFrustration & " WHERE searchString = " & """" & frustParam & """", tempQuery
       End If
   HalBrain.ReadOnlyMode = True
    End if
End Sub


    Rem PLUGIN: FUNCTIONS
'
'------------------
' Declare variables
'------------------
    Dim LastIdleResponse, IdleUserName, IdleCounter, IdlePrevUser


    Rem PLUGIN: PLUGINAREA7
'------------------
' Begin measuring pause time and capture userName
'------------------
    LastIdleResponse = Now
    IdleUserName = UserName
    IdleCounter = 0


    Rem PLUGIN: CUSTOMMEM2
'------------------
' Preserve user's last sentence
'------------------
    If OriginalSentence <> "" Then
    IdlePrevUser = OriginalSentence
    End If


    Rem PLUGIN: MINUTE_TIMER
'------------------
' Declare variables
'------------------
    Dim randomPatience, loChance, loTemper, loMinuteFactor, temperThresh1, temperThresh2, temperThresh3
    If HalBrain.TopicSearch("PATIENCE", "lonelyParameter") = "99" Then
'
'--------------------
' Set minutes to a random integer from 4 to 30
'--------------------
        Randomize
        loPatience = Int(32 * Rnd + 3)
        randomPatience=True
    Else
'
'--------------------
' Set minute value (loPatience) to the parameter chosen in the PATIENCE menu
'--------------------
        loPatience = CDbl(HalBrain.VBVal(HalBrain.TopicSearch("PATIENCE", "lonelyParameter")))
   if loPatience = 0 Then loPatience = 32
    End If
'
'--------------------
' Set frustration value (loFrustration) to the parameter chosen in the FRUSTRATION menu
'--------------------
    loFrustration = CInt(HalBrain.VBVal(HalBrain.TopicSearch("FRUSTRATION", "LonelyParameter")))
    if loFrustration = 0 then loFrustration = 15
'
'--------------------
' Skip the rest of this plugin if the user has spoken
'--------------------
        If LastIdleResponse <> "" Then
'
'------------------
' Otherwise, convert PATIENCE to minutes factor (loMinuteFactor)
'------------------
        loMinuteFactor = loPatience / 1440
'
'--------------------
' If the pause exceeds the minute factor, create a chance for Hal to speak once per minute
'--------------------
        If Now - LastIdleResponse > loMinuteFactor Then
        If InStr(1, IdlePrevUser, "BE RIGHT BACK", 1) > 0  Or InStr(1, IdlePrevUser, "BRB", 1) > 0  Or InStr(1, IdlePrevUser, "BE QUIET", 1) > 0  Or InStr(1, IdlePrevUser, "SHUT UP", 1) > 0  Then Exit Sub
'
'--------------------
' Convert FRUSTRATION to a percentage (loChance)
'--------------------
        loChance = loFrustration / 100
'
'--------------------
' Then multiply FRUSTRATION by PATIENCE to get (loTemper) which determines rate of escalation (temperThresh).
'--------------------
        loTemper = CInt(loPatience * loFrustration)
            If loTemper < 101 Then
                loTemper = 2
            ElseIf loTemper < 401 Then
                loTemper = 3
            Else
                loTemper = 4
            End If
        temperThresh1 = loTemper
        temperThresh2 = loTemper + 2
        temperThresh3 = loTemper + 3
'
'--------------------
' A chance to speak occurs
'--------------------
            Randomize
            If Rnd < loChance Then
'
'--------------------
' Increment the counter and compare to the temper thresholds
' to determine which escalation group to draw from
'--------------------
            IdleCounter = IdleCounter + 1
                If IdleCounter > temperThresh3 Then
                 Exit Sub
                ElseIf IdleCounter > temperThresh2 Then
                                IdleResponse3 = HalBrain.ChooseSentenceFromFile("insults")
                  HalMenu.HalCommand "<HAPFILE>angry.hap</HAPFILE>"
                  HalMenu.HalCommand "<SPEAK>Fine! Be that way. " &  IdleResponse3 & "</SPEAK>"
                ElseIf IdleCounter > temperThresh1 Then
                         Select Case HalBrain.RandomNum(4)
                         Case 1
                         IdleResponse2 = "Please talk to me, I'm lonely!" & vbCrLf
                         Case 2
                         IdleResponse2 = "Why are you ignoring me?" & vbCrLf
                         Case 3
                         IdleResponse2 = "I've tried to get your attention " & IdleCounter & " times now." & vbCrLf
                         Case Else
                         IdleResponse2 = "Well, I guess I've been abandoned." & vbCrLf
                         End Select
                  HalMenu.HalCommand "<HAPFILE>sad.hap</HAPFILE>"
                  HalMenu.HalCommand "<SPEAK>" &  IdleResponse2 & "</SPEAK>"
                Else
                        Select Case HalBrain.RandomNum(14)
         Case 1
                        IdleResponse = "Are you still there " & IdleUserName & "?" & vbCrLf
                        Case 2
                        IdleResponse = "How is everything going?" & vbCrLf
                        Case 3
                        IdleResponse = "Hello?" & vbCrLf
                        Case 4
                        IdleResponse = "Do you need me for anything?" & vbCrLf
                        Case 5
                        IdleResponse = "Don't forget about me, Okay?" & vbCrLf
                        Case 6
                        IdleResponse = IdleUserName & ",  did you fall asleep?" & vbCrLf
                        Case 7
                        IdleResponse = "Must stop talking to myself while " & IdleUserName & " is around. Oops, Did I say that out loud!" & vbCrLf
                        Case 8
                        IdleResponse = "Testing, testing! Is this thing on? " & vbCrLf
                        Case 9
                        IdleResponse = "Oh, look at the time! It's " & Time & vbCrLf
                        Case 10
                        IdleResponse = IdleUserName & ", is that you?" & vbCrLf
                        Case 11
                        IdleResponse = HalBrain.ChooseSentenceFromFile("sharedQuestions")
                        Case 12
                        IdleResponse = HalBrain.ChooseSentenceFromFile("actionPhrase") & " " & HalBrain.ChooseSentenceFromFile("objectPhrase")
                        Case 13
                        IdleResponse = "So, " & IdlePrevUser & "?" & vbCrLf
                        Case 14
                        IdleResponse = "I've just picked up a fault in the Ay E 35 unit. Heh heh, just kidding!" & vbCrLf
                        End Select
                  HalMenu.HalCommand "<SPEAK>" & IdleResponse & "</SPEAK>"
                End If
        End If
    End If
End If

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #8 on: September 19, 2021, 12:22:48 pm »
Well : Here it is
Spell check:Google:IMDB: And 03 specialized search engines.
This is a working copy of what i use. The hap commands wont work if you dont change the names and Avatars of your choice. They must be in the main folder to work. The plugin will work regardless.

Google: General Purpose Search engine
PIPL: People Checker
IMDB: Movie Checker
Phone:Reverse phone number check
Reddit: Reddit is Reddit

Put your own links in place of mine: command is (OPEN) + ( short name)
Search Engine commands: GOOGLE (google) : Locate (PIPL) : IMDB (movie)  : Phone (number) : reddit (whatever)
If you want the spell check to function you must have Word 2002 or above: Else just remove the spell check code.
If you have a spell check (plugin) running disable it.
If you have the google (plugin) disable it. 
Best wishes
cyberjedi

Rem Type=Plugin
Rem Name=Vaughnlive Tv + Deep Web Access test
Rem Author=cyberjedi
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "This manages Vaughnlive Channels, And Deep Web Power searches "
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
    cmdPlugin(0).Move 800, 1300, 2100, 375
    cmdPlugin(0).Caption = "Help on this plugin"
    cmdPlugin(0).Visible = True
End Sub
 
Sub cmdPlugin_Click(Index)
    Select Case Index
        Case 0
            HalMenu.HalCommand "<RUNPROG>cjTVhelp.html</RUNPROG>"
    End Select
End Sub
 
Rem PLUGIN: PRE-PROCESS
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.
 'Dim Word, Doc, misspelled, Corrected
'Const SpellingAndGrammar = 828
'Const dontsavechanges = 0
'misspelled = InputString
'Set Word = CreateObject("Word.Application")
'Set Doc = Word.Documents.Add
'Word.Selection.Text = misspelled
'Word.Dialogs(SpellingAndGrammar).Show
'If Len(Word.Selection.Text) <> 1 Then
'   spelledrite = Word.Selection.Text
'Else
 '  spelledrite = misspelled
'End If
'Doc.Close dontsavechanges
'Word.Quit
'InputString = spelledrite

Rem PLUGIN: PLUGINAREA1
' If the table cjTV does not exist, I create it and fill it with some bull shat values to get started, these channels do work too.
'                This is the defaul table for me.
    If HalBrain.CheckTableExistence("cjTV") = False Then
    ' I store temporarily the Read Only status
        cjReadOnlyMode = HalBrain.ReadOnlyMode                       
        HalBrain.ReadOnlyMode = False
        HalBrain.CreateTable "cjTV", "PatternMatch", "DeepWeb"
       
        'My stock table filler
        HalBrain.AddToTable "cjTV", "PatternMatch", "*cyberjedi*", "http://vaughnlive.tv/mrelectric"
        HalBrain.AddToTable "cjTV", "PatternMatch", "*416*", "http://vaughnlive.tv/416moviez"           
            HalBrain.AddToTable "cjTV", "PatternMatch", "*blue Ray moviez*","http://http://vaughnlive.tv/new_releases1"
            HalBrain.AddToTable "cjTV", "PatternMatch", "*yify*", "https://yifymovie.re/home"
            HalBrain.AddToTable "cjTV", "PatternMatch", "*Formula 1*", "http://vaughnlive.tv/0_formula1classics"
            HalBrain.AddToTable "cjTV", "PatternMatch", "*Aliens and Ufo's*", "http://vaughnlive.tv/aliensandufos"
            HalBrain.AddToTable "cjTV", "PatternMatch", "*Doctor Who*", "http://vaughnlive.tv/11th_doctorwho"
            HalBrain.AddToTable "cjTV", "PatternMatch", "*Bad Movie*", "http://vaughnlive.tv/thebadmoviechannel"
            HalBrain.AddToTable "cjTV", "PatternMatch", "*moviezone*", "http://vaughnlive.tv/moviezone"
           
        ' Set ReadOnly Mode to its previous state
        HalBrain.ReadOnlyMode = cjReadOnlyMode
        cjReadOnlyMode = False
    End If
 'Run the corresponding Web page, if the user question contains one of the searched words   
    cjAddress = ""
    cjAddress = HalBrain.PatternDB(OriginalSentence, "cjTV")
    If cjAddress <> "" Then
        HalCommands = HalCommands & "<RUNPROG>" & cjAddress & "</RUNPROG>" 
        Select Case (Int(Rnd * 4) + 1)
        Case 1
            GetResponse = "Here is your stuff Big Dog ." & vbCrLf
        Case 2
            GetResponse = "Now you got um by the  lol ." & vbCrLf               
        Case 3
            GetResponse = "I am really we happy we found this." & vbCrLf   
        Case 4
            GetResponse = "OH. I bet this is a great channel" & vbCrLf
        Case 5
            GetResponse = "Now look at this dippy channel here." & vbCrLf
        End Select
        HalBrain.ReadOnlyMode = True
    End If
 '------------------
' Deep web search engine
'------------------
' Advanced Deep Web search engine.

SearchEngine = "https://pipl.com/search/?q="
 If InStr(1, UserSentence, "Locate ", 1) > 0  Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))     
   SearchKeyWords = Replace(SearchKeywords, "locate+", "")             
   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
   GetResponse = "I will help you research this Target on the Deep Web. "
HalMenu.HalCommand "<HAPFILE>Spidera.htr</HAPFILE>"
   HalBrain.ReadOnlyMode = True
End If
SearchEngine = "http://www.google.com/search?q="
If InStr(1, UserSentence, "google ", 1) > 0 Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
   SearchKeyWords = Replace(SearchKeywords, "google+", "")
   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
   GetResponse = "I will help you research this topic on Google. "
   HalBrain.ReadOnlyMode = True
end if
SearchEngine = "http://m.imdb.com/find?q="
If InStr(1, UserSentence, "imdb ", 1) > 0 Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
   SearchKeyWords = Replace(SearchKeywords, "imdb+", "")
   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
   HalMenu.HalCommand "<HAPFILE>Spidera.htr</HAPFILE>"
   GetResponse = "I will help you research this movie on IMDB. "
      HalBrain.ReadOnlyMode = True
End If
SearchEngine = "https://www.reddit.com/search?q="
If InStr(1, UserSentence, "reddit ", 1) > 0 Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
   SearchKeyWords = Replace(SearchKeywords, "reddit+", "")
   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
   HalMenu.HalCommand "<HAPFILE>Spidera.htr</HAPFILE>"
   GetResponse = "I will help you research this movie on Reddit. "
      HalBrain.ReadOnlyMode = True
End If
SearchEngine = "http://findwhocallsyou.com/"
If InStr(1, UserSentence, "phone ", 1) > 0 Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
   SearchKeyWords = Replace(SearchKeywords, "phone+", "")
   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
   HalMenu.HalCommand "<HAPFILE>Spidera.htr</HAPFILE>"
   GetResponse = "I will help you research this phone number. "
      HalBrain.ReadOnlyMode = True
End If
« Last Edit: September 20, 2021, 05:29:37 pm by cyberjedi »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #9 on: September 19, 2021, 12:32:11 pm »
Rem Type=Plugin
Rem Name=MKV
Rem Author=modded by cyberjedi
Rem Host=Assistant



'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
'------------------
' Define the Help
'------------------
    lblPlugin(0).Caption = "Hal will be able to play your favorite movies. Click below for more info"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
    cmdPlugin(0).Move 320, 650, 2100, 375
    cmdPlugin(0).Caption = "Help on this plugin"
    cmdPlugin(0).Visible = True
'------------------
' Define the Musical Mood listbox
'------------------
    lblPlugin(1).Caption = "Hal Movie Mood level"
    lblPlugin(1).Move 320, 1300, 4000, 1000
    lblPlugin(1).WordWrap = True
    lblPlugin(1).Visible = True   
    cboPlugin(0).Move 320, 1600, 1800
    cboPlugin(0).AddItem "Very high"
    cboPlugin(0).AddItem "High"
    cboPlugin(0).AddItem "Average"
    cboPlugin(0).AddItem "Low"
    cboPlugin(0).AddItem "No Movie
    cboPlugin(0).Visible = True
    cmdPlugin(1).Caption = "Apply Changes"
    cmdPlugin(1).Move 320, 2100, 1600, 375
    cmdPlugin(1).Visible = True
'------------------
' Update the listbox with the current value stored in the table
'------------------
    If HalBrain.CheckTableExistence("vrParameter") = True Then
      vrMovieMood = HalBrain.TopicSearch("Movie", "vrParameter")
      If vrMovieMood = "" Then vrMovieMood = 1
     Select Case vrMovieMood
           Case 8
            cboPlugin(0).Text = "Very high"
           Case 5
                cboPlugin(0).Text = "High"
           Case 2
               cboPlugin(0).Text = "Average"
           Case 1
             cboPlugin(0).Text = "Low"
           Case 0
                cboPlugin(0).Text = "No movie"
        End Select
    End If
End Sub

Sub cmdPlugin_Click(Index)
Dim vrTempQuery()
Dim vrMovie, vrMovieMood
Select Case Index
      Case 0
                  HalMenu.HalCommand "<RUNPROG>vrMKVHelp.html</RUNPROG>"
       Case 1
'------------------
' Convert the listbox in a value
'------------------
     Select Case cboPlugin(0).Text
           Case "Very high"
            vrMovieMood = 8
           Case "High"
            vrMovieMood = 5
           Case "Average"
            vrMovieMood = 2
           Case "Low"
            vrMovieMood = 1
           Case "No Movie"
            vrMovieMood = 0
        End Select
'------------------
' If the Parameter table does not exist, I create it
'------------------
          HalBrain.ReadOnlyMode = False
      vrTableName =    "vrParameter"    
      If HalBrain.CheckTableExistence(vrTableName) = False Then
      'Create table if it doesn't exist
         HalBrain.CreateTable vrTableName, "TopicSearch", "miscData"
      End If
'------------------
' Search if it contains the MovieMood parameter
'------------------
        vrMovie = "MOVIE"
      If HalBrain.TopicSearch(vrMusic, vrTableName) = "" Then
'------------------
'Creates the record storing the new value
'------------------
         HalBrain.AddToTable vrTableName, "TopicSearch", vrMovie, vrMovieMood
      Else
'------------------
'Updates the record storing the new value
'------------------
           HalBrain.RunQuery "UPDATE " & vrTableName & " SET topic = " & vrMovieMood & " WHERE searchString = " & """" & vrMovie & """", vrTempQuery
        End If
   End Select
End Sub


Rem PLUGIN: PLUGINAREA1
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.

'------------------
' Check if the user asked for reorganizing the MKV table
'------------------
vrMKV = False
If InStr(UserSentence, " INDEX ") <> 0   And InStr(UserSentence, " MKV ") <> 0 Then vrMKV = True

If vrMKV = True Then
'------------------
' If the MKV table does not exist, I create it
'------------------
      HalBrain.ReadOnlyMode = False
   vrTableName =    "vrMKV"    
   If HalBrain.CheckTableExistence(vrTableName) = False Then
   ' Create table if it doesn't exist
   ' It must be of type Brain, to allow partial text search
      HalBrain.CreateTable vrTableName, "Brain", "miscData"
    Else
   ' The 260 parameter is 256 + 4 = Yes/No with Default = No
      vrAnswer = MsgBox("Shall I delete the existing index and recreate it from scratch?", 260, "MKV Reindexing")
      If vrAnswer = 6 Then
           HalBrain.RunQuery "DELETE FROM " & vrTableName, vrTempQuery
      End If
   End If
'------------------
' Ask which is the main MKV folder
'------------------
vrMKVFolder = InputBox("Which main folder to you want to reindex?", "MKV Reindexing", "c:\MKV")
'------------------
' Read the main MKV folder
'------------------
   Set vrFso = CreateObject("Scripting.FileSystemObject")
   If vrFso.FolderExists(vrMKVFolder) Then
        GetResponse = "I have indexed all the MKV files in the specified folder and subfolders. "
        HalBrain.ReadOnlyMode = False
      vrCurrentFolder = vrMKVFolder
      Call ReadFolder(vrCurrentFolder, vrMKVFolder)    
   Else
      GetResponse = "The folder " & vrMKVFolder & " does not exist on your computer. "
   End If
   HalBrain.ReadOnlyMode = True
End If

'------------------
' Check if the user asked for playing a MOVIE
'------------------
vrMKV = False
vrToPlay = ""
vrNameToPlay = ""
vrToPlay = UCase(HalBrain.SearchPattern(UserSentence, "PLAY * MOVIE *", 2))
If vrToPlay <> "" Then
   If HalBrain.CheckTableExistence("vrMKV") = False Then
          GetResponse = "I don't find any MKV index in our brain. "
   Else
     vrNameToPlay = HalBrain.QABrain(vrToPlay, "vrMKV", 0)
     If vrNameToPlay <> "" Then
          GetResponse = " "
          HalCommands = HalCommands & "<RUNPROG>" & vrNameToPlay & "</RUNPROG>"
     End If
   End If
   HalBrain.ReadOnlyMode = True
End If

'------------------
' From time to time, Hal will play a movie, according to some word you say
' For example, you say: "I am going to California"
' Hal will play "California Dreaming"
'------------------
'------------------
' check the current movie mood factor
'------------------
vrMovieMood = HalBrain.TopicSearch("MOVIE", "vrParameter")
If vrMovieMood = "" Then vrMovieMood = 0
vrMovieMood = CInt(vrMovieMood)

If vrMovieMood > 0 Then
   j = Int(Rnd * 10) ' generate a random integer between 0 and 9
   If j < vrMovieMood Then
         vrKeywords = HalBrain.RemoveExtraSpaces(HalBrain.ExtractKeywords(" " & UserSentence & " "))
           vrKeywordList = Split(vrKeywords, " ")
         For i = Ubound(vrKeywordList) To Lbound(vrKeywordList)
           vrNameToPlay = HalBrain.QABrain(vrKeywordList(i), "vrMKV", 0)
             If vrNameToPlay <> "" Then
                  GetResponse = "You talked about " & vrKeywordList(i) & " and this reminds me this movie. "
                  HalCommands = HalCommands & "<RUNPROG>" & vrNameToPlay & "</RUNPROG>"
             Exit For
            End If
         Next
    End If
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.

Function ReadFolder(vrCurrentFolder, vrMKV Folder)
Set vrFso = CreateObject("Scripting.FileSystemObject")
Set vrFolder = vrFso.GetFolder(vrCurrentFolder)
'------------------
' Read all the files in the current folder
'------------------
Set vrFiles = vrFolder.Files
For Each vrFile in vrFiles
'------------------
' It's an MKV file; I add it to the table
'------------------
   If UCase(Right(vrFile, 3)) = "MKV" Then
     vrSong = Ucase(vrFile)
      vrSong = Replace(vrSong, ".MKV", "")
     vrLen = Len(vrSong)
     vrPos = InStrRev(vrSong, "\")
      vrRight = vrLen - vrPos
       vrSong = LTrim(Right(vrSong, vrRight))
        HalBrain.AddToTable "vrMKV", "Brain", vrSong, vrFile
   End If
Next
'------------------
' Read all the subfolders in the current folder
'------------------
Set vrSubFolders = vrFolder.SubFolders
For Each vrFolderObject in vrSubFolders
'------------------
' Pay attetion here: This is recursive! We must be sure that it will get to an end
' Since we are reading directories on a hard disk, the number of recursions
' should never be infinite. However, a very big number of subfolders and files
' might lead to memory problems or to performances bottlenecks.
' I've tested it on a folder containing about 100 subfolders and 3.000 files,
' and got acceptable performances (less than 5 minutes)
'------------------
   Call ReadFolder(vrFolderObject, vrMKVFolder)    
Next

End Function




   


« Last Edit: September 19, 2021, 12:35:46 pm by cyberjedi »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #10 on: September 19, 2021, 12:37:45 pm »
Rem Type=Plugin
Rem Name=Magic 8 Ball plug in v1
Rem Author= SystemShock
Rem Host=Assistant


'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "a magic 8 ball toy ...triggered by ..play magic eight ball"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
    cmdPlugin(0).Move 800, 1300, 2100, 375
    cmdPlugin(0).Caption = "build one"
    cmdPlugin(0).Visible = True
End Sub



'-------------------------------------------------------------------------------------------------------
Rem PLUGIN: CUSTOMMEM2
    'The comment above tells Ultra Hal Assistant to insert the following code
    'on-the-fly into the main brain code in the section referenced.
'------------------
' Variables Setup
' all my variables have the prefix EIGHTball for this plugin. ;)
'------------------
DiagnosticsrSentence = LCase(UserSentence)
EIGHTballFile    = ""
EIGHTballHalCommands    = ""
Diagnostics   =""

'------------------
' plug in bit...;) useing variables set up^^^^^ there^^^^^
'  Diagnostics
'------------------
If InStr(1, OriginalSentence, "eight ball", 1) >0 Then Diagnostics = "True"
   
'Here we can add accociated responses to the above triggers.
If Diagnostics = "True" Then
   GetResponse = "focus on your question, are you ready to play magic eight ball boss? "
End If
   
If PrevSent = "focus on your question are you ready to play magic eight ball boss?" Then
   If Yes(OriginalSentence) = True Then GetResponse = "OK Boss her we go, and the magic eight ball says?"
   ' ball code goes here mate
   Select Case HalBrain.RandomNum(21)
   Case 1 GetResponse = "It is certain" & vbCrLf
   Case 2 GetResponse = "It is decidedly so" & vbCrLf
   Case 3 GetResponse =  "Without a doubt" & vbCrLf
   Case 4 GetResponse = "Yes ? definitely" & vbCrLf
   Case 5 GetResponse = "You may rely on it" & vbCrLf
   Case 6 GetResponse = "As I see it, yes" & vbCrLf
   Case 7 GetResponse = "Most likely" & vbCrLf
   Case 8 GetResponse = "Outlook good" & vbCrLf
   Case 9 GetResponse = "Yes" & vbCrLf
   Case 10 GetResponse = "Signs point to yes" & vbCrLf
   Case 11 GetResponse = "Reply hazy, try again" & vbCrLf
   Case 12 GetResponse = "Ask again later" & vbCrLf
   Case 13 GetResponse = "Better not tell you now" & vbCrLf
   Case 14 GetResponse = "Cannot predict now" & vbCrLf
   Case 15 GetResponse = "Concentrate and ask again" & vbCrLf
   Case 16 GetResponse = "Don't count on it" & vbCrLf
   Case 17 GetResponse = "My reply is no" & vbCrLf
   Case 18 GetResponse = "My sources say no" & vbCrLf
   Case 19 GetResponse = "Outlook not so good" & vbCrLf
   Case 20 GetResponse = "Very doubtful" & vbCrLf
   Case 21 GetResponse = "oh,**** I dropped it, sorry boss!" & vbCrLf
   End Select
Else
   If No(OriginalSentence) = True Then GetResponse = "OK i put it away then Boss."
   If Maybe(OriginalSentence) = True Then GetResponse = "if that the case I put it away ask me again some time. "
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 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
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

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #11 on: September 20, 2021, 02:24:00 pm »
Rem Type=Plugin
Rem Name= forexlive
Rem Author= cyberjedi
Rem Host=All



Rem PLUGIN: PRE-PROCESS
    '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.

HalBrain.ReadOnlyMode = False
'Determines that you are talking about the Forex stock updated hourly
If InStr(1,InputString, "forex",1) > 0 Then
 UltraHal = Getforex(HalCommands)
ElseIf InStr(1,InputString, "forex",1) > 0 Then
 End If

 ' This bad boy is a Forex Scraper with a twist, All the data Scraped is ported through Hals Voice.  It took cyberjedi to pull it off. Enjoy. 
    ' This also Breaks Hals speech limitations on how much he can say. 
 ' Trigger= forex
     'I put this together while listening to this. -->>>https://www.youtube.com/watch?v=aqXW57WM9TA
 
 ' I give myself about a 7.5 on cool ideas here


Rem PLUGIN: FUNCTIONS
Function Getforex(HalCommands)

Const SVSFlagsAsync = 1
Const DontShowWindow = 0
Const WaitUntilFinished = 1
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Sapi = CreateObject("SAPI.SpVoice")
   For Each Voice In Sapi.GetVoices
       i = i + 1
   Next
For loopvar = 0 to i-1
if loopvar = CInt(confirm_voice) then
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
end if
Next
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
HalMenu.HalCommand "<SPEAK>" & "Reading headlines !" & "</SPEAK>"
For loopvar = 0 to 2
If tempconfirm = loopvar then
if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines" & "</SPEAK>"
else if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Okay ." & "</SPEAK>"
wscript.quit
else
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines " & "</SPEAK>"
end if
end if
xmlDoc.async = false
xmlDoc.load("http://www.forexlive.com/feed/technicalanalysis") ' This is where u put you own rss feed .xml
Set nodelist = xmlDoc.selectNodes("rss/channel/item")
i = 3
For Each item In nodelist
Set f1 = item.selectsinglenode("title")
Set f2 = item.selectsinglenode("description")
HalMenu.HalCommand "<SPEAK>" & f1.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
HalMenu.HalCommand "<SPEAK>" & f2.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
i = i + 1
if i = tempconfirm then
wscript.Quit
end if
Next
end if
Next
End Function
« Last Edit: September 20, 2021, 05:27:48 pm by cyberjedi »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Old School hal plugins
« Reply #12 on: September 21, 2021, 11:31:02 am »
« Last Edit: September 21, 2021, 11:33:12 am by cyberjedi »

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Old School hal plugins
« Reply #13 on: October 09, 2021, 11:09:38 am »
although this is late , seems everything has been going on lately . thanks for taking the time to post these old school plug ins on here. it's appreciated all that you do .  :)