Jump to content
UBot Underground

if condition with a $exists looking for *


Recommended Posts

I have a new challenge that already cost me about 3 hours and I can't figure it out :(

 

I have this code:

<td style="padding:4px;background-color:#203e42">just some 
text*</td>

I need to make a IF condition that needs to look if there is a star behind the text or not (the text is different every time).

I need to use outerhtml because the backgroundcolor also need to exists.

I already tried the following and more but without success:

 

 

    if($exists(<outerhtml=w"<td 
style=\"padding:4px;background-color:#203e42\">*\*</td>">)) {        then {            alert("Star")        }

 

if($exists(<outerhtml=w"<td 
style=\"padding:4px;background-color:#203e42\">*"*"</td>">)) 
{then {alert("Star")}

 

if($exists(<outerhtml=w"<td 
style=\"padding:4px;background-color:#203e42\">*'*'</td>">)) 
{then {alert("Star")}

Is it possible to do this with only a $exists?

Link to post
Share on other sites

I don't understand why it's not possible with a single $exists.

I searched the forums and read this topic http://www.ubotstudio.com/forum/index.php?/topic/6026-wildcard-not-working-correctly/?p=34047

There they say you can escape characters like * with [*].

 

Is that not working anymore in the newer releases of ubot?

Link to post
Share on other sites

I've got it to work with the same method you explained me yesterday, but still I think it should be possible with a single $exists :rolleyes:

 

The version that works now is:

set(#Star, $scrape attribute(<outerhtml=w"<td style=\"padding:4px;background-color:#203e42\">*</td>">,"innertext"), "Global")
set(#Star, $find regular expression(#Star, "\\*"), "Global")
set(#Star, $trim(#Star), "Global")
if($comparison(#Star, "=", "*")) {
  then {
     alert("Star")        
  }

 

Thanks for your time again VaultBoss!

Link to post
Share on other sites

if($contains($scrape attribute(<outerhtml=w"<td style=\"padding:4px;background-color:#203e42\">*</td>">,"innertext"), "*")) {
    then {
        alert("Star")
    }
    else {
        alert("No Star")
    }
}

  • Like 1
Link to post
Share on other sites
  • 4 weeks later...

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