Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - knight2000

Pages: 1 2 [3] 4 5 ... 11
31
I would like to control Hal's mic after Hal has started up using the command line. The following code works fine if Hal is not running

"C:\Program Files (x86)\Zabaware\Ultra Hal 7\UltraHal7.exe" <SHOWHAL><MICON>"

Hal i will start with his mic enabled

However if Hal is already running he ignores any command line arguments.

Is there a way around this?

32
Ultra Hal 7.0 / Re: Tell Hal to stop listening?
« on: March 27, 2019, 10:08:12 am »
Thats a cool utility, but my problem is that once Hal is running, the command line args do not work. If i exit hal then run my python program, Hal starts up with the mic enabled. Sorry, i probably should have said that before. So even if i pull up a command prompt and execute C:\Program Files (x86)\Zabaware\Ultra Hal 7\UltraHal7.exe <SHOWHAL><MICON> while Hal is already running, his mic doesn't come on. I have to exit Hal completely in order for that command to work.


33
Ultra Hal 7.0 / Re: Tell Hal to stop listening?
« on: March 26, 2019, 10:22:15 am »
Im using the vrMP3 plugin but i altered the code to grab the length of the song. See below

Code: [Select]
If vrToPlay <> "" Then
   If HalBrain.CheckTableExistence("vrMp3") = False Then
        GetResponse = "I dont have that song on file. "
   Else
     vrNameToPlay = HalBrain.QABrain(vrToPlay, "vrMp3", 0)
     If vrNameToPlay <> "" Then
        GetResponse = "Here you go! "
