Jump to content

Some easy help


Recommended Posts

I forget how to use AutoIt again.. but if you can help me I would appreciate it.

First I want to press D. Then I want to hold A and hold the Down Key for about 10-12 secs.

Then I want to press D. Then I want to hit the up arrow key and then Press A.

After that I want to press the Right arrow key twice. Then Press down.

Then I would like that looped like 5 times.

It sounds real simple but I re-downloaded AutoIt and it didnt come with a recorder. So if anyone can help, that be great.

Link to comment
Share on other sites

It didnt work... Im sorry but I really forget how to script again in AutoIt...

Dont I need like the window info.. the window is: TGraalWindow

Well thats the class...

can anyone help plz

Link to comment
Share on other sites

It didnt work... Im sorry but I really forget how to script again in AutoIt...

Dont I need like the window info.. the window is: TGraalWindow

Well thats the class...

can anyone help plz

Just look in the help file, also this needs the window to be in focus.
Link to comment
Share on other sites

  • Moderators

how do I make the window be in focus? sorry I just really want this done and its such an easy task.

These are silly questions... open the manual and read it (Polite way of RTFM). You'd be amazed at what you would find if you looked at the Win* functions (particularly your answer).

If you don't want to take the time to learn, then go take up some outdoor activities for the summer, this is a support forum, not a holding hands forum.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

yea its not working and this is what I got so far:

Sleep(2000)

Send("{D down}")

Sleep(200)

Send("{a down}")

Sleep(100)

Send("{LEFT down}")

Sleep(10000)

Send("{LEFT up}")

Sleep(200)

Send("{a up}")

Sleep(200)

Send("{D down}")

Sleep(200)

Send("{RIGHT}")

Sleep(200)

Send("{a down}")

Sleep(200)

Send("{DOWN 2}")

Sleep(200)

Send("{LEFT}")

Sleep(200)

Next

The Reason I have the 200's because I thought it would help.. not sure if it does.

Anyway, it doesnt release the A.

A turns it on.. and you have to hold it to keep it running. Then when you release it, it stops. But it doesnt release.

Or it does and then it skips evereything else.

Link to comment
Share on other sites

  • Moderators

yea its not working and this is what I got so far:

Sleep(2000)

Send("{D down}")

Sleep(200)

Send("{a down}")

Sleep(100)

Send("{LEFT down}")

Sleep(10000)

Send("{LEFT up}")

Sleep(200)

Send("{a up}")

Sleep(200)

Send("{D down}")

Sleep(200)

Send("{RIGHT}")

Sleep(200)

Send("{a down}")

Sleep(200)

Send("{DOWN 2}")

Sleep(200)

Send("{LEFT}")

Sleep(200)

Next

The Reason I have the 200's because I thought it would help.. not sure if it does.

Anyway, it doesnt release the A.

A turns it on.. and you have to hold it to keep it running. Then when you release it, it stops. But it doesnt release.

Or it does and then it skips evereything else.

Do you have to keep it down? If not Send("a") will be fine.... common sense would say here that if I'm using {a DOWN} that I'm probably going to need to use {a UP} ... No?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yeah sorry, let me be clear.

The 2ND {A down} is just a one click.. so i changed it to this:

Sleep(2000)

Send("{D down}")

Sleep(200)

Send("{a down}")

Sleep(100)

Send("{LEFT down}")

Sleep(10000)

Send("{LEFT up}")

Sleep(200)

Send("{a up}")

Sleep(200)

Send("{D down}")

Sleep(200)

Send("{RIGHT}")

Send("a")

Sleep(200)

Send("{DOWN 2}")

Sleep(200)

Send("{LEFT}")

Sleep(200)

Next

But im still having trouble. After it hits {a down} and {LEFT down} it skips everything else and goes back to the beginning.

Link to comment
Share on other sites

Ok so I got this:

Sleep(2000)

Send("{D down}")

Sleep(200)

Send("{a down}")

Sleep(100)

Send("{LEFT down}")

Sleep(10000)

Send("{LEFT up}")

Sleep(200)

Send("{a up}")

Sleep(200)

Send("{D up}")

Send("{D down}")

Sleep(200)

Send("{RIGHT}")

Send("a")

Sleep(200)

Send("{DOWN 2}")

Sleep(200)

Send("{LEFT}")

Sleep(200)

Next

So now.. I fixed the D part... it was already holding the D down.. so how could it do it again? So I fixed that.

But now.. I just want it to click RIGHT ONCE.. and NOT hold it down. Then hit A. Then go down 2. Then hit left.

Link to comment
Share on other sites

  • Moderators

Use code tags [ code] ... your code ... [ /code] without the spaces

I just explained this to you...

Send("{D up}")
Send("{D down}")

Is redundant... all you need is:

Send("D")

You used the word "Click", are you wanting to "Mouse Click"? If so look at MouseClick() in the help file for "Right"/"Left" usage.

Send({RIGHT}) is for the arrows... and that shows it's only doing it once.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I did use Send ("D")

