loops - How to get macros take again same line's from the file, when he came to the end of file -
how macros take again same line's txt file, when came end of file. have script takes google+ url pages file have 35 links, have 1 file website links need post on wall. each web-link need posted on each of 35 google+ pages. @ moment script visit's url's post first link file need, when came's end of file, macros stops work. sugestion's how can make it?
here script
var macros; var loop = 1; macros = "code:"; macros += "set !datasource google_pages.txt" + "\n"; macros += "set !datasource_line {{i}}" + "\n"; macros += "url goto={{!col1}}" + "\n"; macros += "tag pos=1 type=div attr=class:\"kqa es\"" + "\n"; macros += "set !datasource links.txt" + "\n"; macros += "set !datasource_line {{!loop}}" + "\n"; macros += 'events type=keypress selector="div[class=\\"df b-k b-k-xb urap8 editable\\"]" chars={{!col1}}' + "\n"; macros += "tag pos=1 type=div attr=class:\"d-k-l b-c b-c-ba qy jt\"" + "\n"; loop += prompt("how many times play macros?:", loop); for(i = 1; <= loop; i++) { iimset("i",i) iimdisplay("loop plays: "+i) iimplay(macros) }
as understood issue, should view following snippet:
var linesintxt = 35; var numtorepeat = 2; var loop = numtorepeat*linesintxt; (i = 1; <= loop; i++) { var j = (i % linesintxt == 0) ? linesintxt : % linesintxt; iimset("i", j); // further code here }
Comments
Post a Comment