Jump to content
UBot Underground

Issue: "Contains" & 2 Variables


Recommended Posts

 Hello Ubotters,

 

After spending some hours to get it work, I decided to consult with you regarding an issue that I'm getting with some basic things. It could be that I'm just tired, but I can't determine what causes the problem.. Let's get to the point.

 

I have such code:

 

if($contains(#currentBotModule,"module1") OR $contains(#currentBotModule,"#module2") OR $contains(#currentBotModule,"#module3") OR $contains(#currentBotModule,"#module4") OR $contains(#currentBotModule,"#module5")) {
    then {
        module basic()
    }
    else if(ANOTHER MODULE FUNCTION)
    }
    else if(ANOTHER MODULE FUNCTION)
    }
    else if(ANOTHER MODULE FUNCTION)
    }
    else {
    }
}

 

I have the function modulesList which is being initialized before the above one, which specifies the module1, module2.. module5.  E.g (apple, pear,..orange)

The function currentBotModule is also being initialized before the above one at some point. (e.g. appleJuice, pearJuice,.. orangeJuice)

I checked in debugger and everything seems fine, but when it's being ran, it simply doesn't work but goes to else if command while it should run the module basic.

When I type in and replace module1 as its real value, (e.g. "apple") then it does work.

 

Anybody knows/sees what is causing the problem here? If you have some advice on how to make this possible w/o using OR, with either function perhaps, please suggest.

Thanks in advance guys!

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