Sign in to follow this  
Followers 0
Syldegil

beg for some help (noob inside)

11 posts in this topic

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 ) .

Share this post


Link to post
Share on other sites



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?

Cheers

Kurt


__________________________________________________________(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 *

Share this post


Link to post
Share on other sites

your code does exactly what you described in the post. So, what's the problem?

Cheers

Kurt

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 .

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Cheers

Kurt


__________________________________________________________(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 *

Share this post


Link to post
Share on other sites

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 .

Share this post


Link to post
Share on other sites

The game, the way it's designed, blocks hotkeys i think.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

_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.

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