Press key at exactly 20:00
-
- Posts: 3
- Joined: 18 Sep 2020, 16:25
Press key at exactly 20:00
Hey guys I think this might be a simple one for you guys. I just need the script to press "space" at 20:00. That's it. Can anyone help?
- ositoMalvado
- Posts: 182
- Joined: 24 Dec 2019, 12:02
- Contact:
Re: Press key at exactly 20:00
Try this
Code: Select all
Loop{
Loop{
if(A_Hour==20 and A_Min==00){
SendInput, {space}
break
}
}
sleep 70000
}
My WEB some useful stuff
Re: Press key at exactly 20:00
use task scheduler to run a script that sends space at 20:00
the script can be
Send, {space}
the script can be
Send, {space}
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Press key at exactly 20:00
Check once every 35 sec to see if the hour is the indicated, and if it is sends the Enter key, if it's not wait another 35 sec, also has a low CPU use (0%) and low Ram use (Less than 3Mb)
Code: Select all
Loop
{
If (A_Hour == 20) && (A_Min == 00)
{
Send, {Space}
Return ;If you want to keep the script running after sending enter remove this Return.
}
Else
{
Sleep, 35000 ;35 Sec
}
}
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
-
- Posts: 3
- Joined: 18 Sep 2020, 16:25
Re: Press key at exactly 20:00
Hey guys thanks for the quick replies. They don't seem to work though.
Re: Press key at exactly 20:00
I think a timer would be more efficient and if you put it every 1 min it can't miss the time.
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
-
- Posts: 3
- Joined: 18 Sep 2020, 16:25
Re: Press key at exactly 20:00
Yes I did and still nothing.
Re: Press key at exactly 20:00
once or every day at 20:00?
untested example but I use this function a lot:
if you want the subroutine to repeat every day at 20:00 put this at the end:
untested example but I use this function a lot:
Code: Select all
SetTimer, PressKeyAtExactly200000, % -Until("200000") ;run once at the next 20:00
Code: Select all
Until(Time="000000",Units="ms") { ;2016 gwarble
FormatTime, _, %A_Now%, yyyyMMdd ;returns ms until time
_ .= Time
EnvSub, _, %A_Now%, s
If (_ < 1)
_ += 24 * 60 * 60 ; add a day (in milliseconds)
Return _*1000
}
Code: Select all
PressKeyAtExactly200000:
Send blah blah
SetTimer, %A_ThisLabel%, % -Until("200000")
Return
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Who is online
Users browsing this forum: Google [Bot], haomingchen1998, mikeyww and 244 guests