Jump to content

Simple Script


Recommended Posts

What functions were in that category I pointed to ? Let's check their descriptions :

  • Sets a hotkey that calls a user function.
  • Sends simulated keystrokes to the active window.
I'll skip the four remaining since they aren't really functions.

So, what sounds like the function you're looking for you think ?

When you find out function which is the right one, just go straight for the example at the bottom.

Modify it and you're good to go. No need to fully understand the language for that I would think,

which I doubt is your intentions anyways.

Link to comment
Share on other sites

well yea, if I liked to send it just to the active window it would be no problem, but if i want to send it to a programm in the background... it is (for me) =\

/edit

While 1
ControlSend ("World of Warcraft", "", "", "{SPACE}")
Sleep(Int(Random(11000,13000)))
WEnd

; Function to exit script
Func EndScript()
Exit
EndFunc

something like this without a loop just reacting to a keypress

Edited by FeeD
Link to comment
Share on other sites

ok, very nice I come step to step to what I need ^^

ControlSend ("World of Warcraft", "", "", "{SPACE}")

Now I just like to know how I can tell the script when to use it (on keypress)

ty for everything btw helge =) btw do anyone know how to tell autoit what window to use if there are two with the same name?

Edited by FeeD
Link to comment
Share on other sites

ok, very nice I come step to step to what I need ^^

ControlSend ("World of Warcraft", "", "", "{SPACE}")

Now I just like to know how I can tell the script when to use it (on keypress)

ty for everything btw helge =) btw do anyone know how to tell autoit what window to use if there are two with the same name?

1. That's a better question. Put that in a function (between Func/EndFunc).

2. Look up HotKeySet() and use it to attach that function to the keypress you want.

3. Add a loop to keep the script running while waiting for the keypress (While/WEnd, and Sleep).

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

HotKeySet("{F1}", "SendSpace")

Func SendSpace()
ControlSend ("World of Warcraft", "", "", "{SPACE}")
EndFunc

This way?

/loop is missing I know

Edited by FeeD
Link to comment
Share on other sites

This way?

Yep. I like to add another one just to make it easy to exit (ctrl-x in this case):

HotKeySet("{F1}", "SendSpace")
HotKeySet("{^x}", "_Quit") ; Ctrl-x to quit

While 1
    Sleep(20)
WEnd

Func SendSpace()
    ControlSend("World of Warcraft", "", "", "{SPACE}")
EndFunc   ;==>SendSpace

Func _Quit()
    Exit
EndFunc   ;==>_Quit

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Wow, thank you very much....

can u tell me how I can explain AutoIT which window to use? I have two windows open with the same name (cant change the names =\) but I only want to send those commands to one of them...

Link to comment
Share on other sites

Wow, thank you very much....

can u tell me how I can explain AutoIT which window to use? I have two windows open with the same name (cant change the names =\) but I only want to send those commands to one of them...

You're already doing that with the first parameter of ControlSend(): "World of Warcraft" is supposed to be the title.

The second parameter is some optional text to look for inside the window, to differentiate between multiple windows with the same title. But in games, text is usually graphically rendered and not readable.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

How to tell which one is which ? When does your script start ? Before, in between or

after the processes are started ? Does your script start one, both or none of the processes ?

Some details would be nice.

Telling you would like to work with "that" but not "the other" isn't very useful information.

Edited by Helge
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...