Jump to content

need some little help


Recommended Posts

hi to all...,

in this when hotkey 1 pressed before 5 it start time about 5 minutes. but i want time starts when hotkey 1 pressed after hotkey 5. and if Coins= 0 then only send "m" not start time.

here is this.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Documents and Settings\saeed\My Documents\pak.ico
#AutoIt3Wrapper_outfile=coin.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiConstants.au3>
#include <misc.au3>

Global Const $WM_ENTERSIZEMOVE = 0x231
Global Const $WM_EXITSIZEMOVE = 0x232

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

Opt("GUIOnEventMode", 1)

Global $i = 0

$testGUI2 = GUICreate("Coins:= 0", 641, 0, 0, 450, BitOR($WS_SYSMENU,$WS_CAPTION))
GUISetState(@SW_SHOW)
WinSetOnTop($TESTGUI2, "", 1)

Global $pos = WinGetPos($testGUI2)
Global Const $WM_NCHITTEST = 0x0084
GUIRegisterMsg($WM_NCHITTEST,"WM_NCHITTEST")

While 1
    lod3Sleep(10)
    
WEnd


Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If $hWnd = $testGUI2 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()
    ConsoleWrite("start sup" & @CRLF)
;HotKeySet("1", "SevenDown")
    $i += 1
    WinSetTitle("Coins:= 0", "", "Coins:= 0" & $i)
    ConsoleWrite("Enssup" & @CRLF)
EndFunc

Func SevenDown()
    HotKeySet("1")
    if $i = 0 Then
        
        EndIf
    ConsoleWrite("sdn" & @CRLF)
    if $i >= 1 Then;<----changed this so I could test it.
        send ("3")
        lod3Sleep(100)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        send ("3")
        lod3Sleep(20)
        Send("{enter}")
        
    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 = lod3Sleep(60000*5)
    HotKeySet("1", "SevenDown")
    ConsoleWrite("Endsdn" & @CRLF)
EndFunc

Func lod3Sleep($lt)
    $tin = timerinit()

    while Timerdiff($tin) < $lt
               ;if NUm5 or 5 pressed
       HotKeySet("5", "sevenup")
                    
    WEnd

EndFunc
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=----=========================>

Link to comment
Share on other sites

Since you know Autoit can you help me find a tutorial i really want to learn i use the help file at the minute i just need a tutorial so i can learn propaly

lolzz. i also here for help.

but i think that help file in autoit is the best way to know.

try this:

http://www.autoitscript.com/forum/index.ph...amp;hl=tutorial

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=----=========================>

Link to comment
Share on other sites

sorry about tgat post we are not making new programs any more as my friend is moving to linux and their isnt a autoit linux basid compiler so we cant code in it any more but i might code in it still but im not shore but still feel free to sign up to the forum

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...