GTA SA (SA:MP) ANTI-AFK SCRIPT Topic is solved

Ask gaming related questions (AHK v1.1 and older)
blickyy
Posts: 5
Joined: 17 Dec 2018, 17:15

GTA SA (SA:MP) ANTI-AFK SCRIPT  Topic is solved

17 Dec 2018, 17:21

I need some1 who can help me to make SA:MP anti-afk script, SA:MP is basically 14 years old game (San Andreas Multiplayer), it's a part of GTA:SA from 2004, for the ones who doesn't know about the game.

I need to make next.

1.start script on insert
2.script needs to write "/id" every 9 minutes, after it writes, it needs to press esc so i tab out of game, after 9 minutes it tabs in and writes /id, repeat.
Last edited by blickyy on 30 Jul 2020, 04:00, edited 1 time in total.
blickyy
Posts: 5
Joined: 17 Dec 2018, 17:15

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

17 Dec 2018, 18:08

script wrote:Numpad1::
Toggle := !Toggle
While Toggle{
Sendinput t/id{enter}
sleep 30000
}

Numpad5:: pause

return
What I want to make from this is to put ESC before /id and ESC after /id
blickyy
Posts: 5
Joined: 17 Dec 2018, 17:15

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

18 Dec 2018, 14:09

refresh
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

28 Jul 2020, 10:36

refresh
User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

28 Jul 2020, 15:37

Start the script with the game unpaused to test.

Code: Select all

#MaxThreadsPerHotkey, 2
Toggle := 0

Insert::
Toggle := !Toggle
Send, {Esc}
While (Toggle = 1)
{
    Send, {Esc}t /id{Enter}{Esc}{AltTab}
    Sleep, 540000 ;9 Min
}
Return
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 04:11

Alright I will try it
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 04:14

Yakshongas wrote:
28 Jul 2020, 15:37
Start the script with the game unpaused to test.

Code: Select all

#MaxThreadsPerHotkey, 2
Toggle := 0

Insert::
Toggle := !Toggle
Send, {Esc}
While (Toggle = 1)
{
    Send, {Esc}t /id{Enter}{Esc}{AltTab}
    Sleep, 540000 ;9 Min
}
Return
It's not working, Esc is not working, it inputs the text like /id, but Esc is not sending, because I think SetKeyDelay needs to be used
User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 06:39

Then add under #MaxThreadsPerHotkey, 2, SetKeyDelay, 50, 50
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 08:49

Yakshongas wrote:
29 Jul 2020, 06:39
Then add under #MaxThreadsPerHotkey, 2, SetKeyDelay, 50, 50
It works now, but it doesn't alt tabs, if possible to somehow after typing /id it presses Esc and then does CTRL+D to switch to the desktop? And after it repeats the process by switching window to gta_sa.exe with WinActivate at the top?

Code: Select all

#MaxThreadsPerHotkey, 2
SetKeyDelay, 50, 50
Toggle := 0

Insert::
Toggle := !Toggle
While (Toggle = 1)
{
    Send, {Esc}t/id{Enter}
    Send, {Esc}{AltTab}
    Sleep, 15000
}
User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 13:56

Like this?

Code: Select all

#MaxThreadsPerHotkey, 2
SetKeyDelay, 50, 50
Toggle := 0

Insert::
Toggle := !Toggle
While (Toggle = 1)
{
    WinActivate, Ahk_exe gta_sa.exe
    Sleep, 2000 ;Adjust if needed
    Send, {Esc}t/id{Enter}
    Send, {Esc}{LAlt Down}{Tab}{LAlt Up}
    Sleep, 15000
}
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 14:18

Yes, exactly, that actually is now working, thank you so much!
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

29 Jul 2020, 14:29

@Yakshongas but can it be CTRL+D instead of ALT+TAB?
User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

01 Aug 2020, 07:48

Of course! like this:

Code: Select all

{LControl Down}d{LControl Up}
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

03 Aug 2020, 18:49

Yakshongas wrote:
01 Aug 2020, 07:48
Of course! like this:

Code: Select all

{LControl Down}d{LControl Up}
Sorry, I meant left windows key + D, not CTRL + D
User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

04 Aug 2020, 04:19

Then change LControl to LWin
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

04 Aug 2020, 05:08

Yakshongas wrote:
04 Aug 2020, 04:19
Then change LControl to LWin
Thank you so much man, you don't know how much I appreciate it!
blickyy
Posts: 5
Joined: 17 Dec 2018, 17:15

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

04 Aug 2020, 08:01

Solved, moderators can archive or delete this.
gregster
Posts: 9022
Joined: 30 Sep 2013, 06:48

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

04 Aug 2020, 08:13

blickyy wrote:
04 Aug 2020, 08:01
Solved, moderators can archive or delete this.
Thank you, but no. We don't delete solved topics (and there is no archive for them anyway). That would be contrary to the purpose of a support forum.
Apart from that, there are different users involved in this topic - it wouldn't be right to delete their posts without reason.

If you don't want to get notifications for this topic, just unsubscribe to it (see link at the top).
VildanM
Posts: 11
Joined: 28 Jul 2020, 08:11

Re: GTA SA (SA:MP) ANTI-AFK SCRIPT

04 Aug 2020, 12:55

I don't mind if the topic gets deleted or archived, but it's also okay from my aspect of view for the topic to stay without being deleted or archived.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 68 guests