Jump to content

Script Help


 Share

Go to solution Solved by l3ill,

Recommended Posts

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
Link to comment
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)
Link to comment
Share on other sites

  • Solution

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...