Sign in to follow this  
Followers 0
Faithom

help please im new

13 posts in this topic

#1 ·  Posted (edited)

all i need is a script that will push the left arrow key for 3 seconds then let go and then just do nothing for about 30 seconds, then push the right arrow key for 3 seconds then let go and wait for 30 seconds, and then repeat it all over can anyone help me make one please?

Edited by Faithom

Share this post


Link to post
Share on other sites



all i need is a script that will push the left arrow key for 3 seconds then let go and then just do nothing for about 30 seconds, then push the right arrow key for 3 seconds then let go and wait for 30 seconds, and then repeat it all over can anyone help me make one please?

<{POST_SNAPBACK}>

Open the helpfile and look for these commands:

Send()

sleep()

While ... wend

Enjoy :lmao:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

ok ill try..

Share this post


Link to post
Share on other sites

i cant find the command for left arrow key what is it?

Share this post


Link to post
Share on other sites

i cant find the command for left arrow key what is it?

<{POST_SNAPBACK}>

Just scroll down on the send helppage.

{LEFT} = Cursor left


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Send("{LEFT}")

Sleep(50000)

Send("{RIGHT}")

Sleep(50000)

ContinueLoop

is this somewhat right?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Send("{LEFT}")

Sleep(50000)

Send("{RIGHT}")

Sleep(50000)

ContinueLoop

is this somewhat right?

<{POST_SNAPBACK}>

Somewhat...

1 second = 1000 msec

Sleep timers are mesured in msec

So, I usually do this:

$sec = 1000
Sleep($sec*30); sleep for 30 seconds

Also you said you wanted to HOLD the left arrow for 3 seconds, right? Holding a key needs the addition of the "up/down" modifier.

{left down} Sleep {left up} Sleep {right down} sleep {right up}

I'll leave you to figure out the "While/WEnd" loop.

:lmao:

Also, look at the HotKeySet portion of the help file. That will explain how to set a hotkey to break out of the script and stop it running. o:)

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

$sec = 1000

While $sec <=1000

Sleep($sec*30); sleep for 30 seconds

{left down} Sleep {left up} Sleep {right down} sleep {right up}

WEnd

that's another shot..

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

$sec = 1000

While $sec <=1000

Sleep($sec*30); sleep for 30 seconds

{left down} Sleep {left up} Sleep {right down} sleep {right up}

WEnd

that's another shot..

<{POST_SNAPBACK}>

I didn't give you real code. I gave you psuedo code. You have to figure out the correct syntax. It's all a learning process. No one will spoon feed you here. There is no spoon.

And FYI, While will be infinate.

Just use

While 1
; code here
WEnd

for infinate loops.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

While 1

Send("{LEFT}")

Sleep(50000)

Send("{RIGHT}")

Sleep(50000)

WEnd

will this just press left and right? not hold tho

Share this post


Link to post
Share on other sites

While 1

Send("{LEFT}")

Sleep(50000)

Send("{RIGHT}")

Sleep(50000)

WEnd

will this just press left and right? not hold tho

<{POST_SNAPBACK}>

What about :

While 1
    Send("{LEFT DOWN}")
    Sleep(3000)
    Send("{LEFT UP}")
    Sleep(50000)
    Send("{RIGHT DOWN}")
    Sleep(3000)
    Send("{RIGHT UP}")
    Sleep(50000)
WEnd

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

While 1

Send("{LEFT}")

Sleep(50000)

Send("{RIGHT}")

Sleep(50000)

WEnd

will this just press left and right? not hold tho

<{POST_SNAPBACK}>

Correct. Every 50 seconds it will tap the left key once, followed by the right key 50 seconds later, ad infinitum.

Caveat: Your script won't care which window is active. It will send a left or right arrow to whatever window has the current focus.

Ok, I found a spoon.

$sec = 1000
$window = "Title of Window Goes Here"

HotKeySet("{ESC}", "MyExit"); set the escape key to break the script.

While 1
   Sleep(10); tiny sleep for the While loop
   WinActivate($window); activate window
   Send("{left down}"); hold left key down
   Sleep($sec * 3); 3 second delay
   Send("{left up}"); release left key
   Sleep($sec * 30); 30 second delay
   WinActivate($window); activate window
   Send("{right down}"); hold right key down
   Sleep($sec * 3); 3 second delay
   Send("{right up}"); release right key
WEnd

Func MyExit()
   Exit
EndFunc  ;==>MyExit

This script will ensure that the proper window always has focus before sending the Left or Right arrow.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

mmm spoon fed ty sir

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  
Followers 0