and it just didnt work...

No, no mouse clicks... I just want one RIGHT arrow HIT... but its not working.

Right now im up to the Right arrow part... which isnt working.

Link to comment
Share on other sites

  • Moderators

I did use Send ("D")

and it just didnt work...

No, no mouse clicks... I just want one RIGHT arrow HIT... but its not working.

Right now im up to the Right arrow part... which isnt working.

If you are sending it to a window, look at ControlSend()

GL

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I did use Send ("D")

and it just didnt work...

No, no mouse clicks... I just want one RIGHT arrow HIT... but its not working.

Right now im up to the Right arrow part... which isnt working.

What window are you trying to send those key to
Link to comment
Share on other sites

I think that should be

For $i = 1 To 5
    Send("D")
    Send("{down down}")
    Sleep(10000)
    Send("D")
    Send("{UP}")
    Send("A")
    Send("{RIGHT 2}")
    Send("{DOWN}")
Next
oÝ÷ Ø    ݶì"Ú0²)ߡˬ«ÞjZ(Ø^Z)Àrدj׺w-ÀÙbë&¢G²±¨¦W±êÞiÛazf§¹©[yú+y«$x*¹ë-ìØ­Â)²êº^JëÊljém!¶¬Æ¥'(§*Z²×éÞ­«h®Êh²ÙhØb²+!£­².ÖÞvÞjëh×6
For $i = 1 To 5
    Send("D")
    Send("{a down}")
    Send("{down down}")
    Sleep(10000)
    Send("{a up}")
    Send("{down up}")
    Send("D")
    Send("{UP}")
    Send("A")
    Send("{RIGHT 2}")
    Send("{DOWN}")
Next

After you have sent a "down" macro, you need to send the "up" macro aswell, otherwise the button will still be held down, forever(until you press it, or something else triggers the "up" event)

Link to comment
Share on other sites

well I got it working until a point... and if its working half way I dont see why it wont work.

This is my whole script:

For $i = 1 to 5 Step 1

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("    Era   ","")
If Not WinActive("   Era   ","") Then WinActivate("  Era   ","")    
Sleep(2000)
Send("{D down}")
Sleep(200)
Send("{a down}")
Sleep(100)
Send("{LEFT down}")
Sleep(10000)
Send("{LEFT up}")
Sleep(200)
Send("{a up}")
Sleep(200)
Send("{D down}")
Send("{D up}")
Sleep(200)
Send("RIGHT")
Send("{a down}")
Send("{a up}")
Sleep(200)
Send("{DOWN 2}")
Sleep(200)
Send("{LEFT down}")
Send("{LEFT up}")
Sleep(200)
Next

Now.. it works until it has to RIGHT.

It skips everything after Right and also the D.

Link to comment
Share on other sites

well I got it working until a point... and if its working half way I dont see why it wont work.

This is my whole script:

For $i = 1 to 5 Step 1

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("    Era   ","")
If Not WinActive("   Era   ","") Then WinActivate("  Era   ","")    
Sleep(2000)
Send("{D down}")
Sleep(200)
Send("{a down}")
Sleep(100)
Send("{LEFT down}")
Sleep(10000)
Send("{LEFT up}")
Sleep(200)
Send("{a up}")
Sleep(200)
Send("{D down}")
Send("{D up}")
Sleep(200)
Send("RIGHT")
Send("{a down}")
Send("{a up}")
Sleep(200)
Send("{DOWN 2}")
Sleep(200)
Send("{LEFT down}")
Send("{LEFT up}")
Sleep(200)
Next

Now.. it works until it has to RIGHT.

It skips everything after Right and also the D.

First, don't put options in a loop, that's .. actually stupid lol.

And if it's not entirely necessary, you do not need that If in that loop either:

Opt("WinWaitDelay",100)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

WinWait("Era")

If Not WinActive("Era") Then WinActivate("Era")


; Note that this loop will take 13.5 seconds to run just once... 13.5s*5 = 67.5 seconds runtime...
For $i = 1 to 5     ; Step 1 is not needed, it steps with 1 as default...
    Sleep(2000)
    Send("{d down}")
    Sleep(200)
    Send("{a down}")
    Sleep(100)
    Send("{LEFT down}")
    Sleep(10000)
    Send("{LEFT up}")
    Sleep(200)
    Send("{a up}")
    Sleep(200)
    Send("d")        ; Dont use {d down} then {d up} that's only if you need to HOLD a button, you just want to press it.... use Send() in those cases
    Sleep(200)
    Send("RIGHT")
    Send("a")        ; Dont use {a down} then {a up} that's only if you need to HOLD a button, you just want to press it.... use Send() in those cases
    Sleep(200)
    Send("{DOWN 2}")
    Sleep(200)
    Send("{left}")  ; Dont use {left down} then {left up} that's only if you need to HOLD a button, you just want to press it.... use Send() in those cases
    Sleep(200)
Next
Edited by FreeFry
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...