Zabaware Support Forums

Zabaware Forums => Ultra Hal Assistant File Sharing Area => Topic started by: lightspeed on September 26, 2011, 02:58:42 pm

Title: correct additional random hal hapswap command script needed
Post by: lightspeed on September 26, 2011, 02:58:42 pm
i wanted to ask oncutting edge or someone that does code scripting what the correct way would be to write an additional random playing ogg files command.

example i have :

HalCommands = "<HAPFILE>blowingnose.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If

this is at the end of a random saying file triggered by certain words (not shown)

what i am wondering is how can the above (highlighted in blue ) command be made to allow random ogg sounds so that i can put different blowing nose sounds so it isn't the same nose blowing sound each time,


any help on this would be appreciated i am trying to work more on the hapswap files i started .  :)
Title: Re: correct additional random hal hapswap command script needed
Post by: HALImprover on October 17, 2011, 07:00:47 pm
You could simply append a number to the end of the file name (ie. blowingnose1.ogg, blowingnose2.ogg, etc.), generate a random number in your script, and have Hal run that random file (making sure not to generate a larger number than you have files). There are many other ways, but that would be the simplest way I think.

Happy coding!