DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Trying to learn AHK - stuck with Click command. Any help?  (Read 6,693 times)

wreckedcarzz

  • Still lurking. Still an anthro.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,629
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • Linux User
OK for everyone who knows how to do this or has any ideas...
I am coding an automatic computer maintenance program (see here: http://www.donationcoder.com/forum/index.php?topic=8345.new#new) and I have 2 problematic programs that REQUIRE the user to click - no Tab or Alt keyboard commands work. So, I went ahead and (I am still using the Quick Start Tutorial, I don't feel comfortable on my own quite yet) looked up how to do it. OK, easy enough. I added it into the script, tried it out, and it clicked off on Windows Sidebar instead of on the button I gave the coordinates to. So I went back and used the coordinates in relevance to the active window (I am assuming its from pixel 1x1 of the window) and that did something similar. So I have currently got it set to move the mouse to 0, 0 and THEN click the coordinates (relevant to the whole screen). It STILL does not work...I am going to give it another go with the active window coordinates, but please someone tell me if I am doing something right/something wrong/another way to click.
Thanks,
-Brandon

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • Coding Snacks
Re: Trying to learn AHK - stuck with Click command. Any help?
« Reply #1 on: June 15, 2007, 06:29 AM »
Just a wild guess, but I think you didn't use CoordMode

Quote
If this command is not used, all commands except those documented otherwise (e.g. WinMove and InputBox) use coordinates that are relative to the active window.

Screen: Coordinates are relative to the desktop (entire screen).
Relative: Coordinates are relative to the active window.

Code
CoordMode,Mouse,Screen
Click,300,350

« Last Edit: June 15, 2007, 06:34 AM by wr975 »

wreckedcarzz

  • Still lurking. Still an anthro.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,629
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Trying to learn AHK - stuck with Click command. Any help?
« Reply #2 on: June 15, 2007, 06:50 AM »
No, I looked at it but it was kind of confusing - too many commands for me. So I would have to put in...
CoordMode, Mouse, Screen
Click x, y

instead of my current setup, simply being...
Click 808, 771

OK, I will give that a go.

wreckedcarzz

  • Still lurking. Still an anthro.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,629
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Trying to learn AHK - stuck with Click command. Any help?
« Reply #3 on: June 15, 2007, 07:07 AM »
Holy cow it worked! It worked! I spent like 2 hours on this ;D- thanks so much! :-* :)
-Brandon

Original address: https://www.donationcoder.com/forum/index.php?topic=8881.0