如何在没有功能的情况下在尖锐的9.30am自动点击按钮,只需要编码 [英] How do I auto click button at sharp 9.30am without function, only needed coding

查看:64
本文介绍了如何在没有功能的情况下在尖锐的9.30am自动点击按钮,只需要编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< script>



var target = new Date();

target.setHours(9,30,0,0) );

函数计时器(){

var now = new Date();

if(target.getHours()== now.getHours()&& target.getMinutes()== now.getMinutes()){

alert( '9.30am任务');

//你点击按钮的代码

}

else {

setTimeout (计时器,1000)

}

}



计时器();

提醒('计时器已启动');



< / script>



什么我试过了:



先生,这段代码工作正常,自动点击上午9点30分,但



如何在没有计时器功能的情况下在上午9点30分自动点击按钮,仅需要编码

<script>

var target = new Date();
target.setHours(9, 30, 0, 0);
function timer() {
var now = new Date();
if (target.getHours() == now.getHours() && target.getMinutes() == now.getMinutes()) {
alert('9.30am task');
// your code for button click
}
else {
setTimeout(timer, 1000)
}
}

timer();
alert('timer started');

</script>

What I have tried:

sir, this code is working properly auto click at sharp 9.30am, but

how i do auto click button sharp at 9.30am without "timer" function , only needed coding

推荐答案

重新发布如何自动点击http://www.mysite .co.in在javasc上午9点30分ript [ ^ ]。


想想你在问什么。



你希望应用程序在某个时间做某事。

它需要知道这样做的时间。

你说你不想检查它时间。

那么如何知道没有检查的时间?



如果这也是吃饭的话CPU资源多,检查频率较低。你有多准确?而不是检查每一秒,为什么不检查每一分钟?如果它需要正确点,检查时间并启动计时器功能点,然后回到每分钟。



但是如果不以某种方式查看时钟,你不能做一些事情。

Think about what you are asking.

You want the application to do something at a certain time.
It needs to know the time to do this.
You saying you don't want it to check the time.
So how can it know the time without checking?

If this is eating up too much CPU resource, check less often. How accurate do you have to be? Instead of checking every second, why not check every minute? If it needs to be "right on the dot", check the time and start the timer function "on the dot" and then fall back to every minute.

But you cannot do something by the clock without looking at the clock in some way.


这篇关于如何在没有功能的情况下在尖锐的9.30am自动点击按钮,只需要编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