From c3b474411699f617bde213db0234d10d4baca25b Mon Sep 17 00:00:00 2001 From: silverwizard Date: Tue, 21 Mar 2023 23:57:30 -0400 Subject: [PATCH] Added Obs table --- burningdice.py | 58 +++++++++++++++++++++++++++++++++++++++++++++----- help.html | 3 +++ metadata.ini | 5 ++++- 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/burningdice.py b/burningdice.py index e7e6470..e3ba4fc 100644 --- a/burningdice.py +++ b/burningdice.py @@ -72,7 +72,34 @@ class Plugin(PluginBase): gs.gui_service.quick_gui(str(gs.mumble_inst.users[data.actor]['name']) + " has scripted volley " + str(v), text_type='header', box_align='left') return except IndexError: - gs.gui_service.quick_gui("Format: !volley # script actions", + gs.gui_service.quick_gui("Format: !volley # script_actions", + text_type='header', box_align='left') + return + + def cmd_npcvolley(self, data): + all_data = data.message.strip().split() + try: + v = int(all_data[1]) + if (v == 1): + volley = "v1" + elif (v == 2): + volley = "v2" + elif (v == 3): + volley = "v3" + else: + gs.gui_service.quick_gui("Format: !npcvolley # name script_actions", + text_type='header', box_align='left') + return + script = str(all_data[3:]) + init_db = sqlite3.connect('init.db') + cur = init_db.cursor() + cur.execute("INSERT INTO " + volley + " values (?,?) ON CONFLICT(name) DO UPDATE SET content=\"" + script + "\"", (str(script),str(all_data[2]))) + init_db.commit() + init_db.close() + gs.gui_service.quick_gui(str(gs.mumble_inst.users[data.actor]['name']) + " has scripted volley " + str(v), text_type='header', box_align='left') + return + except IndexError: + gs.gui_service.quick_gui("Format: !volley # name script_actions", text_type='header', box_align='left') return @@ -131,15 +158,23 @@ class Plugin(PluginBase): return def clear_volley(self, volleynum): + self.del_volley(volleynum, "ThisNonceWillNeverBeUsedAsAName"); + + def del_volley(self, volleynum, name): volley = "v" + str(volleynum) init_db = sqlite3.connect('init.db') init = init_db.cursor() - init.execute("DROP TABLE " + volley) - init_db.commit() - init.execute("CREATE TABLE IF NOT EXISTS " + volley + " (content string, name string UNIQUE)") + if (name == "ThisNonceWillNeverBeUsedAsAName"): + init.execute("DROP TABLE " + volley) + init_db.commit() + init.execute("CREATE TABLE IF NOT EXISTS " + volley + " (content string, name string UNIQUE)") + gs.gui_service.quick_gui("Purged all for " + volley, text_type='header', box_align='left') + else: + dbname = "\'" + name + "\'" + init.execute("DELETE FROM " + volley + " where name LIKE " + dbname); + gs.gui_service.quick_gui("Removed " + name + " from volley " + volley, text_type='header', box_align='left') init_db.commit() init_db.close() - gs.gui_service.quick_gui("Purged all for " + volley, text_type='header', box_align='left') def cmd_clearv1(self, data): self.clear_volley(1) @@ -153,6 +188,16 @@ class Plugin(PluginBase): self.clear_volley(3) return + def cmd_unscript(self,data): + all_data = data.message.strip().split() + if(len(all_data) == 2): + self.del_volley(1,all_data[1]) + self.del_volley(2,all_data[1]) + self.del_volley(3,all_data[1]) + else: + self.del_volley(int(all_data[2]),all_data[1]) + return + def cmd_bw(self, data): all_data = data.message.strip().split() try: @@ -330,3 +375,6 @@ class Plugin(PluginBase): def cmd_sessionend(self, data): gs.gui_service.quick_gui("
Name Earns/Type Description
Belief 1 Fate Driving the game forward with a Belief
Instinct 1 Fate Playing an Instinct makes the character's life difficult
Trait 1 Fate Invoking a trait that sends the story in an unforeseen direction
Humour 1 Fate For an in-character game-stopper
Right Skill, Right Time 1 Fate For having a skill to make the story go
Embodiment 1 Persona For really good or distinctive roleplaying
Moldbreaker 1 Persona For going beyond the bounds of the character
Workhorse 1 Persona For doing all the work of the scenario
MVP 1 Persona For being the crucial element of success
Personal Goals 1 Persona Revenge, triumph, seduction, victory
Greater Goals 1 Deeds Accomplishing goals bigger than you!
Beyond the Call 1 Deeds Helping, no matter the cost
", text_type='header', box_align='left') + + def cmd_obs(self, data): + gs.gui_service.quick_gui("
Ob 1A simple act done with litttle thought
Ob 2An act performed routinely at your job
Ob 3An act you can accomplish if you concentrate
Ob 4A risky act
Ob 5An act that requires expertise
Ob 6An act that requires a heroic effort
Ob 7An improbable feat
Ob 8An act requiring preternatural ability or a lot of help
Ob 9An act deemed nearly impossible
Ob 10A miracle
", text_type='header', box_align='left') diff --git a/help.html b/help.html index 824af80..99eda40 100644 --- a/help.html +++ b/help.html @@ -6,9 +6,12 @@ All commands can be run by typing it in the chat or privately messaging JJMumble !secondsight: Print the table of second sight difficulties.
!touchofages: Print the table of touch of ages difficulties.
!aurareading: Print the table of aura reading difficulties.
+!obs: Print the standard difficulties table.
!sessionend: Print the Artha awards table.
!volley: Sample !volley 1 Block Strike. Prepend the volley number and then the actions. Everything after the volley number is freeform.
+!npcvolley: Sample !volley 1 Name Block Strike. Prepend the volley number, the name of the NPC, and then the actions. Everything after the volley number is freeform.
!revealv[1-3]: Prints everyone's script for given volley.
!clearv[1-3]: Clears all scripts for given volley.
!scriptedv[1-3]: Lists who has scripted for given volley.
!scripted: Lists who has scripted for all volleys.
+!unscript: Uses the format !unscript Name [#]. Removes the given name from the volley if a number is supplied. Otherwise, removes them from all volleys.
diff --git a/metadata.ini b/metadata.ini index 8d78199..f57c384 100644 --- a/metadata.ini +++ b/metadata.ini @@ -12,7 +12,9 @@ PluginCommands: [ "aurareading", "sessionend", "bwo", + "obs", "volley", + "npcvolley", "revealv1", "revealv2", "revealv3", @@ -22,7 +24,8 @@ PluginCommands: [ "scriptedv1", "scriptedv2", "scriptedv3", - "scripted" + "scripted", + "unscript" ] [Plugin Settings]