Jump to content

Recommended Posts

Posted

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.

Posted (edited)

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
Posted

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?

Posted

@snoopy

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

Cheers, FireFox.

Posted

@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?

Posted

@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.

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