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

Resolved Cant find items on ground

Discussion in 'Developer Support' started by stixx, Nov 12, 2018.

  1. stixx

    Joined:
    Jul 19, 2016
    Messages:
    35
    Likes Received:
    23
    [SOLVED]
    Hia!
    I have a little bit of programming knowledge and wanted to get into writing bots!

    My first bot will be a combat bot that will fight a monster and then loot only their runes.

    However, I'm not able to find any rune on the ground using this code:

    ```
    public class RunePicker extends LoopingScript {

    Pattern runePattern = Pattern.compile(".+ rune");
    @Override
    public void onStart(String... $) {
    super.onStart($);
    setLoopDelay(1000,1500);
    }

    @Override
    public void onLoop() {
    LocatableEntityQueryResults<GameObject> results = GameObjects.newQuery().names(runePattern).results();
    System.out.println("Size: " + results.size());
    }
    }
    ```​
    Any help on this would be awesome!
    --- Double Post Merged, Nov 12, 2018, Original Post Date: Nov 12, 2018 ---
    [SOLVED]
    Just incase someone is as retarded as I am:
    Use the class GroundItems instead of GameObjects!

    haha
     
    #1 stixx, Nov 12, 2018
    Last edited: Nov 12, 2018
    Corby and CuppaJava like this.
  2. Corby

    Joined:
    Jan 27, 2019
    Messages:
    337
    Likes Received:
    20
    Thank you for updating :) helped me
     
    stixx likes this.

Share This Page

Loading...