Jump to content
Sign in to follow this  
Blindz

Autoit Press space same lenght as i did

Recommended Posts

Blindz

hi im trying to make program that will press the same time the Key space that i did i started my project but i dont know what do to now... here's my code

$dll = DllOpen("user32.dll")

While 1

sleep (1)

If _IsPressed("20", $dll) Then

(count how many sec i pressed key)

(if i press f10 then press space the for x sec)

ExitLoop

EndIf

WEnd

DllClose($dll)

Thanks

Edited by Blindz

Share this post


Link to post
Share on other sites
Blindz

yea but someone tought that it was for keylogger but its not!

Share this post


Link to post
Share on other sites
Blindz

#include <misc.au3>

$dll = DllOpen("user32.dll")

While 1

sleep (1)

If _IsPressed("20", $dll) Then

$start = TimerInit()

ExitLoop

EndIf

WEnd

While _IsPressed ( "20", $dll )

Sleep(1)

WEnd

TimerDiff($start)

DllClose($dll)

almost done but i dont know what do to after the 2nd loop Send("space") for TimerDiff($start)??

Share this post


Link to post
Share on other sites
Blindz

can someone tell me why the sleep isnt good (where the function Shoot is)??

#include <misc.au3>

HotKeySet("{F3}","Shoot")

$dll = DllOpen("user32.dll")

While 1

sleep (1)

If _IsPressed("20", $dll) Then

$start = TimerInit()

ExitLoop

EndIf

WEnd

While _IsPressed ( "20", $dll )

Sleep(1)

WEnd

Func Shoot()

Send("{SPACE down}")

Sleep (TimerDiff($start) )

Send ("{space up}")

EndFunc

While 1

Sleep ( 1)

Wend

DllClose($dll)

Thanks

Edited by Blindz

Share this post


Link to post
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
Sign in to follow this  

×