Send Enter doesn't work. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Send Enter doesn't work.

19 Oct 2018, 22:13

Hey there, this is my first post on the site! :D
So, uh, I am brand new to the program and all I need from it right now is to move my mouse somewhere, click, and then press enter. I wanted to start with Enter just because I figured it would be easier, but it just won't work. Here is my code:
^q::
send, {Enter}
return
Nothing happens when I run that, and I can't find an answer anywhere. It's suuuper annoying. Oh yeah, if you happen to how to do the move mouse clicky thing that would also be helpful. Thank you!
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Send Enter doesn't work.

20 Oct 2018, 06:20

Not sure if it's a syntax problem, but this should definitely work:

Code: Select all

^q:: ; Ctrl+Q
Send {Enter}
return
Try it in Notepad first.
What is your target application anyway?
And is this really the whole script?

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

23 Oct 2018, 19:24

Scr1pter wrote:
20 Oct 2018, 06:20
Not sure if it's a syntax problem, but this should definitely work:

Code: Select all

^q:: ; Ctrl+Q
Send {Enter}
return
Try it in Notepad first.
What is your target application anyway?
And is this really the whole script?

Regards
My target application is Chrome, I've been running it in Notepad to test, and that did not work.
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

23 Oct 2018, 19:26

Scr1pter wrote:
20 Oct 2018, 06:20
Not sure if it's a syntax problem, but this should definitely work:

Code: Select all

^q:: ; Ctrl+Q
Send {Enter}
return
Try it in Notepad first.
What is your target application anyway?
And is this really the whole script?

Regards
I managed to get it working, now I just need it to move my mouse!
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Send Enter doesn't work.

24 Oct 2018, 05:54

What was the reason :?:

For moving mouse you have to work with:
MouseMove, 100, 300, 0

Replace 100 and 300 with your target pixels.
The 0 means speed (0 = highest speed).

After moving the mouse, you can make:
Send {lbutton}

If you want to save some code lines, you can replace MouseMove and Send {lbutton} by:
Click, 100, 300

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

24 Oct 2018, 17:23

Scr1pter wrote:
24 Oct 2018, 05:54
What was the reason :?:

For moving mouse you have to work with:
MouseMove, 100, 300, 0

Replace 100 and 300 with your target pixels.
The 0 means speed (0 = highest speed).

After moving the mouse, you can make:
Send {lbutton}

If you want to save some code lines, you can replace MouseMove and Send {lbutton} by:
Click, 100, 300

Regards
Thanks! How do I figure out what pixel number thingies I want it to go to though?
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

24 Oct 2018, 17:55

Scr1pter wrote:
24 Oct 2018, 05:54
What was the reason :?:

For moving mouse you have to work with:
MouseMove, 100, 300, 0

Replace 100 and 300 with your target pixels.
The 0 means speed (0 = highest speed).

After moving the mouse, you can make:
Send {lbutton}

If you want to save some code lines, you can replace MouseMove and Send {lbutton} by:
Click, 100, 300

Regards
Update: Holy heck, Microsoft Paint was just used as an actual tool! Someone call Guinness World Records! I used the little tool that shows what pixel you're mousing over in paint. So that was amazing. All I need to do now is learn how to make a little delay between stuff. So, for example, I could make the mouse move over, *then wait a specified amount of time*, then left click. I also need to learn how to make my script repeat itself over and over again until it's stopped by me or something. You're the best, dude. Thanks.
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

24 Oct 2018, 18:15

Scr1pter wrote:
24 Oct 2018, 05:54
What was the reason :?:

For moving mouse you have to work with:
MouseMove, 100, 300, 0

Replace 100 and 300 with your target pixels.
The 0 means speed (0 = highest speed).

After moving the mouse, you can make:
Send {lbutton}

If you want to save some code lines, you can replace MouseMove and Send {lbutton} by:
Click, 100, 300

Regards
Update II: I figured out the wait delay sleep thingie, now I just need to know how to loop it 'til I stop it or something.
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Send Enter doesn't work.

24 Oct 2018, 18:33

Paint???
Use MouseGetPos
https://autohotkey.com/docs/commands/MouseGetPos.htm

Check the 1st example script.

Regarding the loop:
I will check it tomorrow - too late now.

Good night
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

24 Oct 2018, 18:50

Scr1pter wrote:
24 Oct 2018, 18:33
Paint???
Use MouseGetPos
https://autohotkey.com/docs/commands/MouseGetPos.htm

Check the 1st example script.

Regarding the loop:
I will check it tomorrow - too late now.

Good night
Night night I guess. I'll let you know if I figure it out in the meantime. I might, this is so much fun to do.
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Send Enter doesn't work.  Topic is solved

25 Oct 2018, 07:01

Hi,
For a Loop you can use such a technique:

Code: Select all

q::
while GetKeyState("q")
{
  Send a
  Sleep, 5
  Send d
  Sleep, 5
}
return
In this case, a and b get spammed while holding q.
When releasing q, it stops.

Replace the block within the while loop with your code and test it.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Hampoon
Posts: 25
Joined: 19 Oct 2018, 22:04

Re: Send Enter doesn't work.

08 Nov 2018, 10:20

Scr1pter wrote:
25 Oct 2018, 07:01
Hi,
For a Loop you can use such a technique:

Code: Select all

q::
while GetKeyState("q")
{
  Send a
  Sleep, 5
  Send d
  Sleep, 5
}
return
In this case, a and b get spammed while holding q.
When releasing q, it stops.

Replace the block within the while loop with your code and test it.

Regards
I'm sorry for the late response, but, honestly man.... you're awesome. You helped me get started on some AHK stuff that I would have never figured out without you and stuff. I've had an amazing experience, I've programmed a few more cool things with the knowledge you've passed down to me, and I sincerely thank you. I'm sure I'll contact this forum many, many more times, and I want you to know that you're just really cool. I just kind of thought of the help you gave me and thought I owed you a thank you.
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot] and 240 guests