我如何将提取的数字加在一起

How can i add numbers together that was extracted

我有一个 addmefast 的宏,我提取了获得的分数,我想把它们一起计算。

例如,第一次提取在下一次迭代中是“8”,提取将是“4”,所以我想将它们加在一起。

for(var i = 1; i <= total; i++) {
    iimPlay(path+"Facebook Like.iim")
    iimPlayCode('TAG POS=1 TYPE=DIV ATTR=CLASS:"success_like" EXTRACT=TXT\nSET !EXTRACT EVAL("\'{{!EXTRACT}}\'.match(/\d+/)[0]")\n');
    var gain = iimGetLastExtract();
    iimDisplay('Gained Points : ' + points );
}

这样试试:

var gainTotal = 0;
for(var i = 1; i <= total; i++) {
    iimPlay(path+"Facebook Like.iim")
    iimPlayCode('TAG POS=1 TYPE=DIV ATTR=CLASS:"success_like" EXTRACT=TXT\nSET !EXTRACT EVAL("\'{{!EXTRACT}}\'.match(/\d+/)[0]")\n');
    var gain = parseInt(iimGetLastExtract());
    gainTotal += gain;
    iimDisplay('Gained Points : ' + points );
}
alert(gainTotal);