Jump to content
UBot Underground

Checking If Vars Have A Value?


Recommended Posts

I have two variables: Minimum price & Maximum price. Whether these two vars have a value (ie a price) effects the rest of the bot.

 

What's the best way to check if both vars have a value attached? (ie true or false).

 

thanks.

Link to post
Share on other sites

Thank you both, that works great, but I'm going to add a spanner into the works.

 

With the minimum and maximum price input, the user is able to make the bot chose one of four possible paths:

 

1) No price input for either min/max

 

2) Only a price for min

 

3) Only a price for max

 

4) Both prices for min/max

 

How would you check for all possible scenarios?

Link to post
Share on other sites

***Update***

 

Ok, I've added the two vars min/max price together like:

comment("Check for min / max prices")
if($add(#ebay_minimum_price,#ebay_maximum_price) = $nothing) {
    then {
        alert("nothing")
    }
    else {
        alert("price inc")
    }
}

The above will at least check if there is a min/max price value.

Link to post
Share on other sites

Thank you both, that works great, but I'm going to add a spanner into the works.

 

With the minimum and maximum price input, the user is able to make the bot chose one of four possible paths:

 

1) No price input for either min/max

 

2) Only a price for min

 

3) Only a price for max

 

4) Both prices for min/max

 

How would you check for all possible scenarios?

 

 

Try this one 

set(#MinimumPrice,$nothing,"Global")
set(#MaximumPrice,1,"Global")
if($comparison(#MinimumPrice,"!= Does not equal",$nothing) AND $comparison(#MaximumPrice,"!= Does not equal",$nothing)) {
    then {
        alert("Minimum and Maximum Price != nothing")
    }
    else if($comparison(#MinimumPrice,"= Equals",$noting()) AND $comparison(#MaximumPrice,"= Equals",$nothing)) {
        alert("Minimum and Maximum Price = nothing")
    }
    else if($comparison(#MinimumPrice,"!= Does not equal",$nothing)) {
        alert("Minimum Price != nothing")
    }
    else if($comparison(#MaximumPrice,"!= Does not equal",$nothing)) {
        alert("Maximum Price != nothing")
    }
    else {
    }
}

  • Like 1
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...