Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

My autoclicker script


  • Please log in to reply
7 replies to this topic
jokru
  • Members
  • 12 posts
  • Last active: Sep 03 2015 05:48 PM
  • Joined: 18 Sep 2014

So I have an autoclicker script it uses the "ä", "ö" and "å" buttons, it works fine, but atleast two of those letters are required in Finnish.
So I want "-" from numpad to toggle the script on or off.
 
Here is what I have

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <[email protected]>
;
; Script Function:
;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

	ä::
	    While GetKeyState("ä", "P"){
 	       Click right
 	       Sleep 50 ;  milliseconds
	    }
	return

	ö::
  	  While GetKeyState("ö", "P"){
  	      Click
  	      Sleep 50 ;  milliseconds
 	   }
	return

	å::
  	  While GetKeyState("å", "P"){
  	      Click Down Right
		Sleep 50
		Click Up Right
 	       Sleep 5 ;  milliseconds
 	   }
	return

and if at all possible, also "/" from numpad could toggle this version of the script

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <[email protected]>
;
; Script Function:
;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

ä::
    While GetKeyState("ä", "T"){
        Click right
        Sleep 50 ;  milliseconds
    }
return

ö::
    While GetKeyState("ö", "T"){
        Click
        Sleep 50 ;  milliseconds
    }
return

å::
    While GetKeyState("å", "T"){
        Click Down Right
	Sleep 50
	Click Up Right
        Sleep 5 ;  milliseconds
    }
return

Sorry, I'm kinda new



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

The HotKey command would probably be the best way to do what you want...

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <[email protected]>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
 
 
; Add this section with your desired hotkeys, then convert your other hotkeys to labels by removing the ";".
; I personally also recommend adding something (I used the word "key" here) after the key name in your labels
; to make them easier to identify at a glance.
NumpadSub::
HotKey, ä, äKey, Toggle
HotKey, ö, öKey, Toggle 
Hotkey, å, åKey, Toggle
Return
 
 
äKey:
     While GetKeyState("ä", "P"){
         Click right
         Sleep 50 ;  milliseconds
     }
return
öKey:
     While GetKeyState("ö", "P"){
         Click
         Sleep 50 ;  milliseconds
     }
return
åKey:
     While GetKeyState("å", "P"){
         Click Down Right
  Sleep 50
  Click Up Right
         Sleep 5 ;  milliseconds
     }
return



HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Try adding NumpadSub::Suspend



jokru
  • Members
  • 12 posts
  • Last active: Sep 03 2015 05:48 PM
  • Joined: 18 Sep 2014

Try adding NumpadSub::Suspend

That does nothing, the script will turn red, but still work



jokru
  • Members
  • 12 posts
  • Last active: Sep 03 2015 05:48 PM
  • Joined: 18 Sep 2014

 

The HotKey command would probably be the best way to do what you want...

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <[email protected]>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
 
 
; Add this section with your desired hotkeys, then convert your other hotkeys to labels by removing the ";".
; I personally also recommend adding something (I used the word "key" here) after the key name in your labels
; to make them easier to identify at a glance.
NumpadSub::
HotKey, ä, äKey, Toggle
HotKey, ö, öKey, Toggle 
Hotkey, å, åKey, Toggle
Return
 
 
äKey:
     While GetKeyState("ä", "P"){
         Click right
         Sleep 50 ;  milliseconds
     }
return
öKey:
     While GetKeyState("ö", "P"){
         Click
         Sleep 50 ;  milliseconds
     }
return
åKey:
     While GetKeyState("å", "P"){
         Click Down Right
  Sleep 50
  Click Up Right
         Sleep 5 ;  milliseconds
     }
return

That one does seem to kinda work, but it still doesn't quite work



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

That one does seem to kinda work, but it still doesn't quite work

Can you clarify what you mean by "doesn't quite work"?



jokru
  • Members
  • 12 posts
  • Last active: Sep 03 2015 05:48 PM
  • Joined: 18 Sep 2014

Can you clarify what you mean by "doesn't quite work"?

Pressing numpad minus doesnt toggle it always



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

Pressing numpad minus doesnt toggle it always

Odd.  It should work fine.  However, I just did some testing, and I am experiencing the same problem.  I was able to fix it by changing the NumpadSub:: section as follows...

NumpadSub::
If ToggleKeys = On
   ToggleKeys = Off
Else
    ToggleKeys = On
HotKey, ä, äKey, %ToggleKeys%
HotKey, ö, öKey, %ToggleKeys%
Hotkey, å, åKey, %ToggleKeys%
Return