Sign in to follow this  
Followers 0
alemoscastro

help me with macros

7 posts in this topic

i need a macro like this:

macro press keys f1 to f6 in 0.2 seconds, after key f8 and finish enter key but the repeat this many times. Please help me or write a example

Share this post


Link to post
Share on other sites



Lets start off with clarifying what you are wanting it to do.

Think step by step... (I'll take a shot at translating what your saying)

Press F1

Press F2

.

.

Press F6

When someone presses F8

ENTER

ENTER

ENTER

ENTER

ENTER

ENTER

Is that what you wanted it to do?


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

Lets start off with clarifying what you are wanting it to do.

Think step by step... (I'll take a shot at translating what your saying)

Press F1

Press F2

.

.

Press F6

When someone presses F8

ENTER

ENTER

ENTER

ENTER

ENTER

ENTER

Is that what you wanted it to do?

can you help me with a example?

Share this post


Link to post
Share on other sites

Yeah, but I wont be able to reply until later tonite.

In the mean time check out the help file for commands like send() and ControlSend()

And posibly WinWaitActive()


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Sorry I couldn't get on last nite.

Here is the basic idea. You should be able to see how it works and modify it to suit your needs.

; Hot Keys to do what you want
HotKeySet("{ESC}","Terminate")
HotKeySet("{F7}","Series")
HotKeySet("{F8}","Enters")

; Continual Loop
While 1
    sleep(100)
WEnd

; Function to end the program
Func Terminate()
    Exit
EndFunc

; Function to send the series of Function keys you want
Func Series()
    Send("{F1}"&"{F2}"&"{F3}"&"{F4}"&"{F5}"&"{F6}")
EndFunc

; Function to send the bunch of ENTER keys you want
Func Enters()
    Send("{ENTER}"&"{ENTER}"&"{ENTER}"&"{ENTER}"&"{ENTER}")
EndFunc

And as per your question about the posibility of making it an executable file, yes its easy to do. If you installed Scite then there is an option in the tools menu that you can click on to make the .exe or you can look under the autoit folder for a program called Aut2Exe.exe. Run the program and it will ask you what file you want to convert and where you want to save it to.

Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

i try but no work B) i trying to use in gunbound game

Edited by alemoscastro

Share this post


Link to post
Share on other sites

how include this code to active window

; Hot Keys to do what you want

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

HotKeySet("{F7}","Series")

HotKeySet("{F8}","Enters")

; Continual Loop

While 1

sleep(100)

WEnd

; Function to end the program

Func Terminate()

Exit

EndFunc

; Function to send the series of Function keys you want

Func Series()

Send("{F1}"&"{F2}"&"{F3}"&"{F4}"&"{F5}"&"{F6}")

EndFunc

; Function to send the bunch of ENTER keys you want

Func Enters()

Send("{ENTER}"&"{ENTER}"&"{ENTER}"&"{ENTER}"&"{ENTER}")

EndFunc

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