Jump to content

Recommended Posts

Posted

how to delay hotkey for 1 minute. after 1 time pressed

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Posted

i am making a software for my gaming zone and this titlebar manage coins traffic

coins insert = 7 key

games selector = 1 key

i have completed everything but i face here some problems i need your help

i weak in english soo plzzz....

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Posted

i make this and plz tell me where i delay hotkeyset("1", SevenDown"). After 1 time pressed.

and i want to not delay hotkeyset("7", Sevendown")

CODE
#include <GUIConstants.au3>

HotKeySet("7", "SevenUp")

HotKeySet("1", "SevenDown")

Opt("GUIOnEventMode", 1)

Global $i = 0

$myGUI = GUICreate("Times Pressed:=0", 633, 1, 195, 260, BitOR($WS_MINIMIZEBOX,$WS_GROUP,$WS_CLIPSIBLINGS))

GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

GUISetState()

While 1

Sleep(10)

WEnd

Func Terminate()

Exit 0

EndFunc

Func SevenUp()

;probably a good idea to disable your hotkeys here, then re-enable them

$i += 1

WinSetTitle("Times Pressed:", "", "Times Pressed: " & $i)

EndFunc

Func SevenDown()

if $i < 0 Then

Send("{ENTER}") = False

EndIf

if $i > 0 Then

send("{enter}")

EndIf

If $i > 0 Then

$i -= 1

Else

$i = 0

EndIf

WinSetTitle("Times Pressed:", "", "Times Pressed: " & $i)

EndFunc

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Posted

Like Paulie suggested:

#include <GUIConstants.au3>

HotKeySet("7", "SevenUp")
HotKeySet("1", "SevenDown")

Opt("GUIOnEventMode", 1)

Global $i = 0

$myGUI = GUICreate("Times Pressed: 0")
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
GUISetState()

While 1
    Sleep(10)
WEnd

Func Terminate()
    Exit 0
EndFunc

Func SevenUp()
    HotKeySet("1", "SevenDown")
    $i += 1
    WinSetTitle("Times Pressed:", "", "Times Pressed: " & $i)
EndFunc

Func SevenDown()
    If $i > 0 Then
        $i -= 1
    Else
        $i = 0
    EndIf
    WinSetTitle("Times Pressed:", "", "Times Pressed: " & $i)
    HotKeySet("1")
    Sleep(60000)
    HotKeySet("1", "SevenDown")
EndFunc

Notice the HotKeySet("1"), which disables the hotkey, then a sleep, then re-enabling the hotkey. Also, in the function SevenUp(), I added a re-enable, in case you want to have functionality of the "1" after you press "7" again, but before the 1 minute is up. Hope you can figure it out from this.

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Posted

i really thankfull to u. u r a nice man ever.

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Posted

no man i will make another pc's for this purpose

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Posted

You have either taken too much, or not nearly enough, of whatever it is you are taking.

:whistle:

I wonder if this thread will ever stop. I hope it isn't going to though, I am having a ball reading this soap :lmao:

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Posted

You have either taken too much, or not nearly enough, of whatever it is you are taking.

:lmao:

lol

man i has came up thinking you know he so man :whistle:

  • 2 weeks later...
Posted (edited)

CODE
#include <GuiConstants.au3>

#NoTrayIcon

Global Const $WM_ENTERSIZEMOVE = 0x231

Global Const $WM_EXITSIZEMOVE = 0x232

HotKeySet("5", "SevenUp")

HotKeySet("1", "SevenDown")

Opt("GUIOnEventMode", 1)

Global $i = 0

$testGUI = GUICreate("Coins:= 0", 641, 0, 0, 450, BitOR($WS_SYSMENU,$WS_CAPTION))

GUISetState(@SW_SHOW)

Global $pos = WinGetPos($testGUI)

Global Const $WM_NCHITTEST = 0x0084

GUIRegisterMsg($WM_NCHITTEST,"WM_NCHITTEST")

While 1

Sleep(10)

WEnd

Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)

If $hWnd = $testGUI And $iMsg = $WM_NCHITTEST Then

$id = _API_DefWindowProc($hWnd, $iMsg, $iwParam, $ilParam)

If $id = 2 Then;if it is the title handle

Return 1;return the client handle

Else

Return $id;return the real handle

EndIf

EndIf

EndFunc

Func _API_DefWindowProc($hWnd, $iMsg, $iwParam, $ilParam)

Local $aResult

$aResult = DllCall("User32.dll", "int", "DefWindowProc", "hwnd", $hWnd, "int", $iMsg, "int", $iwParam, "int", $ilParam)

Return $aResult[0]

EndFunc

Func SevenUp()

HotKeySet("1", "SevenDown")

$i += 1

SoundPlay(@WindowsDir & "\media\ringin.wav")

WinSetTitle("Coins:= 0", "", "Coins:= 0" & $i)

EndFunc

Func SevenDown()

if $i < 0 Then

Send("m")

EndIf

if $i > 0 Then

send ("3")

sleep(100)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

send ("3")

sleep(20)

Send("6")

Send("6")

EndIf

If $i > 0 Then

$i -= 1

Else

$i = 0

EndIf

soundplay(@WindowsDir &"\media\ir_end.wav")

WinSetTitle("Coins:= 0", "", "Coins:= 0" & $i)

HotKeySet("1")

$s = Sleep(60000)

HotKeySet("1", "SevenDown")

EndFunc

after hotkey(5) we press 1. hotkey(1) is sleep for 1 minute. but if we again press 5 so 1 sleep break. i want that if we press 5 after 1 counting of 5 is continue but 1 sleep time still continue.

Anyone plzzzz help.

Edited by L3G3NdKillEr

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Posted

anyoneee helppppp me plzzzzzzzz

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...