2015-08-01 20:01:41 +02:00
|
|
|
/*
|
|
|
|
This is an example script that will auto merge all plots
|
2019-08-12 23:59:14 +02:00
|
|
|
/plot debugexec runasync automerge.js <removeroads>
|
2015-08-01 20:01:41 +02:00
|
|
|
*/
|
2019-04-12 04:11:03 +02:00
|
|
|
var plots = PS.sortPlotsByTemp(PS.getPlots());
|
2015-08-28 01:51:05 +02:00
|
|
|
PS.class.static.log("Attempting to auto merge " + plots.size() + " plots");
|
2015-08-01 20:01:41 +02:00
|
|
|
if ("%s0" === "true") {
|
|
|
|
for (var i = 0; i < plots.size(); i++) {
|
|
|
|
var plot = plots.get(i);
|
2019-01-12 20:56:11 +01:00
|
|
|
plot.autoMerge(-1, 250000, plot.owner, true);
|
2015-08-01 20:01:41 +02:00
|
|
|
}
|
2019-04-24 00:48:22 +02:00
|
|
|
} else if ("%s0" === "false") {
|
2015-08-01 20:01:41 +02:00
|
|
|
for (var i = 0; i < plots.size(); i++) {
|
|
|
|
var plot = plots.get(i);
|
2019-01-12 20:56:11 +01:00
|
|
|
plot.autoMerge(-1, 250000, plot.owner, false);
|
2015-08-01 20:01:41 +02:00
|
|
|
}
|
2019-04-24 00:48:22 +02:00
|
|
|
} else {
|
2015-08-01 20:01:41 +02:00
|
|
|
C_COMMAND_SYNTAX.send(PlotPlayer, "/plot debugexec automerge.js <removeroads>");
|
2019-01-12 20:56:11 +01:00
|
|
|
MainUtil.class.static.sendMessage(PlotPlayer, "$1<removeroads> is true or false if you want to remove roads when auto merging");
|
2018-08-10 17:01:10 +02:00
|
|
|
}
|