Can someone help me making this autofire script? Topic is solved

Ask gaming related questions (AHK v1.1 and older)
pickieliz
Posts: 2
Joined: 05 Oct 2020, 20:51

Can someone help me making this autofire script?

Post by pickieliz » 05 Oct 2020, 21:21

First, thank you for your time and for trying to help me.

I'm trying to use an autofire script for a semi-auto weapon in an FPS game, but I've faced some problems.

I need between 1 or 0.5 seconds delay before the autofire activates, to keep changing between semi auto fire and "automatic" fire if needed
The autofire mode its activated only if Rbutton and Lbutton are pressed at the same time
And I'm trying as well to randomize the ms delay between 10 to 30 to avoid the anti-cheat software in the game

Basically, what I've tried to do its to merge the functionality of these 2 scrips in one, but with no success:

autofire with Left and right mouse buttons pressed:

Code: Select all

~rbutton & lbutton::
While GetKeyState("rbutton","D"){
Click
Sleep 50 ; milliseconds
}
return
autofire with 1 sec delay:

Code: Select all

~lbutton::
    KeyWait lbutton, T0.1
    If ErrorLevel
        While GetKeyState("LButton", "P"){
            Click
            Sleep 25
        }
[Mod edit: [code][/code] tags added.]

and about the ms delay, I couldn't find any script

I'm new doing scripts and stuff, hope u guys can help me, thanks in advance

User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Can someone help me making this autofire script?  Topic is solved

Post by Xtra » 05 Oct 2020, 22:47

Code: Select all

~rbutton & lbutton::
While GetKeyState("rbutton","P"){    ; <<<< Should be  P not D
Click
Random, time, 10, 30
Sleep time ; milliseconds
}
return
KeyWait lbutton, T0.1 is 100ms see: KeyWait

HTH

pickieliz
Posts: 2
Joined: 05 Oct 2020, 20:51

Re: Can someone help me making this autofire script?

Post by pickieliz » 06 Oct 2020, 17:43

Yes! Finally! Thank you @Xtra, you helped me a lot.

Post Reply

Return to “Gaming Help (v1)”