Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Super advanced circle area #rekt #blazeit720 #pro #owned #yourmom


    Polish Civil

    Recommended Posts

    class class CircleArea implements Locatable {
            private final Tile center;
            private final int radius;
    
            /**
             * @param center
             * @param radius
             */
            public CircleArea(Tile center, int radius) {
                this.center = center;
                this.radius = radius;
            }
    
            /**
             * @return
             */
            public Tile getCenter() {
                return center;
            }
    
            /**
             * @param location
             * @return
             */
            public boolean contains(Locatable location) {
                return location.tile().distanceTo(center) <= radius;
            }
    
            /**
             * @param g
             * @param ctx
             */
            public void draw(Graphics2D g, ClientContext ctx) {
                drawMiniMap(g, ctx);
            }
    
            /**
             * @param g
             * @param ctx
             */
            private void drawMiniMap(Graphics2D g, ClientContext ctx) {
                if (center.matrix(ctx).onMap()) {
                    final Point point = center.matrix(ctx).mapPoint();
                    final int pixelRadius = radius * 8;
                    g.setColor(contains(ctx.players.local().tile()) ? new Color(8, 174, 14, 128) : new Color(255, 0, 0, 128));
                    g.fillOval(point.x - pixelRadius / 2, point.y - pixelRadius / 2, pixelRadius, pixelRadius);
                    g.setColor(Color.BLACK);
                    g.drawOval(point.x - pixelRadius / 2, point.y - pixelRadius / 2, pixelRadius, pixelRadius);
                }
            }
    
            /**
             * @return
             */
            public Tile random() {
                final double rX = Math.random();
                final double rY = Math.random();
                final double angle = 2 * Math.PI * rX / rY;
                final Point2D.Double point = new Point.Double(
                        rY * (radius - 1) * Math.cos(angle),
                        rY * (radius - 1) * Math.sin(angle)
                );
                return new Tile((int) (center.x() + point.x), (int) (center.y() + point.y), tile().floor());
            }
    
            @Override
            public Tile tile() {
                return center;
            }
        }

    You're welcome, you can donate me on paypal [email protected] for this amazing work.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.