samp hotkey

Ask gaming related questions (AHK v1.1 and older)
kickrocks
Posts: 5
Joined: 07 Aug 2022, 04:44

samp hotkey

Post by kickrocks » 07 Aug 2022, 04:47

i found the code below but want to add another on a second timer. is that possible? i want /crate pickup on 6 seconds, then /crate putdown on 4. i copied and pasted the and changed it to /crate putdown but it didn't work

Code: Select all

1::				;Starts and Stops Loop.
Toggle:=!Toggle			;Toggle. (0 or 1)
	While Toggle		;Loop while toggle = 1.
	{
	Send t/crate pickup{enter}	;send message.
		Sleep, 6000	;Sleep 8 seconds.
	}
return

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: samp hotkey

Post by mikeyww » 07 Aug 2022, 06:40

Welcome to this AutoHotkey forum!

Code: Select all

1::SetTimer, 1 Up, % (t1 := !t1) ? 6000 : "Off"
1 Up::Send % t1 ? "t/crate pickup`n" : ""

2::SetTimer, 2 Up, % (t2 := !t2) ? 4000 : "Off"
2 Up::Send % t2 ? "t/crate putdown`n" : ""

kickrocks
Posts: 5
Joined: 07 Aug 2022, 04:44

Re: samp hotkey

Post by kickrocks » 26 Aug 2022, 01:19

mikeyww wrote:
07 Aug 2022, 06:40
Welcome to this AutoHotkey forum!

Code: Select all

1::SetTimer, 1 Up, % (t1 := !t1) ? 6000 : "Off"
1 Up::Send % t1 ? "t/crate pickup`n" : ""

2::SetTimer, 2 Up, % (t2 := !t2) ? 4000 : "Off"
2 Up::Send % t2 ? "t/crate putdown`n" : ""
life saver!

this might be a bit of a push, but is it possible to script scrolling down a dialog box and hitting enter automatically? i'm not sure how advanced this script stuff goes but looking at getting the whole script totally automatic lol.

kickrocks
Posts: 5
Joined: 07 Aug 2022, 04:44

Re: samp hotkey

Post by kickrocks » 26 Aug 2022, 02:33

kickrocks wrote:
26 Aug 2022, 01:19
mikeyww wrote:
07 Aug 2022, 06:40
Welcome to this AutoHotkey forum!

Code: Select all

1::SetTimer, 1 Up, % (t1 := !t1) ? 6000 : "Off"
1 Up::Send % t1 ? "t/crate pickup`n" : ""

2::SetTimer, 2 Up, % (t2 := !t2) ? 4000 : "Off"
2 Up::Send % t2 ? "t/crate putdown`n" : ""
life saver!

this might be a bit of a push, but is it possible to script scrolling down a dialog box and hitting enter automatically? i'm not sure how advanced this script stuff goes but looking at getting the whole script totally automatic lol.
couldnt figure out how to edit the comment

will the script work under a single button ie 1:: instead of press1:: and 2::?

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: samp hotkey

Post by mikeyww » 26 Aug 2022, 07:49

I'm not sure what you mean by these things. Screenshots or more detailed, step-by-step descriptions of what should happen would help.

Also see: https://www.autohotkey.com/docs/commands/Control.htm#ChooseString

kickrocks
Posts: 5
Joined: 07 Aug 2022, 04:44

Re: samp hotkey

Post by kickrocks » 27 Aug 2022, 01:26

mikeyww wrote:
26 Aug 2022, 07:49
I'm not sure what you mean by these things. Screenshots or more detailed, step-by-step descriptions of what should happen would help.

Also see: https://www.autohotkey.com/docs/commands/Control.htm#ChooseString
attached is a video of the procedure; https://streamable.com/b758il

basically, im looking at trying to get the dialog part automatic. i want to /crate pickup every 4 seconds and select the paint option. once i pick up the paint, i want to /crate putdown every 6 seconds and rinse repeat. after i deliver, i need to pick up the 52 crates and /crate putdown in the moving box.

how much of this can possibly be automatic? idek if you'd go thru all the effort but yeah this is a huge ask.

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: samp hotkey

Post by mikeyww » 27 Aug 2022, 07:09

I would start by creating a list of all of the key sequences that you want to send. You can add any details about the dialog window & timing. Forget about the timer. See :arrow: Send and the link that I posted earlier. After a single iteration is working properly, you can add a loop or timer to generate the repetitions.

kickrocks
Posts: 5
Joined: 07 Aug 2022, 04:44

Re: samp hotkey

Post by kickrocks » 29 Aug 2022, 01:50

i'll make do with what's provided. idk what i'm doing hence why i came here in the hopes of someone could do it for me since it's probably a hobby of theirs but yeah, all good i'll make do with the first you made.

thank you! :)

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: samp hotkey

Post by mikeyww » 29 Aug 2022, 08:15

The expansion is below, in case you want to add or modify.

Code: Select all

1::                        ; 1 is pressed
t1 := !t1                  ; Toggle the variable
If t1
     SetTimer, 1 Up, 6000
Else SetTimer, 1 Up, Off
Return

1 Up::                     ; 1 is released
If t1
     Send t/crate pickup`n
Else SoundBeep, 1500
Return

Post Reply

Return to “Gaming Help (v1)”