Jump to content

How would I get the Z coordinate..?


BrownBird

Recommended Posts

If for some reason or another the debug option 'location'

doesn't show z/Plane.

 

you could always:

//manifest
public class Coords extends Script {
    @Override
    public int onLoop() throws InterruptedException {
        return 700;
    }


    @Override
    public void onStart() throws InterruptedException {
        log("Beginning Position Debug.");
    }
    private final Color color1 = new Color(255, 255, 255);
    private final Color color2 = new Color(0, 0, 0);

    private final BasicStroke stroke1 = new BasicStroke(1);

    private final Font font1 = new Font("Arial", 1, 15);


    @Override
    public void onPaint(Graphics2D g) {
        g.setColor(color1);
        g.fillRect(3, 4, 106, 63);
        g.setColor(color2);
        g.setStroke(stroke1);
        g.drawRect(3, 4, 106, 63);
        g.setFont(font1);
        g.drawString("Coords:", 8, 17);
        g.drawString("X - " + myPlayer().getPosition().getX(), 6, 33);
        g.drawString("Y - " + myPlayer().getPosition().getY(), 6, 48);
        g.drawString("Z - "  + myPlayer().getPosition().getZ(), 8, 63);

    }
}
 

 

Link to comment
Share on other sites

If for some reason or another the debug option 'location'

doesn't show z/Plane.

 

you could always:

//manifest
public class Coords extends Script {
    @Override
    public int onLoop() throws InterruptedException {
        return 700;
    }


    @Override
    public void onStart() throws InterruptedException {
        log("Beginning Position Debug.");
    }
    private final Color color1 = new Color(255, 255, 255);
    private final Color color2 = new Color(0, 0, 0);

    private final BasicStroke stroke1 = new BasicStroke(1);

    private final Font font1 = new Font("Arial", 1, 15);


    @Override
    public void onPaint(Graphics2D g) {
        g.setColor(color1);
        g.fillRect(3, 4, 106, 63);
        g.setColor(color2);
        g.setStroke(stroke1);
        g.drawRect(3, 4, 106, 63);
        g.setFont(font1);
        g.drawString("Coords:", 8, 17);
        g.drawString("X - " + myPlayer().getPosition().getX(), 6, 33);
        g.drawString("Y - " + myPlayer().getPosition().getY(), 6, 48);
        g.drawString("Z - "  + myPlayer().getPosition().getZ(), 8, 63);

    }
}
 

 

That's what I ended up doing :) Thanks though! I thought this would've been built into the client though...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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