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

Question Opening Portable crafter

Discussion in 'Developer Support' started by Mike Hunt, Jun 16, 2017.

  1. Mike Hunt

    Joined:
    Apr 6, 2017
    Messages:
    29
    Likes Received:
    2
    I'm new to coding in Runemate. I managed to get a bot setup that will open a bank. I'm trying to figure out how to make it open the portable crafter and then hit the space key. Any ideas? thx in advance. Not familiar with the syntax so some direction where to find some syntax would be greatly appreciated. Thanks
     
  2. Jhinn

    Joined:
    Jun 9, 2015
    Messages:
    3,649
    Likes Received:
    1,337
    Ask yourself this:
    Is that portable an NPC or GameObject? How do I find that NPC/GameObject? If I find it, how do I interact with it?

    Also, take a look at the jdocs for help.
     
  3. Mike Hunt

    Joined:
    Apr 6, 2017
    Messages:
    29
    Likes Received:
    2
    It's a game object. I've seen something about using game object but I have no luck. Here is what I use and nothing happens.

    GameObjects.newQuery().names("Portable crafter").results().nearest();
    --- Double Post Merged, Jun 16, 2017, Original Post Date: Jun 16, 2017 ---
    Lol got it, had to put click() in there doh
    --- Double Post Merged, Jun 16, 2017 ---
    I normally program in php lol. This syntax is a new world for me.
     
  4. Jhinn

    Joined:
    Jun 9, 2015
    Messages:
    3,649
    Likes Received:
    1,337
    Don't forget to null check that result!
    Code (Text):
    1. GameObject portable = GameObjects.newQuery().names("Portable crafter").results().nearest();
    2.  
    3. if(portable != null) {
    4. // Interact with it
    5. }
     
  5. Mike Hunt

    Joined:
    Apr 6, 2017
    Messages:
    29
    Likes Received:
    2

Share This Page

Loading...