FiveM auto process

Ask gaming related questions (AHK v1.1 and older)
Legenden0011
Posts: 1
Joined: 13 Mar 2024, 09:51

FiveM auto process

13 Mar 2024, 10:16

i want a script that can run when i play fiveM its an afk script so i want it to do following

when startet it will press F2
then it will grap an item at x,y
and drag it to x1,y1 and release
then it will wait for 6 sec and start all over again

it would be nice if it could be started and stop from this window

Code: Select all

#SingleInstance, Force
Gui, Add, Button, x0 y21 w121 h29 gstartstop vsstoggle, Start
Gui, Add, Button, x160 y21 w121 h29 gover, E&xit

gui, show, w281 h50

loop {
	while toggle {
                if !toggle
			break
		
		sleep, 500
                if !toggle
			break
	}
}
return

startstop:
	toggle := !toggle
	GuiControl,, sstoggle, % toggle ? "Stop" : "Start"
return

over:
GuiClose:
GuiEscape:
ExitApp

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

[Mod action: Topic moved from "Ask for Help (v2)" since this is v1 code.]
User avatar
mikeyww
Posts: 26977
Joined: 09 Sep 2014, 18:38

Re: FiveM auto process

14 Mar 2024, 10:06

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v1.1.33.11
CoordMode Mouse
x1 := 500
y1 := 500
x2 := 600
y2 := 600
Gui +AlwaysOnTop
Gui Font, s10
Gui Add, Button, w100   , Start
Gui Add, Button, wp   ym, Stop
ButtonStop:
Gui Color, Red
SetTimer Go, Off
GuiControl Enable , Start
GuiControl Disable, Stop
SoundBeep 1000
Show:
Gui Show, NoActivate, Action
Return

ButtonStart:
Gui Color, Green
GuiControl Enable , Stop
GuiControl Disable, Start
SoundBeep 1500
Go:
Gui Submit
Sleep 50
Send {F2}
MouseClickDrag L, x1, y1, x2, y2
Gosub Show
SetTimer Go, -6000
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 38 guests