Jump to content

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

The definitive autofire thread!


  • Please log in to reply
130 replies to this topic
Ichy
  • Guests
  • Last active:
  • Joined: --
Hi, im intressted in this script:
$a::
    KeyWait a, T0.5                 ; Wait 1/2 second for user to release "a" key
    If ErrorLevel                   ; Still held down
        While GetKeyState("a","p"){ ; While it's held down
            Click
            Send a
            sleep 100
        }
    Else                            ; They let go in time
        Send a
return

I want to press "XButton1" and then send "o" key.
I've tried to understand how to change the keys but i cant get it to work properly

Please help
Yours, Ichy

Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011
Loop
	{	
		if(GetKeyState("xbutton1", "D"))
			{
				send {o down}
				sleep 30
				sleep 30
				sleep 30
				sleep 30
				Send {o up}
			}
		else
			{
				GetKeyState, xbuttonState, xbutton1, P
				if xbuttonstate = U
					{
						Break
					}
			}
	}
Return

Give that a go :)

DixonPro
  • Members
  • 4 posts
  • Last active: Nov 21 2011 01:27 AM
  • Joined: 24 Mar 2011
How would I go about combining the "Toggle" with the "Hold To Rapid Click"? For example if I wanted the "Hold to Rapid Click" to be toggled on and off by the Q key.

Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011
if you mean you press Q then when you hold Lclick it rapid fires?

give this a go

SetTimer Click, 100

Q::Toggle := !Toggle

Click:
    If (!Toggle)
		{
			send {Click Left}
			Return
		}
	else
		{
			Loop
				{
					if(GetKeyState("lbutton", "D"))   
						{
							Click
						}
					else
						{
							Break
						}
				}
		}
return


DixonPro
  • Members
  • 4 posts
  • Last active: Nov 21 2011 01:27 AM
  • Joined: 24 Mar 2011
SetTimer Click, 100

Q::Toggle := !Toggle

Click:
    If (!Toggle)
		{
			send {Click Left}
			Return
		}
	else
		{
			Loop
				{
					if(GetKeyState("lbutton", "D"))   
						{
							Click
						}
					else
						{
							Break
						}
				}
		}
return

When I run that script it starts clicking by itself right off the bat. Q seems to toggle it off and on fine though.

But yeah I meant you press Q and it waits for you to hold down the mouse button and when you press Q again it stops listening.

Bugz000
  • Members
  • 155 posts
  • Last active: Oct 14 2015 01:03 PM
  • Joined: 24 Feb 2011
i went into my archive and found this old script - works fine

q::pause
~*Lbutton::						
if(GetKeyState("Lbutton", "D"))          	 	 
	Loop
		{
			Sleep, -1
			send {click Left}
			GetKeyState, LbuttonState, Lbutton, P			
			if Lbuttonstate = U
			break
		}
	return


Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011
I'd love to see this either as its own sticky in the "Ask for help" section,
or to make a sticky along the lines of "Most requested hotkeys" and have this as one of the links.
Otherwise someone has to write a question,
and someone else has to paste the link (if they know about it), almost everyday.

...

i:=0
F7::SetTimer, Spam, % (i:=!i) ? "100" : "Off" ; uses ternary

Spam:
Click
Send a
return

Is the i:=0 needed in AHK basic or something?
I have not found a reason for including it.

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File


Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
In this case, no, it's not needed. It's usually good practice to include it.

Any variable, until set, is an empty string. In AutoHotkey "(i := !i)" means "assign i to the opposite of i". And "the opposite of {empty string}" is true or 1.

In other cases, like a counter, this will mess you up. "{empty string} + 1" is an error, which will silently fail, and you'll get another empty string.


About the sticky, people tend to ignore the ones we have. I don't know how much good it would do, especially about a specific topic.
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011
Thanks for clearing that up.

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File


automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006
The first post is one of the best posts I saw in this forum. Looking at fundamental situations, great. Short and powerful.

Having a similar another thread where the cases of key-use are analyzed would be great. Especially things like multi-key-use for hotkeys, from 2-key-use up to 6-key-use, or morsing-with-one-hand-while-the-other-hand-chords-up-to-four-keys, or using layout-invariant-hotkey-definitions, or inverting positions of hotkeys, e.g. 1 & 2:: ... vs. 2 & 1:: ... vs. lcontrol & 1:: ... vs. 2 & lcontrol:: ... vs. 2 & 3:: ... all in the same code. How to quickly define range-based-hotkeys, e.g. from f1..f12, homerow, above-homerow, below-homerow, number-one-to-zero, arrow-keys, numpad-section, left-modifier-keys, right-modifier-keys, special-gaming-keys. And things like assigning a visual-x-y-coordinate to each key position, in a layout invariant way.

Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011

For cycling you can use an array, instead of creating a string and then using the stringsplit command.

Arrays have a maxindex() method that can be used to determine when you have reached the end of the sequence.

sequence := ["{lwin}", "note", "{enter}", "test", "^a", "{bs}", "{click 19 39}x"]

i := 0

f1::
i := (i = sequence.MaxIndex()) ? (1) : (i+1)
Sendinput, % sequence[i]
Return

As a function:

sequence1 := ["ã", "{bs}á", "{bs}â"]
sequence2 := [1, 2, 3, 4, 5, 6, 7]

#a::cycle(sequence1)
f1::cycle(sequence2)

cycle(sequence) {
    Static i := 0
    If (a_thishotkey != a_priorhotkey)
    {
        i := 0
    }
    i := (i = sequence.MaxIndex()) ? (1) : (i+1)
    Sendinput, % sequence[i]
}

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File


petur170
  • Members
  • 2 posts
  • Last active: Jan 25 2012 04:07 AM
  • Joined: 24 Jan 2012
Hi there, thanks for the scripts, but can you make a code where you press ctrl and then whenever your hold down left button you rapid fire (1 per 30 milliseconds until you press ctrl again (ctrl is a toggle). I'm not really a coder and i'm a bit lazy so,

Thanks alot!

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006
I would like a forum-rating feature, where users can rate posts with +1 or -1, that's it. Simple and powerful. What this would allow, e.g. if rating < -threshold, send post-author email that their post will be auto-deleted in one-week, if they do not edit/improve their post. So the post-author would have one week time to improve their old post. If not, it would auto-disappear from the forum. Simple and the house would be auto-clean, or not?

To make it even a gaming-fun experience in the forum, the deleted-posts negative points would be written as positive-points among the FIRST 50 -1 raters, into their cleaning-activity-account .

Somehow using +1/-1 ratings, forum activity, quality ratings could be turned into a gaming-experience, maybe, any already existing solutions known?


Update: Even more fun, based on threshould "one week" could be dynamic instead. e.g.
rating < -50: 7 days
rating < -100: 6 days
rating < -200: 5 days
rating < -400: 4 days
rating < -800: 3 days
rating < -1600: 2 days
rating < -3200: 1 day
rating < -6400: 12 hours
rating < -12800: 6 hours

Every post would have a mini-plot below, about its rating-curve development. Each post would be like a share or something, hey I like this idea. :) A sparkline plugin for phpbb would be great for this: <!-- m -->http://en.wikipedia.org/wiki/Sparkline<!-- m -->

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
Uhm... getting your post deleted isn't fun. The only time I've seen that done at all well is on StackExchange. Even there is has flaws, and questions get closed a little too early.
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006

Uhm... getting your post deleted isn't fun. The only time I've seen that done at all well is on StackExchange. Even there is has flaws, and questions get closed a little too early.

Ok, delete could be replaced by move-into-trash-subforum.