1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Bot not detecting GameObjects?

Discussion in 'Client & Site Support' started by paulsamaroo, Sep 14, 2015.

  1. paulsamaroo

    Joined:
    Jun 20, 2015
    Messages:
    279
    Likes Received:
    31
    @Cloud I noticed that with my Portable Planker bot, it is no longer detecting the portable sawmill; instead, it is just hovering over it. Once I click on the GameObject (Sawmill) manually, then everything else works as expected. I have tested this a few times, and came to the conclusion that this may be a bug in the GameObject detection. Below, I have listed two different variables tested for the GameObject declaration:

    GameObject sawmill = GameObjects.getLoaded("Portable sawmill").nearest();
    OR
    GameObject sawmill = GameObjects.newQuery().names("Portable sawmill").results().first();

    I have even used the IDs in place of the names, to no avail.

    Below, is the method for clicking the sawmill:


    if (sawmill != null ) {
    if (sawmill.isVisible() && Inventory.contains("Oak logs")) {
    sawmill.interact("Make planks");
    }
    }

    In order for it to click the sawmill, instead of sawmill.interact("Make planks");,I had to use this workaround:

    sawmill.hover();
    Mouse.click(Mouse.Button.LEFT);
     
  2. Best Answer:
    Post #2 by Cloud, Sep 14, 2015
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    The fact that you can hover it and get a non-null instance proves that it's detecting it fine. In regards to it not clicking, my assumption is that you didn't type the action exactly the way that it's displayed in the menu. Use the miscellaneous tab in the dev toolkit to find out what it is exactly.
     
  4. paulsamaroo

    Joined:
    Jun 20, 2015
    Messages:
    279
    Likes Received:
    31
    Is it possible that the action would have changed ? Reason I'm asking is because this all of a sudden happened.
     
  5. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,072
    Likes Received:
    1,894
    90% chance you're not passing the exact action.
     
  6. paulsamaroo

    Joined:
    Jun 20, 2015
    Messages:
    279
    Likes Received:
    31
    That's the miscellaneous tab. I'm seeing it's the same :/ Unless my sight has failed me lol
     

    Attached Files:

    • 12.png
      12.png
      File size:
      522.8 KB
      Views:
      6

Share This Page

Loading...