Resolved What do these arguments do?

Discussion in 'Developer Support' started by Fibbz, Oct 16, 2016.

  1. Ive seen alot of "!" and "! = " used for coding, i wonder what they actually do, could anyone help me? thanks
  2. Best Answer:
    Post #2 by RobinPC, Oct 16, 2016
  3. Means "is not" and "not equal to"

    !object.isValid() ; is not valid

    tree != null ; tree is not null
    #2 RobinPC, Oct 16, 2016
    Last edited: Oct 16, 2016
  4. Ok thanks i dont understand but i try my best to grasp it
  5. Ok.

    Let's say you want to check if there's a nearby tree to chop.
    GameObject tree = GameObjects.newQuery().names("Tree").results().nearest();
    This will look for a tree that is closest to the player.

    After that, you want to do:
    if(tree != null)
    To check if there's an actual tree around the player. If there is no tree, and you try to interact with it, it will return null, resulting in an error. That's why you do the != check.

    Does that clear up some stuff for you? :)
    Cloud likes this.
  6. Yes thanks alot! I have another doubt could you clear it for me?

    Could you tell me what each lines do? thanks, its an open source code of Mudrune grinder by bertrand.

    Execution.delayUntil(() -> Interfaces.newQuery().containers(1371, 1370).visible().results().size() != 0);
    if (Interfaces.newQuery().containers(1371, 1370).visible().results().size() != 0) {
    Execution.delay(2500, 3000);
    Execution.delay(2500, 3000);
    Execution.delayUntil(() -> Interfaces.newQuery().containers(1251).visible().results().size() == 0);
  7. Thanks, though I don't understand anything about programming, I understood this bit :)
  8. Bump, could someone explain those lines? ty again

Share This Page