Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: Bill DeWitt on March 08, 2007, 04:25:26 pm

Title: Adjust Volume
Post by: Bill DeWitt on March 08, 2007, 04:25:26 pm
Adjust Volume ("http://ultrahalscript.pbwiki.com/Adjust%20Volume")

Please test this on a fast computer, it runs a "Taking too long" error when I use it, but then it works. It still needs some cleaning up, and I have some improvements in the works already, but I wanted to make sure others could use it first.

I think my problem is that it takes my computer so long to activate the volume control applet. I have a fairly slow computer (1GHz) and I run a lot of other junk all the time.

Call it AdjustVolume.uhp and say "Please turn up the volume" etc. Should work for "turn up, turn down, mute and restore" with more variations possible. I'm thinking "Crank it!"
Title: Adjust Volume
Post by: PaleRider on March 08, 2007, 07:11:00 pm
Sorry bill it's not working on my Laptop Duo core 1.66GHz 667MHz 1024MB get( Error)
Hal script error 13 on line 4929 in column 8 Type mismatch "CDBL". Soon as i type please turn volume i get error used all words up, down, mute, restore. I tried my friend.

Hope this helps you've done lots for me. [:)]

And I'll try again for you, if you can find out what it is.[:D]
Title: Adjust Volume
Post by: Bill DeWitt on March 08, 2007, 08:33:36 pm
quote:
Originally posted by PaleRider
Hal script error 13 on line 4929 in column 8

Do you have a way to open your HalScript.dbg and find that particular line? If so, I would like to see it and a few lines before and after it. I can give better instructions for doing that if you need it.

Also, from your post I wonder if you are using the right order of terms. You must, in this version, say "Please turn up the volume", and not "Please turn the volume up".

Maybe you could try something simple like "Please mute audio" and let me know. Thanks.
Title: Adjust Volume
Post by: Bill DeWitt on March 08, 2007, 09:17:29 pm
I found this thread which may help with your problem, if not, let me know. The issue with CDBL has been discussed in several threads if you want to do a search.

http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3389
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 08:37:53 am
I'll get back to you after 1:30 Pm today Fri at work right now, but I did try Please turn up the Volume but got error again
will check out thread after. it's 8:35 am now Canada time [:D]

Heres what i got today
                        Hal Script Error -2147024894 on line 3797 in colum 0:
yes made mistake earlier please turn up the volume is what I should have wrote.
also the post before with the hal script error was because hal would not shut down. the script error above is after I type
Please turn up the volume sorry for the mix up.Was busy at work phones ringing ,drivers radios going off crazy Fridays sorry about that home now lots of time to do this now thanks for waiting.
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 02:23:32 pm
quote:
Originally posted by PaleRider
Hal Script Error -2147024894 on line 3797 in colum 0:


Can you post that line of code out of HalScript.dbg? Then I will be able to see what part of the program is giving you trouble. Maybe a few lines above and below line 3797. It's probably something simple, but I need to know where to look.
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 02:27:18 pm
I'll get right on it.
[:D]

Bill  I opened it in note pad and it's not numbered so line 3797 could take me a long time to count
 if you have a program to do this my e-mail address is hwyman84@rogers.com sent me e-mail i sent it right to you 292kb.
Title: Adjust Volume
Post by: lou33 on March 09, 2007, 02:57:19 pm
You can navigate to the line by using Notepad menu Edit-Goto or <ctrl>G.  and typing in the line number you want.
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 03:03:27 pm
Odd...

Your copy seems to say:
Code: [Select]
WshShell.Run "C:WINNTsystem32sndvol32.exe", 9
But mine says:
Code: [Select]
WshShell.Run "C:\WINNT\system32\sndvol32.exe", 9
There may be other backslashes missing, so if you want, I will send you a zip of the script.
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 03:26:36 pm
yes please do I'll replace it in file.[:D]



Also Thank you Lou33 for that Info.[:D]
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 03:26:42 pm
I see what is happening now, and I am surprised it didn't show up before... maybe people thought it just wasn't working..

The PBWiki page claims to use a <verbatim> tag, but when you copy and paste out of that tag, you lose some characters. I will start going through and reposting zips of code.

I apologize with the inconvienence.
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 03:36:41 pm
quote:
Originally posted by PaleRider

yes please do I'll replace it in file.[:D]


