Hi! Can you please help me with a script for SA:MP Game. I want to make a script that when i type in Game a command like /drugsID (/drugs164 for example) to send some text in chat like “Hi! You were suprised with drugs on you, so it will be confiscated!” and then send a command in the Game with /confiscate 164 drugs and then press enter. Can you please help me with this? I am reading a lot of topics, but no help.
I know that to send text in chat i can use command SendInput
Like “SendInput tHi. You were suprised with drugs on you, so it will be confiscated. {Enter}” but i don’t know how can i read that id and then send the command.
Help with AHK and variables.
Re: Help with AHK and variables.
Hallo,
perhaps this Hotstring?
perhaps this Hotstring?
Code: Select all
:?t:drugs164::Hi! You were suprised with drugs on you, so it will be confiscated!
Re: Help with AHK and variables.
It’s not what i want. I want to type /drugs +iD and the script will sent a text that i want and then type the command /confiscate iD drugs and press ENTER.Rohwedder wrote: ↑07 Jan 2019, 02:53Hallo,
perhaps this Hotstring?Code: Select all
:?t:drugs164::Hi! You were suprised with drugs on you, so it will be confiscated!
Re: Help with AHK and variables.
then perhaps:
Code: Select all
:*:/drugs:: ;type /drugs012
Input, ID, L3 ;ID must have 3 digits
ID += 0 ;removes leading zeros, 012 becomes 12
SendRaw, Hi! You were suprised with drugs on you, so it will be confiscated!
SendInput, /confiscate %ID% drugs{Enter}
Return
-
- Posts: 141
- Joined: 19 Jul 2017, 09:59
Re: Help with AHK and variables.
I suggest logging all of your key presses and checking if string "/drugs" is detected. If so, check the next symbols you type until you press Enter and it copies them to produce your required string
Who is online
Users browsing this forum: todd and 53 guests