topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 7, 2024, 8:50 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: I need a script that will left mouse click at a specific time of day.  (Read 2735 times)

yeto

  • Participant
  • Joined in 2017
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
I need a script that will left mouse click at a specific time of day. I found the following (see link)which is working but was wondering if there is now simpler code that will do the same? I will be at the computer and can position the mouse so I won't need x, y coordinates. Any help will be greatly appreciated.

site whre I copied script

#persistent

TargetTime = 1800

 

StringLeft, TargetDateTime, A_Now, 8   ; Put just YYYYMMDD into the variable.
TargetDateTime = %TargetDateTime%%TargetTime%
TimeUntilTarget = %TargetDateTime%
TimeUntilTarget -= %A_Now%, seconds
if TimeUntilTarget < 0
{
     MsgBox The target time is already past!
     return
}
TimeUntilTarget *= 1000 ; Convert to milliseconds.
TimeUntilTarget -= 1000
SetTimer, ClickTimer, %TimeUntilTarget%
return

ClickTimer:
SetTimer, ClickTimer, off  ; i.e. do only one click
MouseClick, left

Thank you in advance for any help,
yeto

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,832
    • View Profile
    • Donate to Member
just to confirm, you only need to define a time?

quick and dirty AHK code...

#persistent
MyHour = 07
myMin = 07

loop
{
  if A_hour = %myhour%
    loop
    {
if a_min = %myMin%
          click

sleep 750
    }
  sleep 750
}

yeto

  • Participant
  • Joined in 2017
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
just to confirm, you only need to define a time?

quick and dirty AHK code...

#persistent
MyHour = 07
myMin = 07

loop
{
  if A_hour = %myhour%
    loop
    {
if a_min = %myMin%
          click

sleep 750
    }
  sleep 750
}

Thank you for taking time to reply. This is very helpful.
yeto