Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Printing the furthest plot

Jesse Boyd edited this page Dec 9, 2016 · 5 revisions
/*
* Script to find the furthest plot from origin in a world:
*  - /plot debugexec runasync furthest.js <plotworld>
*/

if (PS.isPlotWorld("%s0")) {
    plots=PS.getPlotAreaByString("l").getPlots();
    iter=plots.iterator();
    max=0;
    while(iter.hasNext()){
        plot=iter.next();
        if(t=Math.max(Math.abs(plot.id.x),Math.abs(plot.id.y))>max){
            max=t;
            maxPlot=plot
        }
    };
    PS.class.static.log(maxPlot);
}
else {
    PlotPlayer.sendMessage("Usage: /plot debugexec runasync furthest.js <plotworld>");
}
Clone this wiki locally