Jump to content
UBot Underground

2 Conditions for the if-command ?


Recommended Posts

Hey :-)

 

I´m looking for a way to combine two if-conditions like

if("{$exists(<innertext="aaaaa">)}and{$exists(<innertext="bbbbb">)}") {
    then {
        click(<href="ccccc">, "Left Click", "No")
    }
    else {
        click(<title="ddddd">, "Left Click", "No")
    }
}

 
At the moment I use an if within a loop while.
 
loop while($exists(<src="./images/bc_weiter.gif">)) {
        if($exists(<src="./images/online.gif">)) {
            then {
                add list to list(%profile26urls, $scrape attribute(<href=w"/profil.php5?id=*">, "href"), "Delete", "Global")
                click(<innerhtml="<img src=\"./images/bc_weiter.gif\" alt=\"Weiter\" class=\"suchergebnis_next\">">, "Left Click", "No")
                wait for element(<class="left suchergebnis_numbers">, "", "Appear")
            }
            else {
            }
        }
    }
    loop($list total(%profile26urls)) {
        navigate("https://www.url.de/{$list item(%profile26urls, #list26position)}", "Wait")
        wait for element(<src="./images/bc_senden.gif">, 10, "Appear")
        click(<src="./images/bc_senden.gif">, "Left Click", "No")

and so on.... the 2. loop is a very big loop
I know, the 2. loop needs to be too in the else, but then I have it 2 times....  There is an other way ? 

 

Link to post
Share on other sites

You are so close in the first bit, just a bit of adjusting and this will work (it needed spaces basically)

if($exists(<innertext="aaaaa">) AND $exists(<innertext="bbbbb">)) {
    then {
        click(<href="ccccc">, "Left Click", "No")
    }
    else {
        click(<title="ddddd">, "Left Click", "No")
    }
}

Link to post
Share on other sites

That´s sooo easy ! I´m looking hours for any way - and at the end its a trifle.  :)   

 

Thanks iDollarstream, thanks Hellolnsomnia

Link to post
Share on other sites

and for future reference in addition to the $both param there is the opposite of that of $either ... does not pertain to your case here, just letting you know its there cuz it took me awhile to find $both and $either when I first got started as well.

  • Like 1
Link to post
Share on other sites

and for future reference in addition to the $both param there is the opposite of that of $either ... does not pertain to your case here, just letting you know its there cuz it took me awhile to find $both and $either when I first got started as well.

 

@dankass: thanks for this tip - so we learn every day a little bit more. :)

 

The $either I never used before. 

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