futurepasts Posted January 5, 2016 Posted January 5, 2016 Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get
progamerz Posted January 5, 2016 Posted January 5, 2016 Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get Use explv location assitant or Divine Utility.
Explv Posted January 5, 2016 Posted January 5, 2016 Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get You can use "Explv's Location Assistant" in the Other section, and just copy-paste your path, it will show on screen.
futurepasts Posted January 6, 2016 Author Posted January 6, 2016 No no i mean like when im using my own script i need onPaint method to draw my path to some kind of area or something like that
Explv Posted January 6, 2016 Posted January 6, 2016 (edited) No no i mean like when im using my own script i need onPaint method to draw my path to some kind of area or something like that Do you mean a predefined path? Or colour all the tiles that your player walks to? Edited January 6, 2016 by Explv
Explv Posted January 6, 2016 Posted January 6, 2016 (edited) Do you mean a predefined path? Or colour all the tiles that your player walks to? Colouring every tile that your player walks to: private final List<Position> WALKED_POSITIONS = new ArrayList<>(); @Override public void onPaint(Graphics2D g){ updateWalkedPositions(); drawWalkedPositions(g); } private void updateWalkedPositions(){ if(!WALKED_POSITIONS.contains(myPosition())) WALKED_POSITIONS.add(myPosition()); } private void drawWalkedPositions(Graphics2D g){ for(Position position : WALKED_POSITIONS) fillPositionOnScreen(position, g); } private void fillPositionOnScreen(Position position, Graphics2D g){ Polygon polygon = position.getPolygon(script.getBot()); g.fillPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); } Edited January 6, 2016 by Explv
Joseph Posted January 6, 2016 Posted January 6, 2016 You can can draw your own position then all you do is the same logic but use a for loop and just loop through your array of position and display them