Help me fine tune this please

Ask gaming related questions (AHK v1.1 and older)
sdkyron
Posts: 61
Joined: 06 Aug 2018, 00:57

Help me fine tune this please

06 Aug 2018, 01:07

Hey,

So, i've made this little script for Fortnite (STW).

The goal is to have it spam click the mouse button while i keep it pressed down and also move the mouse slightly down for every shot to compensate for recoil.

Code: Select all

##NoEnv
#SingleInstance, force

SetBatchLines -1

SetKeyDelay, 30
SetMouseDelay, 10

correctX := 0 ; Horizontal recoil correction, + right - left
correctY := 5 ; Vertical recoil correction, + down - up

~LButton::
	if WinActive("Fortnite")
	{
		KeyWait LButton, T0.35

		If ErrorLevel
		{
			While GetKeyState("LButton", "P") && !GetKeyState("Ctrl", "P")
			{
				Click
				MouseMove, %correctX%, %correctY%, 1, R
			}
		}
	}
It works but since i'm a beginner with AHK i was wondering if it was possible to improve it somehow ?
Last edited by sdkyron on 15 Aug 2018, 08:49, edited 1 time in total.
sdkyron
Posts: 61
Joined: 06 Aug 2018, 00:57

Re: Help me fine tune this please

07 Aug 2018, 01:56

Nobody ? :(
sdkyron
Posts: 61
Joined: 06 Aug 2018, 00:57

Re: Help me fine tune this please

15 Aug 2018, 08:49

Come on, anyone ?
sdkyron
Posts: 61
Joined: 06 Aug 2018, 00:57

Re: Help me fine tune this please

21 Aug 2018, 09:20

Well this forum is helpful, there's no denying that...
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Help me fine tune this please

21 Aug 2018, 11:13

the question is vague, which is why u arent getting any responses. i doubt very many people have the inclination to debug yet another fortnite script and also prod u for additional information at the same time.

form a more precise question. improve it in what way? is there anything wrong with it? is it not working?
sdkyron
Posts: 61
Joined: 06 Aug 2018, 00:57

Re: Help me fine tune this please

21 Aug 2018, 13:08

There are always ways code can be improved, i used to write my own complete UI for world of warcraft but it was in LUA, and since i'm not a programmer i had to learn very slowly but one of the thing i've learned is that code can always be improved, be more efficient, be less memory intensive, etc etc...

In this specific case for example i know there's an issue but i can't figure out why, yes it's working but, the MouseMouve part works only when it wants, there are moments when it just doesn't, for no obvious reason, yet, the code works..

My initial thought was that it's because there simply too much to do for just one "mouse held down" event but sinc ei'm not a pro AHK, i can't tell.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 73 guests