From 5a80c74b9a2b7f68026ed8ca52f53d2c10fd9355 Mon Sep 17 00:00:00 2001 From: jomo Date: Wed, 12 Aug 2015 22:00:03 +0200 Subject: [PATCH] turn plotter.py into actual plugin, not cli tool --- plotter.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plotter.py b/plotter.py index d598554..897d302 100644 --- a/plotter.py +++ b/plotter.py @@ -5,7 +5,8 @@ on hold because the PlotMe developer continued to develop PlotMe """ -import sys +from helpers import * +from basecommands import simplecommand x_plot_size = 3 z_plot_size = 3 @@ -23,8 +24,16 @@ def plot_id(x, z): return [x // (x_plot_size + padding), z // (z_plot_size + padding)] -x = int(sys.argv[1]) -z = int(sys.argv[2]) -print "id: %s" % plot_id(x, z) -print "base: %s" % base_coords(x, z) -print "bounds: %s" % bounds(x, z) +@simplecommand("plotter", + aliases = ["pt"], + senderLimit = 0, + helpSubcmd = True, + description = "Plot commands", + usage = "") +def plotter_command(sender, command, label, args): + loc = sender.getLocation() + x = loc.getX() + z = loc.getZ() + msg(sender, "id: %s" % plot_id(x, z)) + msg(sender, "base: %s" % base_coords(x, z)) + msg(sender, "bounds: %s" % bounds(x, z))