Jump to content
UBot Underground

Why Multiple $either Has Been Removed???


Recommended Posts

I'm making a script that has to check for multiple things by using the $either qualifier.

 

In the past we could do this easily by the example in the following video:

 

It seems this is not possible anymore... why???? :\

 

Now there is only "first condition" and "second condition".

 

See here http://wiki.ubotstudio.com/wiki/Either

 

I need to be able to add 20+ $eithers!

  • Like 1
Link to post
Share on other sites

just use:

 

 if either, else if either, else if either, 

 

 

that should sort it

 

That's not working like you said....

You say: IF $either 1 or 2 THEN do this, ELSE IF $either etc.etc.etc.

Makes no sense.

 

A total different result than what i want to achieve:

 

IF $either 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 or 11 or 12 or 13 or 14 or 15 THEN do this, ELSE do that.

  • Like 1
Link to post
Share on other sites

Just use OR,

 

you can copy a command in then space OR space command

 

It does look a bit off when you hit enter but it works perfectly

set(#number, 5, "Global")
if($comparison(#number, "=", 4) OR $comparison(#number, "=", 5) OR $comparison(#number, "=", 6)) {
    then {
        alert("Yes")
    }
    else {
        alert("No")
    }
}

  • Like 2
Link to post
Share on other sites

I have kinda bypassed this issue by using over 20(!) IF statements to check if some of the 20+ things are on a page, and used code in a Define and run that same code in all ELSE statements.

 

Please note that this is FARRRRRR from ideal, as it costed me plenty of boring time to repeat the same process over and over again, plus the ubot script in particular only has become much longer and probably take a bit more time to run trough all this mess of code.

 

Unbelievable they removed the multiple $either from uBot v4.

Not user-friendly.

Link to post
Share on other sites

 

Just use OR,

 

you can copy a command in then space OR space command

 

It does look a bit off when you hit enter but it works perfectly

set(#number, 5, "Global")
if($comparison(#number, "=", 4) OR $comparison(#number, "=", 5) OR $comparison(#number, "=", 6)) {
    then {
        alert("Yes")
    }
    else {
        alert("No")
    }
}

 

Thanks that does make sense.

I'll play with it next time, as i have "fixed" it my way (see previous post).

 

Still wondering why Ubot did not add the OR themself in the drag & drop.

i did not even know the OR is possible in uBot just because it is nowhere in the Commnands or Parameters (on the left).

Link to post
Share on other sites

u also can use the short way

set(#var, 5, "Global")
if(#var = 1 OR #var = 2 OR #var = 3 OR #var = 4 OR #var = 5) {
    then {
        alert("value found")
    }
    else {
    }
}

also this is possible

set(#var, 5, "Global")

set(#var2, 7, "Global")

if((#var = 1 AND #var2 = 7) OR  (#var = 2 AND #var2 = 7))OR  (#var = 3 AND #var2 = 7)  OR ( #var = 4 AND #var2 = 7)  OR (#var = 5 AND #var2 = 7) ) {
    then {
        alert("value found")
    }
    else {
    }
}

for me that is a much more flexible way instead use $both and $either

  • Like 2
Link to post
Share on other sites

 

Just use OR,

 

you can copy a command in then space OR space command

 

It does look a bit off when you hit enter but it works perfectly

set(#number, 5, "Global")
if($comparison(#number, "=", 4) OR $comparison(#number, "=", 5) OR $comparison(#number, "=", 6)) {
    then {
        alert("Yes")
    }
    else {
        alert("No")
    }
}

 

 

I typed in OR once before in the search bar of ubot but nothing came up, so I thought that

it did not exist, is there any other ones that are not listed in the drag and drop tool box that

you know of?

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