[GUIDE] Using Autohotkey + Suitable scripts
Posted: June 11th, 2018, 2:09 pm
Autohotkey
AutoHotkey is a free, open-source scripting language for Windows that allows users to easily create small to complex scripts for all kinds of tasks such as: form fillers, auto-clicking, macros, etc. Keybinding means to assign hotkeys to specific functions.
Autohotkey can also be used to keybind SAMP commands.
Using AHK for SAMP
- Downloading and Installing AHK: Get a version of Autohotkey from here and install it.
- Making a script: Click your right mouse button and navigate to "New" --> Autohotkey script. Name it whatever you want, for example "Tomasso's script". Right click on it again and select "edit script". You will see a block of text. Ignore it and start your script from below (leaving a single line).
Spoiler
- Making it functional: Type the keys you want to use for a specific command. Each key has its own name.
- Let's say we're going to use they key "F2" for the command "/help". Type F2 in the line and then :: (without space). After the proportion sign, add space and type "SendInput" (without the inverted commas). Add a space again and then type "t/help{Enter}" (without the inverted commas). You can add any other command instead of /help.
Code: Select all
F2:: SendInput t/help{Enter}
Spoiler - You can add more commands to the same hotkey. After "{Enter}" type "t/kill{Enter}" without adding space. The commands will proceed in the written order. If you place /kill command first, then it'll proceed with that first.
Code: Select all
F2:: SendInput t/help{Enter}t/kill{Enter}
Spoiler - If you don't add "{Enter}" to the end of your commands, it will leave the command line open with the command already written (means you will have to press Enter manually to make the command work).
Code: Select all
F2:: SendInput t/help{Enter}t/kill
SpoilerSpoiler - You can also create a CUSTOM hotkey by adding "&" between two key names. For example, if we want to use Control and P at once for /p, we will type
Code: Select all
Ctrl & P:: SendInput t/p This is the SAPD - Pull over to the right side of the road and turn your engine off!{Enter}
Spoiler - If you want to use more keys for other binds, just start writing your second command on the second line.
Code: Select all
Ctrl & P:: SendInput t/p This is the SAPD - Pull over to the right side of the road and turn your engine off!{Enter} Ctrl & Z:: SendInput t/tz{Enter}
Spoiler - Saving your script: Click on "File" at the top left corner of the notepad and click "Save".
Spoiler
- Running your script: Click your script in order to run it. Launch your game and you're good to go!
- Testing your script: Open notepad and hit your desired key to check whether or not the binds work.
NOTE: You may assign your own keys by using the proper key names. You can use as many binds for a single key. However, avoid using only alphabet keys which may trigger while you're typing something (like I am right now).
Suitable Scripts
- For LEAs
Code: Select all
Ctrl & J:: SendInput t/duty{Enter}t/heal{Enter}t/givegun{Enter} Ctrl & K:: SendInput t/getfreq 1{Enter}t/syncradio 1{Enter}t/r U*** reporting on duty.{Enter} Numpad0:: SendInput t/engine{Enter} Ctrl & Numpad0:: SendInput t/engine{Enter}t/car fix{Enter}t/engine{Enter} Ctrl & P:: SendInput t/p This is the SAPD - Pull over to the right side of the road and turn your engine off!{Enter} Ctrl & Z:: SendInput t/tz{Enter} F2:: SendInput t/bk{Enter}t/d F3:: SendInput t/em{Enter}t/d Need immediate backup at my location, over!{Enter} F5:: SendInput t/me takes out his cuffs and places them on the suspect's wrists.{Enter}t/cuff F6:: SendInput t/me pushes the suspect inside the cruiser.{Enter}t/get
- For illegals
Code: Select all
Numpad0:: SendInput t/engine{Enter} Ctrl & Numpad0:: SendInput t/engine{Enter}t/car fix{Enter}t/engine{Enter} F5:: SendInput t/fbk{Enter}t/r Need you all at my location.{Enter} Ctrl & P:: SendInput t/sellgun Ctrl & Z:: SendInput t/usedrugs heroin{Enter} Alt & J:: SendInput t/floadguns{Enter}t/floadbullets{Enter} Alt & K:: SendInput t/fillhqstock{Enter} Ctrl & J:: SendInput t/loadbulletcrates{Enter}t/loadguncrates{Enter} Ctrl & K:: SendInput t/sellbulletcrates{Enter}t/sellguncrates{Enter}
- For dealers
Code: Select all
Ctrl & O:: SendInput t/openbets 0{Enter} Ctrl & P:: SendInput t/closebets{Enter}t/roulette{Enter} Alt & P:: SendInput t/blackjack{Enter}
OPEN YOUR SCRIPT, CLICK EDIT SCRIPT AND PASTE THIS SCRIPT BELOW THE BLOCK OF TEXT.
Spoiler
If you have problems using AHK or need some help, just PM me in-game or on forums so I can help you ASAP.