GTA SA MP
GTA SA MP
I wonder if there is a way to make something that moves the charater for like 10-12 minutes inside the house (to make 10-12 played times) and then put the character in /sleep mode , and repeat those process after x period of time. can anyone help me out ?
Re: GTA SA MP
i though for something like that(after messing around with keys)
press W/A/S/D for 2 seconds
then wait 30 seconds
repeat all that for x times,
press `T`
write `/sleep`
wait x time then go back to begining.
press W/A/S/D for 2 seconds
then wait 30 seconds
repeat all that for x times,
press `T`
write `/sleep`
wait x time then go back to begining.
Re: GTA SA MP
Code: Select all
toggle = 0
F5:: ; replace f5 with the key you want to start it with
toggle := !toggle
while(toggle) {
Loop 10 {
Send {w DOWN} ; holds down w
Sleep 2000 ; keep it held down for 2 seconds
Send {w UP} ; lets go of w
Sleep 30000 ; waits 30 seconds
; copy paste and replace w for each
}
Send t
Sleep 100
Send y ; replace chat-opening keybind here
Sleep 100
Send {text}/sleep
Sleep 100
Send {Enter}
Sleep 120000 ; waits 120 seconds
}
}
return
Esc:: pause; press esc to pause the script
Re: GTA SA MP
Minor thing, but you'll need a space before the ; on the last line for it to be a comment.
Re: GTA SA MP
and after that `return` it restart the whole script ?
Re: GTA SA MP
and also, how can i make this to do all the things in one window, like in the game only, so i can freely do something else ?
Re: GTA SA MP
A comment does nothing. It is a comment to be read -- not an instruction for AHK to do anything.
No, the while loop is what causes it to repeat as long as the condition is true, which in this case is the variable "toggle" being true (1), not false (0). It won't reach the return until it exits the while loop. Then it will wait until the hotkey is pressed again to start it over.
You can see if ControlSend will work with this window instead of Send.
Re: GTA SA MP
Code: Select all
toggle = 0
F5:: ; replace f5 with the key you want to start it with
toggle := !toggle
while(toggle) {
Loop 10 {
Send {w DOWN} ; holds down w
Sleep 1500 ; keep it held down for 2 seconds
Send {w UP} ; lets go of w
Sleep 18000 ; waits 18 seconds
Send {a DOWN} ; holds down a
Sleep 1500 ; keep it held down for 2 seconds
Send {a UP} ; lets go of a
Sleep 18000 ; waits 18 seconds
Send {s DOWN} ; holds down s
Sleep 1500 ; keep it held down for 2 seconds
Send {s UP} ; lets go of s
Sleep 18000 ; waits 18 seconds
Send {d DOWN} ; holds down d
Sleep 1500 ; keep it held down for 2 seconds
Send {d UP} ; lets go of d
Sleep 18000 ; waits 18 seconds
}
Sleep 100
Send t ; replace chat-opening keybind here
Sleep 100
Send {text}/sleep
Sleep 100
Send {Enter}w
Sleep 3000000 ; waits 50 minutes
Sleep 100
Send t ; replace chat-opening keybind here
Sleep 100
Send {text}/sleep
Sleep 100
Send {Enter}w
Sleep 1000
}
return
Esc:: pause ; press esc to pause the script
How can i change that ControlSend ?
Re: GTA SA MP
Yes, you would need to have matching opening and closing braces. But don't just randomly remove one. Look at how the pair creates a code block and make sure it makes logical sense for that to be part of the same loop or whatever that block is for.
First use the Window Spy tool that comes with AHK and see what it shows in the top section for your game's window. Then see the documentation for ControlSend and change your Send statements to ControlSend. It should look something like this:
Code: Select all
ControlSend,, Send {w DOWN}, ahk_exe samp.exe
Re: GTA SA MP
That should be where exactly ?
Also, i can't find that window spy tool
Code: Select all
ControlSend,, Send {w DOWN}, ahk_exe samp.exe
Also, i can't find that window spy tool
Re: GTA SA MP
Code: Select all
toggle = 0
F5:: ; replace f5 with the key you want to start it with
toggle := !toggle
while(toggle) {
Loop 10 {
ControlSend,, Send {w DOWN}, ahk_exe samp.exe
Sleep 1500 ; keep it held down for 2 seconds
Send {w UP} ; lets go of w
Sleep 18000 ; waits 18 seconds
Send {a DOWN} ; holds down a
Sleep 1500 ; keep it held down for 2 seconds
Send {a UP} ; lets go of a
Sleep 18000 ; waits 18 seconds
Send {s DOWN} ; holds down s
Sleep 1500 ; keep it held down for 2 seconds
Send {s UP} ; lets go of s
Sleep 18000 ; waits 18 seconds
Send {d DOWN} ; holds down d
Sleep 1500 ; keep it held down for 2 seconds
Send {d UP} ; lets go of d
Sleep 18000 ; waits 18 seconds
}
Sleep 100
Send t ; replace chat-opening keybind here
Sleep 100
Send {text}/sleep
Sleep 100
Send {Enter}w
Sleep 3000000 ; waits 50 minutes
Sleep 100
Send t ; replace chat-opening keybind here
Sleep 100
Send {text}/sleep
Sleep 100
Send {Enter}w
Sleep 1000
}
return
Esc:: pause ; press esc to pause the script
Re: GTA SA MP
In place of each Send command. By the way, I made a copy/paste error. It should have been this:3cvb5cvb wrote: ↑ Thatshould be where exactly ?Code: Select all
ControlSend,, Send {w DOWN}, ahk_exe samp.exe
Code: Select all
ControlSend,, {w DOWN}, ahk_exe samp.exe
In your AutoHotkey installation folder, which could be C:\Program Files\AutoHotkey.
Re: GTA SA MP
GTA:SA:MP
ahk_class Grand theft auto San Andreas
ahk_exe gta_sa.exe
ahk_pid 1412
this is what it says and i think `ahk_exe gta_sa.exe` this one is the right
ahk_class Grand theft auto San Andreas
ahk_exe gta_sa.exe
ahk_pid 1412
this is what it says and i think `ahk_exe gta_sa.exe` this one is the right
Re: GTA SA MP
Yes, but note that I accidentally included the word Send that shouldn't have been there. And you would put a ControlSend in each place you have a Send. And you need to replace samp.exe with whatever your WindowSpy tool shows after ahk_exe for your game window.
Also, not all windows respond to ControlSend, so this may or may not work, subject to testing.
Re: GTA SA MP
Final code i think
Also i had Removed the `w` there , i think it was a mistake..
Code: Select all
toggle = 0
F5:: ; replace f5 with the key you want to start it with
toggle := !toggle
while(toggle) {
Loop 10 {
ControlSend,, {w DOWN},ahk_exe gta_sa.exe ; holds down w
Sleep 1500 ; keep it held down for 2 seconds
ControlSend,, {w UP},ahk_exe gta_sa.exe ; lets go of w
Sleep 18000 ; waits 18 seconds
ControlSend,, {a DOWN},ahk_exe gta_sa.exe ; holds down a
Sleep 1500 ; keep it held down for 2 seconds
ControlSend,, {a UP},ahk_exe gta_sa.exe ; lets go of a
Sleep 18000 ; waits 18 seconds
ControlSend,, {s DOWN},ahk_exe gta_sa.exe ; holds down s
Sleep 1500 ; keep it held down for 2 seconds
ControlSend,, {s UP},ahk_exe gta_sa.exe ; lets go of s
Sleep 18000 ; waits 18 seconds
ControlSend,, {d DOWN},ahk_exe gta_sa.exe ; holds down d
Sleep 1500 ; keep it held down for 2 seconds
ControlSend,, {d UP},ahk_exe gta_sa.exe ; lets go of d
Sleep 18000 ; waits 18 seconds
}
Sleep 100
ControlSend,, t,ahk_exe gta_sa.exe ; replace chat-opening keybind here
Sleep 100
ControlSend,, {text}/sleep,ahk_exe gta_sa.exe
Sleep 100
ControlSend,, {Enter},ahk_exe gta_sa.exe
Sleep 3000000 ; waits 50 minutes
Sleep 100
ControlSend,, t,ahk_exe gta_sa.exe ; replace chat-opening keybind here
Sleep 100
ControlSend,, {text}/sleep,ahk_exe gta_sa.exe
Sleep 100
ControlSend,, {Enter},ahk_exe gta_sa.exe
Sleep 1000
}
return
Esc:: pause ; press esc to pause the script
Code: Select all
ControlSend,, {Enter}w,ahk_exe gta_sa.exe
Sleep 1000
}
Re: GTA SA MP
Does it do what you expect? You might also need to put the following line at the top of your script:
Code: Select all
#MaxThreadsPerHotkey 2
Re: GTA SA MP
no , can't free up the PC like do something else.
Re: GTA SA MP
Code: Select all
#MaxThreadsPerHotkey 2