I have linked a zip file to the original page ("http://ultrahalscript.pbwiki.com/Adjust%20Volume") and will rework my whole site to correct this problem.
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 03:47:30 pm
Yes I replaced the missing slashes , and started hal again tried please turn up the volume again error. So I checked line 3797
and slashes were gone again. Thanks Lou33 for that short cut.



Bill the new file you just e-mailed me is doing the same thing line 3797
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 04:22:26 pm
quote:
Originally posted by PaleRider
 is doing the same thing line 3797



If you have some time, examine the actual plugin and see if it has the slashes. Open it in notepad and check it against the lines below:

Code: [Select]
Well, now the code tags here don't seem to work as I expect them to Here is what the call to volume control should look like:
Code: [Select]
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "C:\WINNT\system32\sndvol32.exe", 9
Do While WshShell.AppActivate("Volume Control")=0
Loop
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 04:34:02 pm
I just discovered that editing your post removes double backslashes!

I hope this works out somehow. If this works, I have a bunch of things that Hal can do which seem unavailable now. Thanks for hanging in with me on this.

Hopefully it's just an editing problem, and not a script incompatability.
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 05:29:20 pm
OK, second proplem is that XP and Win98 use the C:\Windows\System32 directory for Volume Control. W2K uses \WINNT\

For now, anyone who wants to use this will have to re-edit it for the correct path. I will fix this after I get back from going out tonight.
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 05:51:01 pm
Yes the plugin matches .

thats me XP

Ok bill I copy and pasted the other file you sent and that fixed line 3797.
Ran hal typed please turn up the volume and the master windows control volume panel came up closed that down
and got hal scrpit error line 3798 which is this: Do While WshShell.AppActivate("Volume Control")=0
Loop[:)] Then I have another little box come up saying scrpit to long would you like to end or continue with this reading.
[:)]
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 09:39:40 pm
quote:
Originally posted by PaleRider
Ran hal typed please turn up the volume and the master windows control volume panel came up
closed that down

Wait, did you close it down or did it close itself?
quote:

 Then I have another little box come up saying scrpit to long would you like to end or continue with this reading.


Urg... that's the error I was hoping not to see, but if you closed down the Volume Control, try it again without closing that. It has to be open for Hal to change the volume.
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 09:53:22 pm
The original links should now hold a new version which can find the right files in both Win2000 and XP
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 10:03:52 pm
I had to close it was only way I could get hal bodygirl under control the words please turn up the volume would not disappear and enter key did nothing. trying again before I post. Can't do it have to reboot system says hal is running but I shut down after the last test . That only happin's to me when using newer plugins, that's why I have a few plugins I can't use. So Bill I'am glad to be your tester today or what ever it takes to make it work .[:D]
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 10:22:16 pm
quote:
Originally posted by PaleRider

I had to close it was only way I could get hal bodygirl under control the words please turn up the volume would not disappear and enter key did nothing.


Yeah, see, it's taking too long and so naturally you did something and once you do something (anything) it removes focus from the volume control and then Hal can't send keystrokes to the program. Probably if you just waited long enough it might work, but that's not the way I want this to function. I wanted it to turn down the volume directly, but this work around seems to be a poor solution.

I may have to abandon this one for now. Maybe I can find a more direct way of adjusting the volume, although I doubt it can be done in VBScript.
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 10:47:00 pm
I rebooted then started Hal bodygirl typed in please turn up volume  volume panel came up waited....went out back with dog had a smoke  10 minutes are so came back pointer still busy hal box came up 10 times nothing would close so I did a ctrl...alt....del job and ended hal. [:D]
Title: Adjust Volume
Post by: Bill DeWitt on March 09, 2007, 11:01:44 pm
Urg... that's no good....

Oh well, it was just an experiment anyway. Thanks for helping.

I'm sure there is a better way to do this but I can't think anymore.

I'll go back to working on the Shopping list instead... Bummer.[:(] I often want to turn down the volume when I'm not at the computer and it would be nice to just ask Hal to do it for me.
Title: Adjust Volume
Post by: PaleRider on March 09, 2007, 11:34:03 pm
Yea Bill but you tried and that's what counts, Thanks for the testing job, I learned a lot today so your pride should be high
this newbie me just got a little less green. Thank you [:D][:D][:D][:D][:D]