用户脚本间隔

时间:2015-07-12 11:11:09

标签: javascript userscripts

{{search}}

看到这个脚本有效,但是太快了。这个间隔功能不起作用

1 个答案:

答案 0 :(得分:1)

我想你想要像

这样的东西
var x = document.getElementsByClassName("farm_icon_c"),
(function f(i) {
  if(i < x.length) {
    x[i].click();
    setTimeout(function() { f(i+1); }, 1e3); // Run next "iteration" in 1 second
  } else {
    // This code will run at "the end of the loop"
  }
})(0); // Run first "iteration" immediately
相关问题