Results 1 to 1 of 1
  1. #1
    thid
    thid is offline
    Guest thid's Avatar
    Join Date
    2014 Sep
    Location
    localhost
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Example for Newbies -> very basic autoclicker

    This is example of very basic autoclicker with start/stop function.


    Code:
    HotKeySet("{F9}", "left") ;=> set F9 as hotkey to start/stop left mouse clicking
    HotKeySet("{F10}", "right") ;=> set F10 as hotkey to start/stop right mouse clicking
    HotKeySet("{F11}", "done") ;=> set F11 as hotkey to close app
    
    Dim $l_run = False ;=> set default value
    Dim $r_run = False ;=> set default value
    $t = 20 ;=> time in ms
    $clicks = 1 ;=> amount of clicks
    
    ;=> close app
    Func done() 
            Exit ;=> cose app
    EndFunc 
    
    ;=> start/stop right clicking
    Func right() 
            If $r_run = False Then
    		   ;=> if $r_run have value false we change it to true
                    $r_run = True
    		 Else
    				;=> in case when $r_run is set to true we change it to false 
                    $r_run = False
            EndIf 
    EndFunc 
    
    ;=> start/stop left clicking
    Func left()
    	If $l_run = False Then 
    	   ;=>if $l_run have value false we change it to true
    		$l_run = True 
    	 Else
    		;in case when $r_run is set to true we change it to false 
    		$l_run = False
    	EndIf
    EndFunc
    
    While True ;=> loop start
    		$pos = MouseGetPos() ;=> this function get current position of the mouse
            If $r_run = True Then ;=>
    		   ;=> $pos contains x/y values of current position of mouse, $clicks containts amount of clicks script is suppose to do in 1 loop
                    MouseClick("right",$pos[0],$pos[1],$clicks)  
    		EndIf ;=> zakonczenie if
    		If $l_run = True Then
    				MouseClick("left",$pos[0],$pos[1],$clicks)
    		EndIf
            Sleep($t) ;=> we put loop to sleep for 20ms
    WEnd ;=> end of loop

Similar Threads

  1. [VB] Memory Editing for Newbies
    By dkgsf in forum VB, .NET Framework
    Replies: 0
    Last Post: 2013-11-22, 07:52 AM
  2. [VB] Basic hack and trainer with CE and Visual Basic
    By Dwar in forum Programming Tutorials
    Replies: 2
    Last Post: 2013-05-01, 03:57 AM
  3. Examples For Newbies - MousePos
    By RodizipaZX in forum AutoIt
    Replies: 0
    Last Post: 2012-12-13, 07:33 PM
  4. [Delphi] Autoclicker for games with GameGuard
    By Dwar in forum Programming Tutorials
    Replies: 0
    Last Post: 2010-11-29, 04:10 PM
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •