Jump to content

How to scan for GroundDecorations?


jakealaka9

Recommended Posts

Hello, I'm making a firemaking script, and I'm having a problem with a line of code. I'm checking to see if my location has any GroundDecoration entities on it. If I'm not mistaken, some examples of GroundDecorations are Fire, Flowers, Fern, Small Fern. I don't understand why this code sometimes does, sometimes doesn't detect that the entity on the location is a GroundDecoration. It worked with one Fern, reaching "here3", and for another Fern with the same ID in a different location it didn't work, it only reached "here2". Can anyone help?

                    boolean move = false;
                    if(script.objects.get(script.myPosition().getX(), script.myPosition().getY()) != null)
                    {
                        script.log("here1");
                        for(RS2Object item : script.objects.get(script.myPosition().getX(), script.myPosition().getY()))
                        {
                            script.log("here2");
                            if(item instanceof GroundDecoration)           //Problem Line
                            {
                                script.log("here3");
                                move = true;
                            }
                        }
                    }

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...