Jump to content
Sign in to follow this  
Syldegil

beg for some help (noob inside)

Recommended Posts

Syldegil

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
/dev/null

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
Syldegil

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
jvanegmond

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
/dev/null

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
jvanegmond

well, add a msgbox() before "EndFunc" and see if the message shows if you press HOME.

Cheers

Kurt

You'll find that it doesn't. :)

Share this post


Link to post
Share on other sites
Syldegil

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
jvanegmond

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
SmOke_N

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.

Share this post


Link to post
Share on other sites
jvanegmond

_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  

×