Los Santos Real World Roleplay | SA-MP Roleplay Server
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[GUIDE]Auto Hot Key Basic Tutorial

4 posters

Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Sun Apr 10, 2011 10:18 pm

What is AHK?

AHK or Auto Hot Key was a Program that to make a bind key. So it's some kind of macro that will type automatically when we press one of Hotkey that we use on that program. With this we can RPly easily without typing so much word and shorten the time when we use it on RP, I am using this when I am writing /me and /do command to reduce the time to typing.

Where can I Download it?

You can check on this page http://www.autohotkey.com/download/

Tutorial 1 : How to make an AHK script?

1. Open the AHK shortcut program

2. Take a look at bottom right corner and find AHK icon and right click on it and choose "Edit this Script"

[GUIDE]Auto Hot Key Basic Tutorial  Step%201

Tutorial 2 : Making a simple command in AHK

Let me show you the code first and I'll explain every piece of that later

Code:
^g::
SendInput t/me Takes out his .45 from his belt.{enter}
return

^g:: "It's command the script to run the script when we pressed Ctrl+G"
SendInput "It's command the script to Send Keystrokes Input"
t/me Takes out his .45 from his belt. " t To trigger the text input in SA-MP and the rest is The output when we pressed Ctrl+G"
{enter} "To end it with {enter} keystrokes and your /me will appear without needing to press the Enter anymore."
return "to end the command and not keep running when we start another command (This is have to be added every command)"

Tutorial 3 : Making Double line in one Command

Code:
^g::
SendInput t/me Takes out his .45 from his belt.{enter}
SendInput t/me Aims the .45 at the suspect.{enter}
return

It's same with Tutorial 2, the different things is, in this script with one hotkey (Ctrl+G) it will show 2 line of /me. InGame it will show like this

*Kazuya Nakata Takes out his .45 from his belt.
*Kazuya Nakata Aims the .45 at the suspect.

This things would be convenient for LSPD to force the suspect RP Fear Very Happy

Tutorial 4 : Delaying between command

Hmm Self explanation I think Smile

Code:
^g::
SendInput t/me Takes out his .45 from his belt.{enter}
Sleep 3000
SendInput t/me Aims the .45 at the suspect.{enter}
return

So in this tutorial I'll only explain the Sleep 3000 script

Sleep in AHK script function is to add delay time to the script, so I'll give it Sleep between those command to prevent automatic anti-spam.
because this script using [millisecond] variable so to add 3 seconds delay I wrote it 3000 (3000 ms = 3 seconds)

Tutorial 5 : Making a variable or string

Code:
^a::
MyString = The Best
SendInput t/me and Carlos are %MyString%.{enter}
return

It will show

*Kazuya Nakata and Carlos are The Best.

Tutorial 6 : Loops

Code:
^a::
MyVar = 1
SendInput t/me start drinking the soda.{enter}
Loop 3
{
    SendInput t/do %MyVar%/3{enter}
    MyVar++
    Sleep 1000
}
SendInput t/me throws away the soda can{enter}
return

It would show

* Kazuya Nakata start drinking the soda.
* 1/3 (( Kazuya Nakata ))
(( 1 Second Delay ))
* 2/3 (( Kazuya Nakata ))
(( 1 second delay ))
* 3/3 (( Kazuya Nakata ))
((1 second delay))
* Kazuya Nakata throws away the soda can.

Tutorial 7 : Random Command

Code:
^g::
Rand = 0
Random, Rand, 1, 3
if(Rand == 1)
{
    SendInput t/me Takes out his .45 from his belt.{enter}
}
else if(Rand == 2)
{
    SendInput t/me Takes out his .45 from his coat.{enter}
}
else if(Rand == 3)
{
    SendInput t/me Takes out his .45 from his bag.{enter}
}
return

It would show one of the command randomly

I am sorry if I have very bad grammar, and this tutorial is far from perfection, if you have something to ask to me about AHK Script don't hesitate to Reply this thread to ask me Smile
Also if I had mistype or something wrong on these code, go on correct me Smile

Thanks for sparing your time to read this simple tutorial. Happy RPing Very Happy



Last edited by Daichi_Nakata on Sun Apr 17, 2011 6:44 am; edited 1 time in total
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Hossien Sun Apr 10, 2011 10:31 pm

Awesome, but i think SA:MP keybinder is same.
Hossien
Hossien
Member
Member

Posts : 58
Reputation : 0
Join date : 2011-03-29
Age : 39
Location : 455

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Co-Owner Sun Apr 10, 2011 10:38 pm

Hossien wrote:Awesome, but i think SA:MP keybinder is same.

I never heard of that Question
Co-Owner
Co-Owner
Member
Member

Posts : 30
Reputation : 2
Join date : 2011-04-09

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Hossien Sun Apr 10, 2011 10:45 pm

Alex_Josh wrote:
Hossien wrote:Awesome, but i think SA:MP keybinder is same.

I never heard of that Question

