Jump to content
UBot Underground

What's The Best Advanced 'qualifier' Plugin?


Recommended Posts

Hello,

i'm making data driven, decision making bots and sometimes i find myself nesting tons of  'Qualifiers' and it looks messy and there's got to be a better way. For example i just nested 8 '$boths' in an 'IF', each with it's own '$comparison'. 

Is there an advanced qualifier or advanced  data processing plugin out there? 
If someone knows a plugin with this that'd be great =)

Thanks,

Link to post
Share on other sites

Perhaps you could use $eval or run python ($run python with results) to execute some of that logic in Javascript or Python, respectively?

 

Edit: Just noticed you're on Professional. Python is in developer edition only (I believe).

Edited by SEO
  • Like 1
Link to post
Share on other sites

 

 

i find myself nesting tons of  'Qualifiers' and it looks messy and there's got to be a better way. For example i just nested 8 '$boths' in an 'IF', 

Ubot supports using 'OR' 'AND' as qualifiers too. You can add as many as you wish on a single if statement.

 

check out this video -

http://www.screencast.com/t/L7UR89vJQaSV

  • Like 1
Link to post
Share on other sites

Here's a basic example of some code that could quickly get out of control. You have the first option with the nested both statements which is something that is easy to edit and see visually but quickly gets out of control and in the end is probably not that readable. Then there is option #2 which is not as easy to edit but is much more readable and so in small cases this is probably the best option. Then there is option #3 which is most cases is the best option. Create a function that is named well and have it return true or false. That way when you read the code you don't have to figure out what it's doing instead you read the name and the name tells you what it's doing. This kind of thing will help to avoid spaghetti code. And if you ever have to modify that function you can go in and see its pretty straightforward and easy to understand because everything is separated out.

set(#x,$rand(1,100),"Global")
set(#y,$rand(1,100),"Global")
set(#z,$rand(1,100),"Global")
comment("Option #1")
if($both($both($comparison(#x,">",50),$comparison(#y,">",50)),$comparison(#z,">",50))) {
    then {
        alert("yes
{#x}, {#y}, {#z}")
    }
    else {
        alert("no
{#x}, {#y}, {#z}")
    }
}
comment("Option #2")
if($comparison(#x,">",50) AND $comparison(#y,">",50) AND $comparison(#z,">",50)) {
    then {
        alert("yes
{#x}, {#y}, {#z}")
    }
    else {
        alert("no
{#x}, {#y}, {#z}")
    }
}
comment("Option #3")
if($ArePointsOverFifty(#x, #y, #z)) {
    then {
        alert("yes
{#x}, {#y}, {#z}")
    }
    else {
        alert("no
{#x}, {#y}, {#z}")
    }
}
define $ArePointsOverFifty(#x, #y, #z) {
    if($comparison(#x,">",50)) {
        then {
        }
        else {
            return("false")
        }
    }
    if($comparison(#y,">",50)) {
        then {
        }
        else {
            return("false")
        }
    }
    if($comparison(#z,">",50)) {
        then {
        }
        else {
            return("false")
        }
    }
    return("true")
}
  • 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...