Argonath RPG - A World of its own

GTA:SA => SA:MP General => SA:MP - San Andreas Multiplayer => Guides & Tutorials Showcase => Topic started by: Vaeldious on September 04, 2017, 03:04:48 pm

Title: [Guide] AutoHotKey Script Guide
Post by: Vaeldious on September 04, 2017, 03:04:48 pm
(https://autohotkey.com/docs/static/ahk_logo_no_text.png)
AutoHotKey Script Guide

Hey there! I get asked this question quite a bit, so thought I'd share with everyone how to set up some magical keybinds!

First, the rules.

Rules: (http://www.argonathrpg.eu/index.php?topic=116540.0)
- You must be present when keybinds are running.
- You cannot create keybinds which run for more than 30 seconds per activation.


Basically, don't bot or be an asshole. Pretty simple.

You can get AutoHotKey from here (https://autohotkey.com/download/). Download the Zip for portable, installer for non-portable version. Once installed, it'll pop open the helpfile. This can be extremely useful for reference.

Now, we're gonna create a new script. Go ahead and create a new notepad document, and import the following into the text file:
Code: [Select]
NUMPAD0::
Send t/paytoll{enter}
Return

NUMPAD1::
Send t/engine{enter}
Return

NUMPAD2::
Send t/fillup{enter}
Return

NUMPAD3::
Send t/repairvehicle{enter}
Return

Next, hit File > Save As... and save the new file as Argonath.ahk (instead of .txt). Now, when double clicking the script, it will automatically launch!

Useful Combos:
Code: [Select]
# Win (Windows logo key).
! Alt
^ Control
+ Shift
< Use the left key of the pair. e.g. <!a is the same as !a except that only the left Alt key will trigger it.
> Use the right key of the pair.

For example, !NUMPAD0:: is Alt + Numpad 0, <!NUMPAD0:: is only left Alt + Numpad 0.

In some games/instances, you have to simulate both keypress and keyrelease (otherwise they are not detected). A 1/10th of a second (100ms) delay is sufficient for most games.

Code: [Select]
    Send {Enter down}
    Sleep 100
    Send {Enter up}

Here's an example of scripting vehicle repair for the server.

Code: [Select]
NUMPAD3::
Send t/engine{enter}
Sleep 100
Send t/repairvehicle{enter}
Sleep 4000
Send t/engine{enter}
Return
Turns the engine off, sends the command to repair, waits 4 seconds, turns the engine back on.

EZ-PZ!

You can edit a live script by right clicking the icon in the taskbar. Once you save it, be sure to right click the icon again and reload the script so the changes can be updated!
Reference: Keylist (https://autohotkey.com/docs/KeyList.htm)
Reference: Hotkeys and Modifiers (https://autohotkey.com/docs/Hotkeys.htm)

Hope this helps!
Title: Re: [Guide] AutoHotKey Script Guide
Post by: Cyd Parker on September 04, 2017, 04:05:16 pm
This is bannable to use for cooking meth if I'm not wrong, right?
But anyways, The guide was helpful.
Title: Re: [Guide] AutoHotKey Script Guide
Post by: Vaeldious on September 04, 2017, 04:17:47 pm
This is bannable to use for cooking meth if I'm not wrong, right?

You'd be wrong. It is not bannable, provided you follow the Rules.

Originally, Meth was not randomly timed and had a very predictable window between each phase (stage 2 started around 1 min 25 sec in, for example). One player automated and looped it, and went afk for the rest of the night while his meth cooked. He was caught by not responding to RP. As a result, the timer between meth stages is now a wide random window (requiring you to be present to see the smoke and respond), and Teddy posted those rules I referenced.

As long as each keypress results in an action that takes less than 30 seconds (like simply adding an ingredient to meth) it is fine. TBH, Argo would actually be really difficult to automate any of the jobs anymore.
SimplePortal 2.3.7 © 2008-2025, SimplePortal