I need 2 scripts please: autoclickers
-
- Posts: 15
- Joined: 23 May 2022, 15:54
I need 2 scripts please: autoclickers
Hello to everyone i'm in real need of two autohotkeys and I can't do them by myself!
- 1st one I need is pressing "mouse left click" and then 1 second delay and press "SPACE" then 2 second delay and "repeat"
- 2nd one is pressing "E" every 5 seconds
this both autoclickers i need them in a specific window which is fiveM so I can use my pc
Thanks in advance!
- 1st one I need is pressing "mouse left click" and then 1 second delay and press "SPACE" then 2 second delay and "repeat"
- 2nd one is pressing "E" every 5 seconds
this both autoclickers i need them in a specific window which is fiveM so I can use my pc
Thanks in advance!
Re: I need 2 scripts please: autoclickers
Code: Select all
F2::SetTimer, F2 Up, % (f2 := !f2) ? 5000 : "Off"
F2 Up::Send % f2 ? "e" : ""
F3::SetTimer, F3 Up, % (f3 := !f3) ? 3000 : "Off"
F3 Up::
Click
Sleep, 990
Send {Space}
Sleep, 1990
Return
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
thank you it works pretty well but to be perfect I need it to work while game is running in background, window spy shows this: https://prnt.sc/s0cwfe4_L6Vq
Re: I need 2 scripts please: autoclickers
You can always try ControlSend and ControlClick. They sometimes work. viewtopic.php?f=7&t=11084 • Good luck. Example
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
my head is burning ahah I can't get it to work
Re: I need 2 scripts please: autoclickers
If you test it in Notepad first, you will know if your commands are OK. ControlSend works in Notepad.
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
have it like this but nothing works https://prnt.sc/Bwq_6vDVh37O
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
this is my first time using stuff like this sorry
Re: I need 2 scripts please: autoclickers
Test in Notepad first. Try the example from the documentation, to see if that works first. After it does, you can see if your own text works in Notepad. After it does, you can see if your own text works in your target program. The iterative approach may seem slower than what you tried, but it's actually faster because you are testing one step at a time. When you reach a failure point, you know where to troubleshoot instead of being puzzled about where to look.
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
ok i've tried the example 1 and nothing happened
Re: I need 2 scripts please: autoclickers
Now we are getting somewhere, because you indicated that the following script, by itself, does nothing when you run it.
Considering this, I am not sure why this would be true. Are you sure that you ran the script? Did Notepad run, and open a Notepad window? Was the window minimized? It's really hard to believe that nothing happened, so some details would be useful here. What version of AHK are you using?
Code: Select all
Run, Notepad,, Min, PID ; Run Notepad minimized.
WinWait, ahk_pid %PID% ; Wait for it to appear.
ControlSend, Edit1, This is a line of text in the notepad window.{Enter}
ControlSendRaw, Edit1, Notice that {Enter} is not sent as an Enter keystroke with ControlSendRaw.
MsgBox, Press OK to activate the window to see the result.
WinActivate, ahk_pid %PID% ; Show the result.
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
ok so 1st i simply copy pasted this into notepad++:
Run, Notepad,, Min, PID ; Run Notepad minimized.
WinWait, ahk_pid %PID% ; Wait for it to appear.
ControlSend, Edit1, This is a line of text in the notepad window.{Enter}
ControlSendRaw, Edit1, Notice that {Enter} is not sent as an Enter keystroke with ControlSendRaw.
MsgBox, Press OK to activate the window to see the result.
WinActivate, ahk_pid %PID% ; Show the result.
then i executed it and nothing happened the game is in windowed mode but not minimized my ahk version is 1.1.33.10
Run, Notepad,, Min, PID ; Run Notepad minimized.
WinWait, ahk_pid %PID% ; Wait for it to appear.
ControlSend, Edit1, This is a line of text in the notepad window.{Enter}
ControlSendRaw, Edit1, Notice that {Enter} is not sent as an Enter keystroke with ControlSendRaw.
MsgBox, Press OK to activate the window to see the result.
WinActivate, ahk_pid %PID% ; Show the result.
then i executed it and nothing happened the game is in windowed mode but not minimized my ahk version is 1.1.33.10
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
im really trying but my head is almost blowing off xD maybe I will forget this idea i just need the AHK to work while game is running on background wich I thought was the easy part but I see it is really hard I have learned many posts here in the forum but I'm portuguese and my english is very basic so this is very hard to me
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
so the script you sent me first works but everytime I put ControlSend the code stop working game even if the game is focused
Re: I need 2 scripts please: autoclickers
Some windows do not respond to ControlSend. I would try the tips for games that I posted. That's about all I know! Best of luck.
If you need more input, post the newer script that you are trying to get to work. Other readers may have additional suggestions for you when they see it.
If the script that I posted does not run Notepad, then you are doing something wrong, but I'm not sure what that is.
If you need more input, post the newer script that you are trying to get to work. Other readers may have additional suggestions for you when they see it.
If the script that I posted does not run Notepad, then you are doing something wrong, but I'm not sure what that is.
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
ok so controlsend works in notepad
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
what's next?
-
- Posts: 15
- Joined: 23 May 2022, 15:54
Re: I need 2 scripts please: autoclickers
got it to work but everytime the button specified on script is pressed game changes to 1st plan now I have it like this
Code: Select all
F7::SetTimer, F7 Up, % (f7 := !f7) ? 5000 : "Off"
F7 Up::
WinWait, ahk_pid 14804
WinActivate, ahk_exe FiveM_b2545_GTAProcess.exe
ControlSend, , {E Down}
Sleep 199
ControlSend, , {E Up}
Return