From 03216e18932b3679dda11fbc021e6246233726be Mon Sep 17 00:00:00 2001 From: Major- Date: Sun, 3 Nov 2013 04:53:57 +0000 Subject: [PATCH] Add running (no energy support). --- data/plugins/run/plugin.xml | 14 ++++++++++++++ data/plugins/run/run.rb | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 data/plugins/run/plugin.xml create mode 100644 data/plugins/run/run.rb diff --git a/data/plugins/run/plugin.xml b/data/plugins/run/plugin.xml new file mode 100644 index 00000000..dad835a3 --- /dev/null +++ b/data/plugins/run/plugin.xml @@ -0,0 +1,14 @@ + + + run + 1 + Running + Adds support for running via the options interface. + + Major + + + + + + \ No newline at end of file diff --git a/data/plugins/run/run.rb b/data/plugins/run/run.rb new file mode 100644 index 00000000..91901102 --- /dev/null +++ b/data/plugins/run/run.rb @@ -0,0 +1,17 @@ +WALK_BUTTON_ID = 152 +RUN_BUTTON_ID = 153 + +on :button, WALK_BUTTON_ID do |player| + player.set_running(false) +end + +on :button, RUN_BUTTON_ID do |player| + player.set_running(true) +end + +on :command, :run do |player, command| + running = player.is_running + player.set_running(!running) + + player.send_message(running ? "You are now running." : "You are no longer running.") +end \ No newline at end of file