SA:MP Keybinder let you fast-command, example: i pressed key E, it says 'Hossien Newman has opened a Cola'.
Hossien
Hossien
Member
Member

Posts : 58
Reputation : 0
Join date : 2011-03-29
Age : 39
Location : 455

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Sun Apr 10, 2011 10:51 pm

Hossien wrote:Awesome, but i think SA:MP keybinder is same.

Well, it's just alternative from SA:MP keybinder Very Happy
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Co-Owner Sun Apr 10, 2011 11:11 pm

LOL i never heard of it . How do i use it?
Co-Owner
Co-Owner
Member
Member

Posts : 30
Reputation : 2
Join date : 2011-04-09

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Sun Apr 10, 2011 11:18 pm

Alex_Josh wrote:LOL i never heard of it . How do i use it?

So what program are you using Alex? is it AHK too like me?
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Co-Owner Sun Apr 10, 2011 11:21 pm

Daichi_Nakata wrote:
Alex_Josh wrote:LOL i never heard of it . How do i use it?

So what program are you using Alex? is it AHK too like me?

No i aint using any program and i think i dont need it i can type good
Co-Owner
Co-Owner
Member
Member

Posts : 30
Reputation : 2
Join date : 2011-04-09

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Bl4ckJack Tue Apr 12, 2011 4:03 pm


This works very very well to...
Bl4ckJack
Bl4ckJack
Game Admin
Game Admin

Posts : 188
Reputation : 5
Join date : 2011-04-06
Location : Europe

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Tue Apr 12, 2011 7:50 pm

Bl4ckJack wrote:
This works very very well to...

Damn that's the automatic one, mine seems lame Sad I'll try Smile thanks for share the video Smile
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Bl4ckJack Wed Apr 13, 2011 4:07 am

Damn that's the automatic one, mine seems lame Sad I'll try Smile thanks for share the video Smile

To be honest i'm just very very lazy, you're amazing, big-ups to you Very Happy
Bl4ckJack
Bl4ckJack
Game Admin
Game Admin

Posts : 188
Reputation : 5
Join date : 2011-04-06
Location : Europe

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Wed Apr 13, 2011 4:34 am

Bl4ckJack wrote:
Damn that's the automatic one, mine seems lame Sad I'll try Smile thanks for share the video Smile

To be honest i'm just very very lazy, you're amazing, big-ups to you Very Happy

Hhaha not really, i think i'll keep using AHK beside it had more feature than SAMP bind, like Auto Click, Random, unfortunately it's not automatic. And it's pretty easy though
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Bl4ckJack Wed Apr 13, 2011 3:17 pm

Daichi_Nakata wrote:Hhaha not really, i think i'll keep using AHK beside it had more feature than SAMP bind, like Auto Click, Random, unfortunately it's not automatic. And it's pretty easy though
I use AHK for Auto Click and Auto Space for CS:S.

Shhhhhhhhhhhhhhhhhhhhhhh...
Bl4ckJack
Bl4ckJack
Game Admin
Game Admin

Posts : 188
Reputation : 5
Join date : 2011-04-06
Location : Europe

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Bl4ckJack Sun May 01, 2011 4:41 am

Ahhh, I just read through the article again and wanted to know about the delay thing, I may make a hot key script for it now! Thanks Smile
Bl4ckJack
Bl4ckJack
Game Admin
Game Admin

Posts : 188
Reputation : 5
Join date : 2011-04-06
Location : Europe

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Sun May 01, 2011 7:57 pm

Bl4ckJack wrote:Ahhh, I just read through the article again and wanted to know about the delay thing, I may make a hot key script for it now! Thanks Smile
Anytime Smile you can ask me if you don't know about something Smile
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Bl4ckJack Mon May 02, 2011 4:00 am

Daichi_Nakata wrote:
Anytime Smile you can ask me if you don't know about something Smile

Sad news...
I've become a cop. I have yet to put an IC message to you about James Connor.

:'(

I dun wanna leave u. D':
Bl4ckJack
Bl4ckJack
Game Admin
Game Admin

Posts : 188
Reputation : 5
Join date : 2011-04-06
Location : Europe

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Mon May 02, 2011 7:06 am

What is ur IG name ?
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by daichi_nakata Mon May 02, 2011 7:06 am

Btw any kind of thanks for my guide welcomed Smile
daichi_nakata
daichi_nakata
Game Admin
Game Admin

Posts : 181
Reputation : 14
Join date : 2011-04-09
Age : 29
Location : In front of my PC/Laptop

http://www.catataninternet.org

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Bl4ckJack Mon May 02, 2011 1:23 pm

Daichi_Nakata wrote:What is ur IG name ?
Colonel Ronnie Clay of San Andreas State Police.
Bl4ckJack
Bl4ckJack
Game Admin
Game Admin

Posts : 188
Reputation : 5
Join date : 2011-04-06
Location : Europe

Back to top Go down

[GUIDE]Auto Hot Key Basic Tutorial  Empty Re: [GUIDE]Auto Hot Key Basic Tutorial

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum