cjacobs 2 Posted October 3, 2017 Report Share Posted October 3, 2017 I'm having a problem I can't figure out with exceeding the range of $next list item error, which is in a loop. Navigate>$next list item >%URLs.I didn't have this error last night and confused as to what changed. The code is:clear list(%URLs)ui open file("Drupal Target URLs",#URLs)add list to list(%URLs,$list from file(#URLs),"Delete","Global")set list position(%URLs,0)loop($list total(%URLs)) { change proxy($next list item(%proxies)) set proxy credentials("proxy123","123password") navigate($next list item(%URLs),"Wait") wait for browser event("Page Loaded",10) Any ideas as to what I'm missing? Thanks for any help! Quote Link to post Share on other sites
pash 504 Posted October 3, 2017 Report Share Posted October 3, 2017 try set list position(%proxies,0)and check %URLs count = %URLs count or not i thing error at change proxy($next list item(%proxies)) Quote Link to post Share on other sites
cjacobs 2 Posted October 3, 2017 Author Report Share Posted October 3, 2017 try set list position(%proxies,0)and check %URLs count = %URLs count or not i thing error at change proxy($next list item(%proxies))Hi Pash,I do have proxies list position at 0. Sorry, I guess I should've posted the full code.The image attached above shows error at $next list item(%URLs) right? Here's the code above the loop:clear list(%AccountData)clear list(%proxies)ui open file("Proxies",#proxies)add list to list(%proxies,$list from file(#proxies),"Delete","Global")set list position(%proxies,0)clear list(%email)ui text box("Email Address",#EmailAddress)add item to list(%email,#EmailAddress,"Don\'t Delete","Global")clear list(%Password)ui text box("Password (For Accounts)",#Password)add item to list(%Password,#Password,"Don\'t Delete","Global")clear list(%URLs)ui open file("Drupal Target URLs",#URLs)add list to list(%URLs,$list from file(#URLs),"Delete","Global")set list position(%URLs,0)loop($list total(%URLs)) { change proxy($next list item(%proxies)) set proxy credentials("proxy123","123password") navigate($next list item(%URLs),"Wait") wait for browser event("Page Loaded",10) Quote Link to post Share on other sites
pash 504 Posted October 3, 2017 Report Share Posted October 3, 2017 try clear list(%AccountData) clear list(%proxies) clear list(%Password) clear list(%URLs) clear list(%email) ui open file("Proxies",#proxies) add list to list(%proxies,$list from file(#proxies),"Delete","Global") ui text box("Email Address",#EmailAddress) ui text box("Password (For Accounts)",#Password) ui open file("Drupal Target URLs",#URLs) add item to list(%email,#EmailAddress,"Don\'t Delete","Global") add item to list(%Password,#Password,"Don\'t Delete","Global") add list to list(%URLs,$list from file(#URLs),"Delete","Global") set list position(%proxies,0) set list position(%URLs,0) set list position(%proxies,0) if($comparison($list total(%proxies),"< Less than",$list total(%URLs))) { then { alert("Error proxy < url Proxy: {$list total(%proxies)} Url : {$list total(%URLs)}") stop script } else { } } loop($list total(%URLs)) { change proxy($next list item(%proxies)) set proxy credentials("proxy123","123password") navigate($next list item(%URLs),"Wait") wait for browser event("Page Loaded",10) } Quote Link to post Share on other sites
cjacobs 2 Posted October 4, 2017 Author Report Share Posted October 4, 2017 That stopped the script totally. No action in the browser and no Alert.I'm confused.........Why do you think it's a proxy issue when the error clearly says %URLs next list issue? Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted October 5, 2017 Report Share Posted October 5, 2017 Here is an simple example for everyone clear list(%urls) clear list(%proxies) add list to list(%urls,$list from text("http://google.com http://ubotstudio.com http://ubotdocta.ocm http://yahoo.com http://bing.com http://facebook.com http://twitter.com url 8",$new line),"Delete","Global") add list to list(%proxies,$list from text("p1 p2 p3",$new line),"Delete","Global") loop($list total(%urls)) { set(#url NLI,$next list item(%urls),"Global") wait(1) if($comparison($list position(%proxies),">= Greater than or equal to",$list total(%proxies))) { then { set list position(%proxies,0) } } set(#proxy NLI,$next list item(%proxies),"Global") wait(1) } ui stat monitor("list pos urls: {$list position(%urls)} <br>current url: {#url NLI}","<br> <br>list pos proxies: {$list position(%proxies)} <br>current proxy: {#proxy NLI}") Regards,CDlooping uneven list.ubot 1 Quote Link to post Share on other sites
UBotBuddy 331 Posted November 3, 2017 Report Share Posted November 3, 2017 Hey cjacobs, Please look at my screen shot. https://www.screencast.com/t/Be3g372W When I looked at your code I saw a couple of things missing. #1 and #3 are paired perfectly and that is great! But when I looked at #2 I did not a version of "set list position" like #4. if you add this command "set list position(%proxies,0)" before or after #4 then it should work.As long as the lists %proxies and %URLs have the same number of items inside of them.IF %URLs has more list items than %proxies then you were get the same error but it will statethe %proxies list in the error message. It is also good practice to test for such errors. I would add an IF command to compare the totalvalues of %URLs against %proxies. You definitely don't want less %proxies than %URLs. Otherwise, your code looks good. Short and concise. I hope I have answered your original question. Buddy 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.