'HalCommands = HalCommands & "<MICOFF>"
Set objWSHShell = CreateObject("WScript.Shell")
    objWSHShell.Run(""""& vrNameToPlay &"""")
pos = InStrRev(vrNameToPlay, "\") +1
file = Mid(vrNameToPlay, pos)
Const LENGTH = 27
Dim oShell  : Set oShell  = CreateObject("Shell.Application")
Dim oFolder : Set oFolder = oShell.Namespace("C:\Users\vyaco\Desktop\Hal\music")
Dim oFile : Set oFile = oFolder.ParseName(file)
Dim strLength : strLength = oFolder.GetDetailsOf(oFile, LENGTH)
param1 = "music"
param2 = strLength
objWSHShell.Run hal_commands & param1 & " " & param2
     End If
   End If
   HalBrain.ReadOnlyMode = True
End If

The last line runs the python script and sends params.
Code: [Select]
objWSHShell.Run hal_commands & param1 & " " & param2
This is my python snippet for toggling Hal's mic
Code: [Select]
##PLAY A SONG
if command == "music":
command2 = sys.argv[2]
##Mbox('debug', command + " " + command2, 1)
subprocess.Popen([r'C:\Program Files (x86)\Zabaware\Ultra Hal 7\UltraHal7.exe', '<SHOWHAL><MICOFF>'])
t = command2
h,m,s = re.split(':',t)
print int(datetime.timedelta(hours=int(h),minutes=int(m),seconds=int(s)).total_seconds())
duration = int(datetime.timedelta(hours=int(h),minutes=int(m),seconds=int(s)).total_seconds())
##print command2
voice = open(voice_modulator,"w")
voice.writelines("turnoff")
voice.close()
##Mbox('duration', str(duration), 0)
time.sleep(duration)
voice = open(voice_modulator,"w")
voice.writelines("turnon")
voice.close()
subprocess.Popen([r'C:\Program Files (x86)\Zabaware\Ultra Hal 7\UltraHal7.exe', '<SHOWHAL><MICON>'])

So i need to be able to control Hal's mic via python

34
Ultra Hal 7.0 / Re: Tell Hal to stop listening?
« on: March 25, 2019, 06:28:47 pm »
Thats a good plugin but i need to be able to control Hal's mic externally.  Example would be if I tell Hal to play a song i would want Hal to turn off his mic while the song is playing then when the song is over turn his mic back on. I have a python script that will get song's length, i want to be able to use python to execute "Ultrahal.exe <SHOWHAL><MICON>" using the command prompt after the song ends. The problem is if Hal is already open, calling Ultrahal.exe <SHOWHAL><MICON> will only show Hal and not enable his mic :(

Any idea's on how to make something like this work?


35
Ultra Hal 7.0 / Re: How to add a timer in Hal script?
« on: March 05, 2019, 02:29:15 pm »
I'll check it out

36
Ultra Hal 7.0 / Re: How to add a timer in Hal script?
« on: March 04, 2019, 04:38:38 pm »
Thanks for the reply Art! How does this code constantly check the values. Would this code be wrapped in a loop?

37
Ultra Hal 7.0 / How to add a timer in Hal script?
« on: March 04, 2019, 10:15:04 am »
I need to add a countdown timer in a Hal plugin im creating, but it doesn't seem that WScript.Sleep is available within Hals script. Not sure why but i get an object error. Has anyone tried working with timers in Hal's script before? I want something like the following:

WScript.Sleep 5000
HalCommands = HalCommands & "<MICOFF>"

So after 5 seconds turn off Hal's mic.


38
Ultra Hal 7.0 / Re: Tell Hal to stop listening?
« on: February 28, 2019, 10:22:28 am »
Thanks for the response! I was hoping there was also a programmatic way of having Hal stop listening but I assume <MICON> and <MICOFF> would work.

39
Ultra Hal 7.0 / Tell Hal to stop listening?
« on: February 27, 2019, 10:58:53 am »
Hi Guys,

Is there a command like <MICON> to have Hal stop listening? When I have speech recognition on and i tell Hal to play a song, i'd like him to stop listening, otherwise he responds to the song lyrics haha. If i turn the mic off then i cant turn it back on unless i type it in. I was hoping for some kind of command (function) to execute when i tell Hal to play a song then when the song is done i can say "start listening". Im pretty sure there is something like this already but i'm not sure what it was  :-\

40
Ultra Hal 7.0 / Re: Robert - Starting Hal with microphone enabled?
« on: February 27, 2019, 10:41:03 am »
Yes, that will work

41
Ultra Hal 7.0 / Re: Robert - Starting Hal with microphone enabled?
« on: February 27, 2019, 09:32:41 am »
Robert gave me the solution for this. Its not something you add to the code, instead you can change the parameters of Hal's shortcut in the "startup" folder to include: <SHOWHAL><MICON>

That worked perfectly! Hal starts up and is listening when my computer boots up. This work great for my application which is installed in a vehicle, its not convenient for me to have to grab the keyboard, go in to the computer and enable Hal.

Thanks Robert!

42
Ultra Hal 7.0 / Robert - Starting Hal with microphone enabled?
« on: February 11, 2019, 09:30:48 am »
Hey Robert,

Would it be possible to add a flag in the registry or somewhere that will allow Hal to start with his mic enabled. I'd love to just have my computer boot up and not have to click the mic button on Hal.

43
Yes i tried that and still no luck. I even tried changing to the Microsoft speech engine and it still just minimizes to the tray and the mic is off.

44
Ultra Hal 7.0 / Problems with starting Hal with his microphone enabled
« on: February 08, 2019, 01:28:35 pm »
Hi guys,

I'm trying to start Hal with his microphone enabled. My goal is to be able to just start talking to Hal when Windows boots up. The code below is what i'm working with thanks to OnTheCuttingEdge2005. Currently Hal will pop up on Windows start up with his mic enabled however a few seconds later he minimizes to the tray, when this happens the mic is disabled, and when i click on the tray icon to open Hal the mic is still disabled. Any thoughts? I'm using dragon 12.5 as my speech engine.

Code: [Select]
'Rem Type=Plugin
'Rem Name=Auto ON Microphone
'Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
'Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Auto ON Microphone"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

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

'LETS LAUNCH THE MICROPHONE ON START UP OF WINDOWS.
Script_Load = ShowHal() & Microphone()



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.

'SHOW HAL'S PANEL FOR MIC COMMAND SCRIPT LOAD.
Function ShowHal()
ShowHal = HalCommands & "<SHOWHAL>"
End Function

'LETS ENGAGE IN THE MICROPHONE ACCESSORY AND SHOW HAL PANEL.
Function Microphone()
Microphone = HalCommands & "<MICON>"
Exit Function
End Function

45
General Discussion / Re: HAL ASKING ARE YOU A MAN OR A WOMAN ETC.
« on: July 12, 2018, 12:09:15 pm »
This happens to me a lot. For me its due to not having the user selected. I have to go in and select my profile as the current user and that fixes the issue. Not sure if you already looked at that but i thought I'd throw it out there. Good luck

Pages: 1 2 [3] 4 5 ... 11