Sign in to follow this  
Followers 0
Ryusenko

Script Help

3 posts in this topic

#1 ·  Posted (edited)

Hello everyone. I need help with a script. I want the script to [click left mouse button, wait(specified time), click left mouse button again] when i press a certain key. Right now the script does that one time, but it only clicks one time afterwards. Right now my script is this. Help please.

#RequireAdmin
#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
Do
Sleep(10)
 Until _IsPressed(39, $dll)
 Sleep(10)
MouseClick("left")
  Sleep(1000)
Send("{CTRLDOWN}")
MouseClick("left")
Send("{CTRLUP}")
WEnd
DllClose($dLL)
 
Nevermind. I fixed it. Needed to put sleep longer.
Edited by Ryusenko

Share this post


Link to post
Share on other sites



Maybe this works better...

untested:

#RequireAdmin
#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
    Sleep(10)
WEnd    

If  _IsPressed(39, $dll) Then
 Sleep(10)
MouseClick("left")
  Sleep(1000)
Send("{CTRLDOWN}")
MouseClick("left")
Send("{CTRLUP}")
EndIf


DllClose($dLL)

Share this post


Link to post
Share on other sites

Or this will work for sure...

#RequireAdmin
HotKeySet("{F2}", "_func") ; HotKeySet uses F2 to start script  change to whatever you want...

While 1
    Sleep(10)
WEnd

Func _func()

    Sleep(10)
    MouseClick("left")
    Sleep(1000)
    Send("{CTRLDOWN}")
    MouseClick("left")
    Send("{CTRLUP}")

EndFunc   ;==>_func

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