Jump to content
UBot Underground

problem with looping list


Recommended Posts

change-urls contains this text:

http://www.ticketfly.com/purchase/event/59869/tfly

basically i'm trying to make a loop that waits for this page to change using "off sale" as the string keyword

http://www.ticketfly.com/purchase/event/59869/tfly

however i get a object reference not set to object error, and i think i'm doing the loop completely right setting the list position to 0 when the list position EQUALS the list total i.e. index would then be out of bounds so i reset the list position to 0.....not sure how to fix it, what does it look like i'm doing wrong? thanks in advance =)!

 

add list to list(%changeurls, $list from file("C:\\change-urls.txt"), "Delete", "Global")

navigate($list item(%changeurls, 0), "Wait")

wait for browser event("Everything Loaded", "")

loop while($search page("Off Sale")) {

if($comparison($list position(%changeurls), "=", $list total(%changeurls))) {

then {

set list position(%changeurls, 0)

}

else {

}

}

wait(10)

navigate($next list item(%changeurls), "Wait")

wait for browser event("Everything Loaded", "")

}

  • Like 1
Link to post
Share on other sites

try this

 

clear list(%changeurls)
add list to list(%changeurls, $list from file("C:\\change-urls.txt"), "Delete", "Global")
navigate($list item(%changeurls, 0), "Wait")
wait for browser event("Everything Loaded", "")
wait(10)
set(#temp, 1, "Global")
loop while($search page("Off Sale")) {
   if($comparison(#temp, "=", $list total(%changeurls))) {
       then {
           set list position(%changeurls, 0)
           set(#temp, 0, "Global")
       }
       else {
           navigate($list item(%changeurls, #temp), "Wait")
           wait for browser event("Everything Loaded", "")
           wait(10)
       }
   }
   increment(#temp)
}

 

 

Not sure exactly what your trying to accomplish here. But assume this is what your looking for.

 

If not let me know more and will adjust it.

 

TJ

  • Like 1
Link to post
Share on other sites

ok here's the working code, i ditched doing it with the if-then statement and decided to just do ubot's version of a for loop with the max number of urls -1, i.e. the index is always 1 less then the total...basically all this script would do is given a list of urls it would search a web page for two specified strings, in my case off sale and sold out and the loop would continue until those words were not found on the set of pages in the list %changeurls

 

clear list(%changeurls)

add list to list(%changeurls, $list from file("C:\\change-urls.txt"), "Delete", "Global")

navigate($list item(%changeurls, 0), "Wait")

wait for browser event("Everything Loaded", "")

wait(10)

set(#maxurls, $list total(%changeurls), "Global")

loop while($either($search page("Off Sale"), $search page("Sold Out"))) {

set list position(%changeurls, 0)

loop($subtract(#maxurls,1)) {

navigate($next list item(%changeurls), "Wait")

}

}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...