vkey Posted August 17, 2008 Share Posted August 17, 2008 Hi, I try to let the programm Autoit do something, when I press a key. For example, when I press the 1, I want the programm to do the following: MouseClick("left", 550, 332, 1) MouseClick("left", 550, 375, 1) I red something in the FAQ, but there was only an example about when a key is held down. So, can someone please help me and make a simple script of it? That would be great! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 17, 2008 Share Posted August 17, 2008 Welcome to the forum!It sounds like you need HotKeySet(), check the helpfile and try the example and post back if you have any questions. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
vkey Posted August 17, 2008 Author Share Posted August 17, 2008 Well, I also looked at the helpfile about hotkeys. But, I do not know what I have to put in place of "TogglePause" (See example) when I want Autoit to click somewhere. HotKeySet("{ENTER}", "TogglePause") Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 17, 2008 Share Posted August 17, 2008 I modified the example from the helpfile, maybe this help you understand? ; Press Esc to terminate script HotKeySet("{ESC}", "Terminate") HotKeySet("1", "PressMouseButtons") ;First parameter is the button and second which function that should be run when pressed ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func Terminate() Exit EndFunc Func PressMouseButtons() MouseClick("left", 550, 332, 1) MouseClick("left", 550, 375, 1) EndFunc .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
vkey Posted August 17, 2008 Author Share Posted August 17, 2008 I modified the example from the helpfile, maybe this help you understand? ; Press Esc to terminate script HotKeySet("{ESC}", "Terminate") HotKeySet("1", "PressMouseButtons");First parameter is the button and second which function that should be run when pressed ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func Terminate() Exit EndFunc Func PressMouseButtons() MouseClick("left", 550, 332, 1) MouseClick("left", 550, 375, 1) EndFunc Oke, thanks, I'll try this. But I didn't knew what the function was called for clicking the mouse buttons. Link to comment Share on other sites More sharing options...
vkey Posted August 17, 2008 Author Share Posted August 17, 2008 O, and one more question. How can I make more mouseclickfunctions, with each a different hotkey? Like, when I press 1 click here and when I press 2 click there... Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 17, 2008 Share Posted August 17, 2008 Oke, thanks, I'll try this. But I didn't knew what the function was called for clicking the mouse buttons. I don't understand what you mean there, you had your MouseClick() on your first post so how can you now don't know the function?? Or are you mixing things up with the HotKeySet()?? It can point to any function you have created yourself!O, and one more question. How can I make more mouseclickfunctions, with each a different hotkey?Like, when I press 1 click here and when I press 2 click there...Simplest would be to copy+paste the HotKeySet() a bunch of times and create 1 func for each. It maybe wouldn't look the best but would be fully okay for a noobie. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
vkey Posted August 17, 2008 Author Share Posted August 17, 2008 Yes, I ment the Hotkeyfunction. But I think I understand it. Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now