I created 2 Hotkeys that are triggered by buttons.
I activate button 1. the hotkey starts working as planned.
But if button 2 is active, it cancels the first hotkey and only the second one starts to rotate.
How can I activate and deactivate each of them by the button?
How do I make them all work at the same time if I activate more than 1?
Ex:
Decrease all my code for 2 buttons so it is easy to understand.
Beleza Galera estou com uma enorme duvida, ja escrevi todo o meu programa mas o problema é.
Criei 2 Hotkeys que sao acionadas atraves de botoes.
Eu ativo o botao 1. a hotkey começa a funcionar conforme planejado.
Mas se ativo o botao 2. Ele cancela a primeira hotkey e somente a segunda passa a rodar.
Como faço para poder ativar e desativar cada uma delas pelo botao ?
Como faço para fazer com que todas possam funcionar ao mesmo tempo caso eu ative mais de 1 ?
Ex:
Diminui todo meu codigo para 2 botoes assim fica facil de entender.
Code: Select all
;imagem de fundo
Gui, Add, Picture, x0 y0 w817 h358, C:\sistema\bg.png
;botoes - all
Gui, Add, Button, x254 y228 w60 h20 gHurry, Hurry
Gui, Add, Button, x317 y228 w20 h20 gConfighurry, ?
Gui, Add, Button, x254 y257 w60 h20 gMb, Mana Blk
Gui, Add, Button, x317 y257 w20 h20 gConfigmb, ?
;Tela geral
Gui, Show, w817 h358, sistema
Return
;################################################################
; CONFIGURANDO O BOTAO HURRY
;################################################################
Confighurry:
WinMinimize
InputBox, HurryKey, Hotkey, Please enter a Hotkey., , 240, 180 ; exibe uma janela pedindo para que a hotkey seja inserida.
if ErrorLevel
Return
else
MsgBox,,Hotkey Config, You entered "%HurryKey%" ; exibe uma janela com a hotkey inserida
Return
;################################################################
; ATIVANDO AHOTKEY HURRY
;################################################################
Hurry:
If (HurryKey = "") ; verifica se a hotkey é nula
{
MsgBox,64, Atention, Configure a hotkey !!! ; se for nula exibe uma msg para configura-la
}
else
{
SoundBeep
WinMinimize
MsgBox, hotkey Actived!!! ; exibe uma msg avisando que a hotkey foi ativada
Loop,
{
Send, {%HurryKey%}
sleep, 15000
}
}
return
;################################################################
; CONFIGURANDO O BOTAO MANA BLOCK
;################################################################
Configmb:
WinMinimize
InputBox, MbKey, Hotkey, Please enter a Hotkey., , 240, 180 ; exibe uma janela pedindo para que a hotkey seja inserida.
if ErrorLevel
Return
else
MsgBox,,Hotkey Config, You entered "%MbKey%" ; exibe uma janela com a hotkey inserida
Return
;################################################################
; ATIVANDO A HOTKEY MB
;################################################################
Mb:
If (MbKey = "") ; verifica se a hotkey é nula
{
MsgBox,64, Atention, Configure a hotkey !!! ; se for nula exibe uma msg para configura-la
}
else
{
SoundBeep
WinMinimize
MsgBox, hotkey Actived!!! ; exibe uma msg avisando que a hotkey foi ativada
Loop,
{
Send, {%MbKey%}
sleep, 25000
}
}
return