summaryrefslogtreecommitdiff
path: root/adminnotes.py
diff options
context:
space:
mode:
authorGap <l.uisv.gt@icloud.com>2015-01-14 18:31:44 +0100
committerGap <l.uisv.gt@icloud.com>2015-01-14 18:31:44 +0100
commit8b5b90513ed505ef40bbdb554e0a12a9d60524e8 (patch)
tree4293fba217ef31ccd2ac7a1031205c3a2c729181 /adminnotes.py
parent86756713a1eaa697b8fb2f6cbe2cbcd6fa89a713 (diff)
Adds note module
Diffstat (limited to 'adminnotes.py')
-rw-r--r--adminnotes.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/adminnotes.py b/adminnotes.py
index 622f563..e8b0a12 100644
--- a/adminnotes.py
+++ b/adminnotes.py
@@ -6,9 +6,11 @@ an_permission = "utils.an";
notes = open_json_file("adminnotes", [])
continued_messages = {}
+
def save_notes():
save_json_file("adminnotes", notes)
+
def r_ago(unit, i):
# Return ago + plural
i = i
@@ -16,6 +18,7 @@ def r_ago(unit, i):
unit +="s"
return str(i)+" "+unit+" ago"
+
def calc_diff(time_ago):
current = time.time()
s = current-time_ago
@@ -34,6 +37,7 @@ def calc_diff(time_ago):
ago = r_ago("day", s/60/60/12)
return ago
+
def show_all_notes(sender):
if len(notes) == 0:
msg(sender, "&aNo open notes at the moment!")
@@ -48,6 +52,7 @@ def show_all_notes(sender):
msg(sender, "&6#%s - &e%s&6, %s:" % (str(i+1), name, ago))
msg(sender, "&7%s" % colorify(message))
+
def show_an_help(sender):
msg(sender, "&6AdminNotes Help:")
msg(sender, "&e- /an")
@@ -117,6 +122,7 @@ def adminnotes_command(sender, args):
except:
print(print_traceback())
+
@hook.event("player.PlayerJoinEvent", "monitor")
def on_an_join(event):
if len(notes) > 0: