Re: Could you please help me figure out what i'm doing wrong?

"Philip Bennefall" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <001901c6fbce$bec9d190$5f9d42d5@Pbgames>
Jodie,

It's not a good idea to use HotKeySet in a game. The problem with the 
HotKeySet function is that it doesn't allow the program to determine if the 
user is holding down a key or not. If they do, the function will just be 
called over and over and over again. With the key function I sent to you and 
which also is included in the menu code, you can actually make sure that the 
user does not hold down the key. In some cases you might want to allow them 
to do that, but at least you have a choice.
The menu code is fully dynamic, you can use a variable to pass the file 
name(s) to the menu, so you can pass it different file names depending on 
the situation in the game. If you need examples, talk to me on msn or just 
reply to this message.

Regards
Philip Bennefall
----- Original Message ----- 
From: "damien c. sadler" <[email protected]>
To: <[email protected]>
Sent: Monday, October 30, 2006 3:26 AM
Subject: Re: [AutoIt] Could you please help me figure out what i'm doing 
wrong?


> no, you just add as many items as you want. for example:
>
> create_audio_menu("audio/speech/menu/main/main.ogg","audio/speech/menu/main/
> 1.ogg,audio/speech/menu/main/2.ogg,audio/speech/menu/main/3.ogg,audio/speech
> /menu/main/4.ogg,audio/speech/menu/main/5.ogg")
> you could have three, five, ten, twenty, fifty or a hundred items should 
> you
> so wish.
>
> hth.
>
> regards,
>
> damien
>
>
>
> ----- Original Message -----
> From: "Jodie and Tiger" <[email protected]>
> To: <[email protected]>
> Sent: Friday, October 27, 2006 3:44 PM
> Subject: Re: [AutoIt] Could you please help me figure out what i'm doing
> wrong?
>
>
>> Hi Damian. Is there a way to nmake the menu items variable like a wild
> card.
>> I mean, if you have more than three items, but you want the library to
>> reflect that your menu item numbers are subject to change, can you do
> that,
>> or do you have to modify the menu library each time you want to change 
>> the
>> number of menu items? Thanks, and I hope that makes sense.
>>
>> Hugs from Jodie and kisses from Tiger.
>> :)
>> "Belief is the cradle of myth."
>> Stephen King
>>
>>
>> ----- Original Message -----
>> From: "damien c. sadler" <[email protected]>
>> To: <[email protected]>
>> Sent: Friday, October 13, 2006 3:52 AM
>> Subject: Re: [AutoIt] Could you please help me figure out what i'm doing
>> wrong?
>>
>>
>> > if you are using jaws you must unload it for the menu. i had that
> problem
>> > once.
>> > how i would create a menu without doing a key check and using a
> hotkeyset
>> > is
>> > create functions like up, down, select, in the following manner:
>> >
>> > global $menu_item=1
>> > hotkeyset("{up}","move_up")
>> > hotkeyset("{down}","move_down")
>> > hotkeyset("{enter}","select_item")
>> > ;ok, so let's now assume you have three menu items
>> > func move_up()
>> > if $menu_item=1 then
>> > $menu_item=3
>> > else
>> > $menu_item-=1
>> > endif
>> > play_item($menu_item)
>> > endfunc
>> > func move_down()
>> > if $menu_item=3 then
>> > $menu_item=1
>> > else
>> > $menu_item+=1
>> > endif
>> > play_item($menu_item)
>> > endfunc
>> > func select_item()
>> > if $menu_item=1 then start()
>> > if $menu_item=2 then test()
>> > if $menu_item=3 then quit()
>> > endfunc
>> > func start()
>> > ;code goes here ...
>> > endfunc
>> > func test()
>> > ;code goes here ...
>> > endfunc
>> > func quit()
>> > exit
>> > endfunc
>> > func play_item($menu_index=1)
>> > if $menu_index=1 then soundplay(@scriptdir &
>> > "\sounds\speech\menu\1.wav",1)
>> > if $menu_index=2 then soundplay(@scriptdir &
>> > "\sounds\speech\menu\2.wav",1)
>> > if $menu_index=3 then soundplay(@scriptdir &
>> > "\sounds\speech\menu\3.wav",1)
>> > endfunc
>> >
>> >
>> > hth.
>> >
>> > regards,
>> >
>> > damien c. sadler - x-sight interactive manager
>> > (http://x-sight.brandoncole.net)
>> >
>> >
>> > ----- Original Message -----
>> > From: "Jodie and Tiger" <[email protected]>
>> > To: <[email protected]>
>> > Sent: Thursday, October 12, 2006 4:11 PM
>> > Subject: Re: [AutoIt] Could you please help me figure out what i'm 
>> > doing
>> > wrong?
>> >
>> >
>> >> Yeah, it is, but he's so busy it's hard to get a hold of him. Would 
>> >> you
>> > have
>> >> any idea how I can do this? I understand the $catp part of the key
>> >> handle,
>> >> but it doesn't work with the hot key sets I have in the code for my
> main
>> >> file and I can't get the $capt to work in that one.
>> >>
>> >> Hugs from Jodie and kisses from Tiger.
>> >> :)
>> >> "Belief is the cradle of myth."
>> >> Stephen King
>> >>
>> >>
>> >> ----- Original Message -----
>> >> From: "damien c. sadler" <[email protected]>
>> >> To: <[email protected]>
>> >> Sent: Thursday, October 12, 2006 2:41 AM
>> >> Subject: Re: [AutoIt] Could you please help me figure out what i'm
> doing
>> >> wrong?
>> >>
>> >>
>> >> > you can't set a hotkey to a function that contains parameters.
>> >> >
>> >> > out of interest, is that philip bennefall's menu code?
>> >> >
>> >> > regards,
>> >> >
>> >> > damien
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > ----- Original Message -----
>> >> > From: "Jodie and Tiger" <[email protected]>
>> >> > To: <[email protected]>
>> >> > Sent: Wednesday, October 11, 2006 6:08 PM
>> >> > Subject: [AutoIt] Could you please help me figure out what i'm doing
>> >> > wrong?
>> >> >
>> >> >
>> >> >> Hi. I'm trying to make a less complicated library than I have using
>> >> > hotkeyset, but I can't seem to get it to work. From this code, could
>> >> > someone
>> >> > help me figure out what I'm missing? Thanks in advance.
>> >> >>
>> >> >> #include-once
>> >> >> HotKeySet("{up}", "create_audio_menu")
>> >> >> HotKeySet("{down}", "create_audio_menu")
>> >> >> HotKeySet("{enter}", "create_audio_menu")
>> >> >> Func create_audio_menu($description,$options)
>> >> >> If $description = "" Then return 0
>> >> >> If $options = "" Then return 0
>> >> >> $selection = 0
>> >> >> $items = StringSplit($options,",")
>> >> >> If @Error Then return 0
>> >> >> $menu_length = $items[0]
>> >> >> $menu = $device.OpenSound($description & "",true)
>> >> >> $menu.Play()
>> >> >> While 1
>> >> >> $active_window = WinGetProcess("")
>> >> >> If $active_window = @AutoItPid Then
>> >> >> Else
>> >> >> Sleep(10)
>> >> >> ContinueLoop
>> >> >> EndIf
>> >> >> If $selection > 0 Then
>> >> >> $menu = ""
>> >> >> return $selection
>> >> >> EndIf
>> >> >> If $selection < 1 Then
>> >> >> $selection = $menu_length
>> >> >> EndIf
>> >> >> $file_to_open = $items[$selection]
>> >> >> $menu = $device.OpenSound($file_to_open & "",true)
>> >> >> $menu.Play()
>> >> >> $limit = $menu_length+1
>> >> >> If $selection = $limit Then
>> >> >> $selection = 1
>> >> >> EndIf
>> >> >> $file_to_open = $items[$selection]
>> >> >> $menu = $device.OpenSound($file_to_open & "",true)
>> >> >> $menu.Play()
>> >> >> WEnd
>> >> >> EndFunc
>> >> >>
>> >> >> Hugs from Jodie and kisses from Tiger.
>> >> >> :)
>> >> >> "Belief is the cradle of myth."
>> >> >> Stephen King
>> >> >>
>> >> >>
>> >> >> ----------------------------------------
>> >> >> I am using the free version of SPAMfighter for private users.
>> >> >> It has removed 2521 spam emails to date.
>> >> >> Paying users do not have this message in their emails.
>> >> >> Get the free SPAMfighter here: http://www.spamfighter.com/len
>> >> >>
>> >> >> [Non-text portions of this message have been removed]
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> Yahoo! Groups Links
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > Yahoo! Groups Links
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > No virus found in this incoming message.
>> >> > Checked by AVG Free Edition.
>> >> > Version: 7.1.408 / Virus Database: 268.13.2/472 - Release Date:
>> > 10/11/2006
>> >> >
>> >>
>> >> ----------------------------------------
>> >> I am using the free version of SPAMfighter for private users.
>> >> It has removed 2516 spam emails to date.
>> >> Paying users do not have this message in their emails.
>> >> Get the free SPAMfighter here: http://www.spamfighter.com/len
>> >>
>> >>
>> >>
>> >> Yahoo! Groups Links
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > No virus found in this incoming message.
>> > Checked by AVG Free Edition.
>> > Version: 7.1.408 / Virus Database: 268.13.3/473 - Release Date:
> 10/12/2006
>> >
>>
>> ----------------------------------------
>> I am using the free version of SPAMfighter for private users.
>> It has removed 2530 spam emails to date.
>> Paying users do not have this message in their emails.
>> Get the free SPAMfighter here: http://www.spamfighter.com/len
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
> 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AutoItList/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/AutoItList/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.