Jump to content
Sign in to follow this  
snoopy

Keyboard?

Recommended Posts

snoopy

Is there away of making ascript through Autoit , so it will press the buton W, and sleep 500?

nothing fancy just pressing it ever 500 mil.

Share this post


Link to post
Share on other sites
AlmarM

HotKeySet("{ESC}", "_Exit")

While 1
    Sleep(500)
    Send("{W}")
WEnd

Func _Exit()
    Exit
EndFunc

Something like this?


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
BrettF
snoopy

Hi,

Look at the helpfile.

You want to Send some keys, and Sleep and Loop it.

Now that was an usually big hint... Go search.

Brett

well.... I tried but it doesent make it hold the key.... it just preses it and like hmm... lets it go..

where is the example? tnx

IN helpfile it only shows how to press not how to make it hold -.- i need hold

Edited by snoopy

Share this post


Link to post
Share on other sites
snoopy

well.... I tried but it doesent make it hold the key.... it just preses it and like hmm... lets it go..

where is the example? tnx

IN helpfile it only shows how to press not how to make it hold -.- i need hold

/code

TraySetIcon("shell32.dll",246)

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 298, 226, 193, 115, $WS_POPUP, 0)

$Pic1 = GUICtrlCreatePic(@WINDOWSDIR&"\Greenstone.bmp", 0, 0, 297, 225, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

GuiCtrlSetState(-1,$GUI_DISABLE)

$START = GUICtrlCreateButton("START", 96, 64, 113, 49, 0)

GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")

GUICtrlSetColor(-1, 0xFFFFFF)

GUICtrlSetBkColor(-1, 0x808000)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $START

GUIDelete($Form1)

ExitLoop

EndSwitch

WEnd

HotKeySet("{ESC}", "_Exit")

While 1

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

Sleep(500)

Send("{W down}")

WEnd

Func _Exit()

Exit

EndFunc

How do i make it stop after 1.5 sec? and go again?

Share this post


Link to post
Share on other sites
FireFox

@snoopy

you asked for many times easy things, so please make your code with TimerInit ; TimerDiff and Send("{Key up}")

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
snoopy

@snoopy

you asked for many times easy things, so please make your code with TimerInit ; TimerDiff and Send("{Key up}")

Cheers, FireFox.

TimerDiff and Send("{W down}")

TimerDiff 300???

or is it sleep that you put after?

Share this post


Link to post
Share on other sites
FireFox

@snoopy

look at helpfile for understand functions and there is an example for each function

until you wont have done any effort, I wont help you more...

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
FireFox

@snoopy

its the last time i give you fish...

$init = TimerInit()
Send("{E down}")

While 1
$diff = TimerDiff($init)
If $diff >= 3000 Then
Send("{E up}")
EndIf
WEnd

Not tested.

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  

×