Jump to content

Can anyone help me simple script or make auto right-clicks please.


Recommended Posts

Can anyone make example or make script for me?

Object: Fast Auto Clicks on Mouse Right-Clicks. I am tired to keep clicks on Mouse Right-Clicks because my finger is hurt. (Not click once, I mean many clicks clicks clicks.... )

Keyboard:

Keyset Home to enable script.

Keyset End to pause the secript.

Keyset Delete to stop and quit the script.

Keyset 9 to enable click on number 9 on top row of keyboard with speed control.

Target action: Fast macro on mouse right-clicks with speed control.

Can anyone give example or make script for me, Thank you.

Link to comment
Share on other sites

  • Moderators

Can anyone make example or make script for me?

Object: Fast Auto Clicks on Mouse Right-Clicks. I am tired to keep clicks on Mouse Right-Clicks because my finger is hurt. (Not click once, I mean many clicks clicks clicks.... )

Keyboard:

Keyset Home to enable script.

Keyset End to pause the secript.

Keyset Delete to stop and quit the script.

Keyset 9 to enable click on number 9 on top row of keyboard with speed control.

Target action: Fast macro on mouse right-clicks with speed control.

Can anyone give example or make script for me, Thank you.

You'd be amazed at the "example(s)" you'd see in the "Help file" muttley

However, Click here if you are not interested in learning or looking for a quick fix.

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.

Link to comment
Share on other sites

I'm not exactly sure what you want the script to do but maybe this may help. When you start the script a windows opens where you can specifie the number of right-clicks done after the first one an the delay betwenen two clicks. The rest should be as you wanted it. Have a look at the script and tell if it does what you need.

#include <DllCallBack.au3>
#include <GUIConstants.au3>
GUICreate("Clicker", 300, 60)
GUICtrlCreateLabel("Clicks:", 10, 10, 100, 20)
$clck = GUICtrlCreateInput("10", 10, 30, 100, 20)
GUICtrlCreateLabel("Delay(sek):", 130, 10, 100, 20)
$del = GUICtrlCreateInput("0.1", 130, 30, 100, 20)
$btn1 = GUICtrlCreateButton("OK", 240, 30, 50, 20)
Const $WH_MOUSE_LL = 14
Global $pStub_MouseProc = _DllCallBack("_MouseProc","int;ptr;ptr")
Global $hmod = DllCall("kernel32.dll","hwnd","GetModuleHandle","ptr",0)
Global $hHook = DllCall("user32.dll","hwnd","SetWindowsHookEx","int", $WH_MOUSE_LL,"ptr",$pStub_MouseProc,"hwnd",$hmod[0],"dword",0)
Dim $run = 0, $clicks = 10 , $delay = 100, $doneclicks = 0
HotKeySet("{HOME}", "_Run")
HotKeySet("{END}", "_Pause")
HotKeySet("{Del}", "_Exit")
HotKeySet("9", "_9")
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        _Exit()
    Case $msg = $btn1
        $clicks = GUICtrlRead($clck)
        $delay = GUICtrlRead($del)* 1000
        GUIDelete()
    EndSelect
WEnd

Func _Run()
    $run = 1
EndFunc

Func _click()
    If $run = 1 Then
        For $i = 0 to $clicks
            MouseClick("RIGHT")
            Sleep($delay)
        Next
    EndIf
EndFunc

Func _9()
    If $run = 1 Then
        For $i = 0 to $clicks
            Send("9")
            Sleep($delay)
        Next
    EndIf
EndFunc

Func _Pause()
    $run = 0
EndFunc

Func _Exit()
    Exit
EndFunc 
        
        
        
Func _MouseProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then DllCall("user32.dll","long","CallNextHookEx","hwnd",$hHook[0], "int",$nCode,"ptr",$wParam,"ptr",$lParam)
    $MOUSESTRUCT = DllStructCreate("int;int", $lParam)
    IF $wParam = 0x205  Then _click()
    $ret = DllCall("user32.dll","long","CallNextHookEx","hwnd",$hHook[0], "int",$nCode,"ptr",$wParam,"ptr",$lParam)
EndFunc
Edited by CHronologist
Link to comment
Share on other sites

Thank you so much for trying to help me, CHronologist.

I asked my friend and he did do it for me. I would like to share this and thank you very much.

HotKeySet("{ESC}", "_Exit")
HotKeySet("{PAUSE}", "_Pause")

Global $Paused

While 1
   Sleep(100)
   MouseClick("right")
   Sleep(100)

WEnd

Func _Pause()
   $Paused = NOT $Paused
   While $Paused
      Sleep(1)
   WEnd
EndFunc

Func _Exit()
   Exit
EndFunc
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...