[NEWCOMER] First self-made script to automate an external GTA V money hack

Post gaming related scripts
ozgur31
Posts: 1
Joined: 03 Mar 2018, 01:52

[NEWCOMER] First self-made script to automate an external GTA V money hack

03 Mar 2018, 02:24

Hey there, let me first introduce myself.
I'm new, very new to the forums and I go by Ozgur31/Ozzy_OD, whatever.
I'm an IT-nerd who specializes in hardware and absolutely SUCKS at software/coding etc.
I'm a nice guy and just wish to be a positive happy go lucky person throughout the rest of my existence. :dance:

So I made my first script to automate a certain action, let me explain.
I have this program that gives me 100k in GTA V once a minute every time I press F9.
I thought this was tedious to do manually and wanted to automate the process so I compiled my first script to do this for me instead!

thoughts? tips? any feedback would be appreciated!
Spoiler
Rangerbot
Posts: 31
Joined: 02 Mar 2018, 10:33

Re: [NEWCOMER] First self-made script to automate an external GTA V money hack

13 May 2018, 04:30

a few small critiques
1. a necessary habit is code indentation, whether you follow general rules or keep it cozy
2. use code tags if you can for legibility when posting

Code: Select all

#SingleInstance Force

;IF NOT A_IsAdmin
;{
;Run *RunAs "%A_ScriptFullPath%"
;ExitApp
;}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;THIS NEXT PART IS THE POP-UP WHEN YOU RUN THE SCRIPT
txt11 =
(Ltrim Join`n
Hello and welcome to using the F9LMs made by Ozzy_OD!
Press Ctrl+J to START and Ctrl+K to STOP.
An audible 'boop' noise will be played to signify the START/STOP input.
An audible 'beep-beep' noise will be heard when the script activates "Job-Hopper.exe".

to get familiar with these sounds, Try the following,
Hold 'Ctrl' and on your Numpad press these:
/ will play the "Start" sound of the script
* Will play the "Cash recieved" sound.
- Will play the "Stop" sound of the script.
)
msgbox, 0, F9-Loop Macro script, %txt11%	
Return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;Sound Effect Testers
^NumpadDiv::	;;StartSound
{
	SoundBeep, 250, 100
	SoundBeep, 750, 250
}
return

^NumpadMult::	;;MoneySound
{
	SoundBeep, 1250, 100
	SoundBeep, 1250, 10]return[/b]
}
return
^NumpadSub::	;;StopSound
{
	SoundBeep, 750, 100
	SoundBeep, 250, 250
}
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;THIS IS WHERE THE MAGIC HAPPENS.	
^j::
	SoundBeep, 250, 100
	SoundBeep, 750, 250
	SetTimer, Loop, % (Toggle:=!Toggle) ? 60000: "Off"		;swaps the value of toggle then tests if toggle is true, if true run Loop ever 60sec else turn Loop off
return

^k::
	SoundBeep, 750, 100
	SoundBeep, 250, 250
	MsgBox, 0, F9-Loop Macro script, You have now stopped using the F9-Loop Macro script!
	Sleep 200
	ExitApp
return

Loop:
	Send {F9}
	SoundBeep, 1250, 100
	SoundBeep, 1250, 100
return
if you use {} braces after a hotkey definition then it will only run what is in the chunk (no return necessary)
however if you have no braces it will treat is like a goto label and run from that point (return necessary)

edit: thanks for the note :)
Last edited by Rangerbot on 14 May 2018, 04:05, edited 2 times in total.
gregster
Posts: 8988
Joined: 30 Sep 2013, 06:48

Re: [NEWCOMER] First self-made script to automate an external GTA V money hack

13 May 2018, 11:48

Rangerbot wrote:if you use {} braces after a hotkey definition then it will only run what is in the chunk (no return necessary)
I am afraid, this is wrong. { } blocks have no effect in a hotkey definition (as long as they don't belong to a loop, if statement etc.). You will still need a return to end the hotkey definition.
Compare the docs:
Although blocks can be used anywhere, currently they are only meaningful when used with functions, Else, Loop, or an IF-type command such as IfEqual or IfWinExist.
(https://autohotkey.com/docs/commands/Block.htm)

To confirm, try (just hit a ):

Code: Select all

a::
{  
	msgbox inside the block
}
msgbox block party
; return could help here

b::
msgbox Oh, b...locks! Script will exit...
ExitApp
(same effect with your soundbeeps above, Rangerbot)
Just always use a return at the end of a multi-line hotkey definition. After a one-liner, like a::msgbox, it can be left out without problem, though.

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 24 guests