我一直在做一个"自动下注脚本"到一个网站,脚本已经完成,但我有一些问题" Statics"我想在那里添加。所以我每轮都得到一个X值,让我说我得到数字5.2它应该保存下一轮所以我可以将5.2添加到下一轮数,所以让我们说第2轮数是7.2所以它应该记住以前的5.2舍入并添加7.2,然后3轮它应该将X号加到12.4(来自5.2 + 7.2)
这是我的代码
skinPrice = $('#case_item_win .case_item_price').text();
$ brew unlink chromedriver
Unlinking /usr/local/Cellar/chromedriver/2.20... 1 symlinks removed
$ brew install chromedriver
==> Using the sandbox
==> Downloading https://chromedriver.storage.googleapis.com/2.25/chromedriver_mac6
######################################################################## 100.0%
==> Caveats
To have launchd start chromedriver now and restart at login:
brew services start chromedriver
Or, if you don't want/need a background service you can just run:
chromedriver
==> Summary
/usr/local/Cellar/chromedriver/2.25: 4 files, 10.3M, built in 7 seconds
是当前的圆值/数字。
答案 0 :(得分:0)
我在解析你想要做的事情时遇到了一些麻烦。但是,您可以使用闭包来在使用setTimeout的函数调用之间维护某些状态。
$('#case_test').click( function(){
// you can put a variable here that will be available to the function in setTimeout across each invokation
var total = 0;
setTimeout(function(){
// every time you add or access total here, it will be kept across invokations
total += 100;
$('#case_item_win .case_item_name br').remove();