Jump to content



Photo

Hold Button UP for 3 sec


  • Please log in to reply
5 replies to this topic

#1 kempas

kempas

    Seeker

  • Active Members
  • 10 posts

Posted 27 October 2008 - 01:49 PM

As I wrote in title I want to hold UP button for 3 secs. I'm realy newbie in this kinda program. Please help. And i also want to know how to hold 2 buttons at the same time.

Edited by kempas, 27 October 2008 - 01:57 PM.








#2 Andreik

Andreik

    Bishop

  • Active Members
  • PipPipPipPipPipPip
  • 2,498 posts

Posted 27 October 2008 - 01:57 PM

As I wrote in title I want to hold UP button for 3 secs. I'm realy newbie in this kinda program. Please help. And i also want to know how to hold 2 buttons at the same time.

Example:
$T_INIT = TimerInit() Do Send("{a down}") Until TimerDiff($T_INIT) >= 3000;3000  miliseconds = 3 seconds Send("{a up}") MsgBox(0,"","FINISH")

When the words fail... music speaks

#3 kempas

kempas

    Seeker

  • Active Members
  • 10 posts

Posted 27 October 2008 - 02:07 PM

Example:

$T_INIT = TimerInit() Do Send("{a down}") Until TimerDiff($T_INIT) >= 3000;3000  miliseconds = 3 seconds Send("{a up}") MsgBox(0,"","FINISH")

Huh. It doesn't work or I'm just noob :/. My script looks like this
Sleep (1000) Run("E:\GTA2 Game Hunter\GTA2 Game Hunter.exe") MouseClick("left",70,65) MouseClick("left",21,990) Sleep(500) Send("{ENTER}") Sleep(500) MouseClick("left",222,68) Sleep(500) MouseClick("left",367,79) Sleep(10000) MouseClick("left",286,700) $T_INIT = TimerInit() Do Send("{a down}") Until TimerDiff($T_INIT) >= 3000;3000  miliseconds = 3 seconds Send("{a up}") MsgBox(0,"","FINISH") Send("{Enter}") Send ("{F10}") Send ("ww")

But remember i have to hold UP key so i mean this little arrow ;D And also i don't want to display messege FINISH at the end you know. I want to start game hold up button for 3 secs and this is it.

Edited by kempas, 27 October 2008 - 02:10 PM.


#4 Andreik

Andreik

    Bishop

  • Active Members
  • PipPipPipPipPipPip
  • 2,498 posts

Posted 27 October 2008 - 02:23 PM

Huh. It doesn't work or I'm just noob :/. My script looks like this

Sleep (1000) Run("E:\GTA2 Game Hunter\GTA2 Game Hunter.exe") MouseClick("left",70,65) MouseClick("left",21,990) Sleep(500) Send("{ENTER}") Sleep(500) MouseClick("left",222,68) Sleep(500) MouseClick("left",367,79) Sleep(10000) MouseClick("left",286,700) $T_INIT = TimerInit() Do Send("{a down}") Until TimerDiff($T_INIT) >= 3000;3000  miliseconds = 3 seconds Send("{a up}") MsgBox(0,"","FINISH") Send("{Enter}") Send ("{F10}") Send ("ww")

But remember i have to hold UP key so i mean this little arrow ;D And also i don't want to display messege FINISH at the end you know. I want to start game hold up button for 3 secs and this is it.

Be sure that GTA window is active WinActivate() function and replace "a" with another key to see the result, for example left key
Send("{LEFT down}")


Take a look through the help file to see what can be done send function. :P
When the words fail... music speaks

#5 kempas

kempas

    Seeker

  • Active Members
  • 10 posts

Posted 27 October 2008 - 03:28 PM

Be sure that GTA window is active WinActivate() function and replace "a" with another key to see the result, for example left key

Send("{LEFT down}")


Take a look through the help file to see what can be done send function. :P

Ok ok it works TY. Buy my another question in 1 post was :want to know how to hold 2 buttons at the same time.

#6 LarryDalooza

LarryDalooza

    Schmember

  • Active Members
  • PipPipPipPipPipPip
  • 922 posts

Posted 27 October 2008 - 05:09 PM

Send("{UP DOWN}{RIGHT DOWN}")
Sleep(5000)
Send("{RIGHT UP}{UP UP}")

don't forget to eventually send the keystroke up.

Lar.
Posted ImageAutoIt3 Yahoo Group - Expert LarryA tool of Big Blue...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users