Syldegil Posted September 16, 2006 Posted September 16, 2006 ok i am just trying to get an easy macro . i would like that when i press {HOME} , autoit press for me F2 and do a mouse right click and then a mouse left click . if possible , the smallest delay beetween F2 and MouseClick("right") and MouseClick("left") should be rather simple , but i didnot found (yet) an exemple of things like this . i found lots of things very cool but not a so easy exemple . here s what i tryed to make it : HotKeySet("{HOME}", "go") Func go() Send("{F2}") MouseClick("right") MouseClick("left") EndFunc thx a lot for reading and maybee helping . ( sorry for my bad english , i am french ) .
/dev/null Posted September 16, 2006 Posted September 16, 2006 thx a lot for reading and maybee helping .( sorry for my bad english , i am french ) .your code does exactly what you described in the post. So, what's the problem?CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Syldegil Posted September 16, 2006 Author Posted September 16, 2006 your code does exactly what you described in the post. So, what's the problem?CheersKurtwell when i press home , it doesnt work . i dont notice the mouse click . doing it for a game ( bf2 ) and it doesnt work in the game too .
jvanegmond Posted September 16, 2006 Posted September 16, 2006 Your scripts has everything what it needs. It just stops before you get a chance to use it. Here is how you can put a neverending loop into your script, making your script continue. HotKeySet("{HOME}", "go") While 1 Sleep(50) Wend Func go() Send("{F2}") MouseClick("right") MouseClick("left") EndFunc github.com/jvanegmond
/dev/null Posted September 16, 2006 Posted September 16, 2006 well when i press home , it doesnt work . i dont notice the mouse click . doing it for a game ( bf2 ) and it doesnt work in the game too .well, add a msgbox() before "EndFunc" and see if the message shows if you press HOME.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
jvanegmond Posted September 16, 2006 Posted September 16, 2006 well, add a msgbox() before "EndFunc" and see if the message shows if you press HOME.CheersKurtYou'll find that it doesn't. github.com/jvanegmond
Syldegil Posted September 16, 2006 Author Posted September 16, 2006 thx for the tip of the loop , i didnot though of it . is there different way for autoit to send the command ? i mean , i feel now that with the loop , the script work in windows but doesnt in the game . ( i am not 100% sure the script works in windows but i am 100% sure it doesnt ingame lol ,) so i was wondering if the way to send the command that autoit use works in the game .
Persen Posted September 16, 2006 Posted September 16, 2006 The game, the way it's designed, blocks hotkeys i think.
jvanegmond Posted September 16, 2006 Posted September 16, 2006 Persen is probably right. You can try to do this:#Include <Misc.au3> While 1 If _Ispressed(0x24) Then Send("{F2}") MouseClick("right") MouseClick("left") EndIf Sleep(50) WendThis requires the Beta version of AutoIt. Can be found here! github.com/jvanegmond
Moderators SmOke_N Posted September 16, 2006 Moderators Posted September 16, 2006 Persen is probably right. You can try to do this: #Include <Misc.au3> While 1 If _Ispressed(0x24) Then Send("{F2}") MouseClick("right") MouseClick("left") EndIf Sleep(50) Wend This requires the Beta version of AutoIt. Can be found here!_IsPressed is included in the standard release 3.2 now. 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.
jvanegmond Posted September 16, 2006 Posted September 16, 2006 _IsPressed is included in the standard release 3.2 now.I see, I looked in the helpfile but couldn't find it. Turns up, I'm still using v3.1.1 Thanks. github.com/jvanegmond
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