Jump to content
UBot Underground

$Url Thinking It Is A True/false Variable


Recommended Posts

Hi,

 

I am trying to scrape a URL with $URL and set it to a particular variable, sometimes this works, however sometimes it just returns "True" when I want it to return the actual URL. any idea why this is happening?

 

Thanks, any help is greatly appreciated,

Sac

Link to post
Share on other sites

The Variable is unique, and I have tried to clear the variables using the set command and just leaving what I set it to blank, it still seems to do it. I have also changed the variable to a list and then cleared the list after each loop and it seems to set the list to "True." at this point i think its something in my code that is screwing up because it not only sets the URL variable to "true" it sets another one as well. and when it does this it seems to screw up multiple things that have nothing to do with these variables. for instance after it happens it can no longer log in because it will no longer input information in the password portion of the login area while running or stepping, however if i run that portion of the code manually even after this it works fine.

 

is there another way to clear specific variables without using "clear all data" because there are some variables that I do not want to clear.

 

Thanks

Link to post
Share on other sites

sure I was able to do a bit more digging, and the issue starts here 

 

        set(#Random Number,$rand(3,32),"Global")
        wait(1)
        set(#Random Board,$eval($multiply(2,#Random Number)),"Global")

 

for some reason instead of multiplying "random Number" by 2 to get "random board" it turns random board into "True" then later on it tries to scrape a URL ( which doesn't really have anything to do with that part of the code) and it also returns "True" then the only way to get it to run again is by restarting Ubot in its entirety then it will work until it does it again.

 

Here is the second part that returns true

 

        add item to list(%UsernameURL,$url,"Don\'t Delete","Global")
        wait(1)
        set(#username1,$replace($list item(%UsernameURL,0),"https://www.pinterest.com/",""),"Global")
        wait(1)
        set(#username,$replace(#username1,"/",""),"Global")

 

Thanks

 

 

Edit: it seems to happen the second time the script goes through the loop, the first time it works fine. then the second time it tries to set the random board it sets it as "true" instead.

Edited by sacofpotatoes
Link to post
Share on other sites

i dont see aproblem with the second half

======================================

 

set(#Random Number,$rand(3,32),"Global")
wait(1)
comment("loose the eval statement")
set(#Random Board,$multiply(2,#Random Number),"Global")
alert(#Random Board)
divider
loop(1) {
    comment("i needed a page to goto")
    navigate("https://www.pinterest.com/explore/pinterest-fails/","Wait")
    wait for browser event("Everything Loaded","")
}
clear list(%UsernameURL)
add item to list(%UsernameURL,$url,"Don\'t Delete","Global")
wait(1)
set(#username1,$nothing,"Global")
set(#username1,$replace($list item(%UsernameURL,0),"https://www.pinterest.com/",""),"Global")
wait(1)
set(#username,$nothing,"Global")
set(#username,$replace(#username1,"/",""),"Global")

Link to post
Share on other sites

Great thanks! removing the eval seemed to fix that part of the code, however its happening in a different part now, and after it happens once here, just like the last one it screws everything up and ubot needs to be restarted again before it will work. Here is the part where it is happening now.

 

         navigate(#Navigate,"Wait")
        wait(3)
        set(#Board Name,$scrape attribute(<class="boardName">,"innertext"),"Global")
        wait(3)
        click($element offset(<class="thumbImageWrapper">,1),"Left Click","No")
        wait(8)

 

Specificly it happens at the set #Board name.

 

Do you see anything wrong there?

 

Thanks for all you help!

Link to post
Share on other sites

i cant diagnose this because of incomplete data.

1. dont know what the the variable #Navigate contains or is supposed to contain

2.you are scraping data into the variable #Boardname ( i need to see the page and the code to see what is going on)

3. the click command same as line 2

 4. your wait times seem excessive ( if the program is moving to fast and you think these are not loaded by the time you get to them i suggest build in some test to ensure that the item has loaded before you move on

---------------------------------

ie.

set counter =0 //this counter comes into play at the bottom of the script

set #is the item there =no 

 

loop while #is the item there =no

                item exist (true/false)

                if item exist =true

then

set #is the item there =yes

 else

                wait 1

                increment counter

if

               counter =10

then

               alert " looped  thru 10 times cant find it"

stop script

 

(this keeps looping until it finds the item or stops at 10 to prevent a runaway loop)

else

-----------------------------------

all this does is slows the program down until the item is loaded

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...