Page 1 of 1

(AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 10th, 2020, 6:53 pm
by Ralph_
Image
Download link to the latest version: Click Here

What is AHK?
In simple words, AHK is a keybinder not specifically for SA:MP but for the entire Windows OS. You can learn more about it on their website. We'll only be discussing uses of AHK in SA:MP here.


AHK script basics and how to get going:
After you download and install AHK, do the following steps to make an AHK script file:
Desktop > Press RMB > New > Create a AHK Script > Press RMB on the script > Edit Script > Erase all the shit that's already written there
When you're done with that, you can start writing your first ever bind for SAMP, yay!

Starting off, you'll want to copy-paste the following on the top of your Notepad script so your script only works for SA:MP.

Code: Select all

#IfWinActive, GTA:SA:MP
A SA:MP script would typically contain the following:
KEY:: (By pressing this, you'll activate your BIND)
SendInput (This is the action that will take place once you press the button above)
Return (This marks the end of your bind)

A cute example:

Code: Select all

Numpad1::
SendInput t/engine{ENTER}
return
The script above turns on/off your vehicle's engine when you press Numpad 1. Pretty self-explanatory. After you're done, close the Notepad and hit SAVE after which you can double click the AHK file on your Desktop (A icon should appear on the taskbar below after it) to open it and use it in-game. Editing it later is almost the same process, you 'Edit Script' and then after you're done, you can open the taskbar, press RMB on the script file and hit "Reload Script."


Some useful scripts:
=>/ftakegun War Script | Automatically takes 1x Deagle and 2x M4's from the fstock when you press Numpad7

Code: Select all

Numpad7::

wait = 350 ; Milliseconds

SendInput t/ftakegun{ENTER}
Sleep, %wait%
SendInput {ENTER}
Sleep, %wait%
SendInput {DOWN 4}{ENTER}
Sleep, %wait%
SendInput {DOWN 4}{ENTER}
Sleep, %wait%
SendInput {ESC}
return



->/givegun script for factions | Automatically uses /heal and /givegun for you when you press Numpad6

Code: Select all

Numpad6::

wait = 350 ; Milliseconds

SendInput t/heal{ENTER}t/givegun{ENTER}
Sleep, %wait%
SendInput {ENTER}
Sleep, %wait%
SendInput {ESC}
return



-> Instant carfix | The title says it all.

Code: Select all

Numpad2::
SendInput t/engine{ENTER}t/car fix{ENTER}t/engine{ENTER}
return



-> Anti-MG | Horny people reporting you for saying "LOL" IC? Here's a fix with AHK. Whenever you say shit like "LOL" "WTF" it automatically changes it to the roleplay term for it. Example: LOL will turn to /me laughs out loud.

This is for those who use ` to open chat like me:

Code: Select all

::``lol::/me laughs out loud.
return

::``omg::/s Oh my god{!}
return

::``omfg::/s Oh my fucking god{!}
return

::``ty::Thanks.
return

::``wtf::/s What the fuck?{!}
return

::``stfu::/s Shut the fuck up{!}
return

::``ty::Thank you.
return

And this is for those who use T to open chat:

Code: Select all

::tlol::/me laughs out loud.
return

::tomg::/s Oh my god{!}
return

::tomfg::/s Oh my fucking god{!}
return

::tty::Thanks.
return

::twtf::/s What the fuck?{!}
return

::tstfu::/s Shut the fuck up{!}
return



-> Abbreviations - Shortened versions for the long ass commands because we're all lazy, right?

For people who use ` to open the chat

Code: Select all

::`/th::/tracehouse

::`/tb::/tracebiz

::`/tn::/tracen

::`/tp::/traceplate

For people who use T to open the chat

Code: Select all

::t/th::/tracehouse

::t/tb::/tracebiz

::t/tn::/tracen

::t/tp::/traceplate


Probably gonna post more scripts as we go forward but this is all for now. Hit me up on Discord (Aman_#8696) if you encounter a problem or use SAMP Addon. I take in-game cash only, ty.

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 10th, 2020, 7:03 pm
by Golden
u da real mvp my man

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 10th, 2020, 7:08 pm
by Zlaja
Damn this is one sexy guide.

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 10th, 2020, 7:16 pm
by Punjabi
Newbie.. learn how to on/off the script while being in game :P

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 10th, 2020, 7:43 pm
by Ralph_
Punjabi wrote:
May 10th, 2020, 7:16 pm
Newbie.. learn how to on/off the script while being in game :P
like that's some Einstein tier shit to do?

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 16th, 2020, 10:54 am
by Schultz
Loved it...CPL Ralph rocks..Aka Mr Aman <3

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: May 16th, 2020, 1:35 pm
by C-Slo
Helper wannabe hhhhh

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: June 5th, 2020, 2:39 am
by Light
good job

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: August 14th, 2020, 10:25 pm
by Ralph_
-> Abbreviations - Shortened versions for the long ass commands because we're all lazy, right?

For people who use ` to open the chat

Code: Select all

::`/th::/tracehouse

::`/tb::/tracebiz

::`/tn::/tracen

::`/tp::/traceplate

For people who use T to open the chat

Code: Select all

::t/th::/tracehouse

::t/tb::/tracebiz

::t/tn::/tracen

::t/tp::/traceplate

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: August 14th, 2020, 10:40 pm
by C-Slo
No thank you

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

Posted: January 26th, 2022, 4:45 pm
by Ralph_
Bumping this for whoever needs it for the war. Some useful war scripts.