Fixed interrupt to have init then name. Also made spaces allowed in names

main
Silverwizard 3 days ago
parent 1212c7e5fd
commit c53aa46b17
  1. BIN
      __pycache__/shadowdice.cpython-38.pyc
  2. 2
      help.html
  3. 2
      metadata.ini
  4. 15
      shadowdice.py

@ -5,7 +5,7 @@ All commands can be run by typing it in the chat or privately messaging JJMumble
<b>!listinitpools</b>: List all init pools in the init DB<br> <b>!listinitpools</b>: List all init pools in the init DB<br>
<b>!rollinit</b>: Rolls the inits for all of the users, and outputs it<br> <b>!rollinit</b>: Rolls the inits for all of the users, and outputs it<br>
<b>!initpass</b>: Subtracts 10 from all inits, minimum 0<br> <b>!initpass</b>: Subtracts 10 from all inits, minimum 0<br>
<b>!interupt</b>: Subtracts an amount from a single user's init, wont work if you try to subtract more init from the character than they have <i>!interupt Malta 7</i> will subtract 7 init from Malta<br> <b>!interrupt</b>: Subtracts an amount from a single user's init, wont work if you try to subtract more init from the character than they have <i>!interupt 7 Malta</i> will subtract 7 init from Malta<br>
<b>!clearinit</b>: Deletes all of the initiatives<br> <b>!clearinit</b>: Deletes all of the initiatives<br>
<b>!srun</b>: Roll a bunch of dice, count successes and ones <i>!srun 12</i> will roll a pool of 12 dice<br> <b>!srun</b>: Roll a bunch of dice, count successes and ones <i>!srun 12</i> will roll a pool of 12 dice<br>
<b>!preedge</b>: Roll a pool with exploding 6s, counts successes, ones, and explosions <i>!preedge 12</i> will roll a poll of 12 dice<br> <b>!preedge</b>: Roll a pool with exploding 6s, counts successes, ones, and explosions <i>!preedge 12</i> will roll a poll of 12 dice<br>

@ -11,7 +11,7 @@ PluginCommands: [
"listinitpools", "listinitpools",
"initpass", "initpass",
"clearinit", "clearinit",
"interupt", "interrupt",
"srun", "srun",
"preedge", "preedge",
"assensing", "assensing",

@ -51,7 +51,7 @@ class Plugin(PluginBase):
try: try:
number_of_dice = int(all_data[1]) number_of_dice = int(all_data[1])
init_bonus = int(all_data[2]) init_bonus = int(all_data[2])
character_name = str(all_data[3]) character_name = str(" ".join(all_data[3:len(all_data)]))
init_db = sqlite3.connect('init.db') init_db = sqlite3.connect('init.db')
cur = init_db.cursor() cur = init_db.cursor()
cur.execute("INSERT INTO inits values (?,?,?,?) ON CONFLICT(name) DO UPDATE SET dice=" + str(number_of_dice) + ", bonus=" + str(init_bonus), (number_of_dice, init_bonus, 0, character_name)) cur.execute("INSERT INTO inits values (?,?,?,?) ON CONFLICT(name) DO UPDATE SET dice=" + str(number_of_dice) + ", bonus=" + str(init_bonus), (number_of_dice, init_bonus, 0, character_name))
@ -114,11 +114,11 @@ class Plugin(PluginBase):
text_type='header', box_align='left') text_type='header', box_align='left')
return return
def cmd_interupt(self, data): def cmd_interrupt(self, data):
all_data = data.message.strip().split() all_data = data.message.strip().split()
try: try:
name = str(all_data[1]) subtract = int(all_data[1])
subtract = int(all_data[2]) name = str(" ".join(all_data[2:len(all_data)]))
init_db = sqlite3.connect('init.db') init_db = sqlite3.connect('init.db')
cur = init_db.cursor() cur = init_db.cursor()
cur.execute("SELECT * from inits WHERE name = :name", {"name": name}) cur.execute("SELECT * from inits WHERE name = :name", {"name": name})
@ -136,11 +136,10 @@ class Plugin(PluginBase):
text_type='header', box_align='left') text_type='header', box_align='left')
return return
def cmd_delinit(self, data): def cmd_delinit(self, data):
all_data = data.message.strip().split() all_data = data.message.strip().split()
try: try:
name = str(all_data[1]) name = str(" ".join(all_data[1:len(all_data)]))
init_db = sqlite3.connect('init.db') init_db = sqlite3.connect('init.db')
cur = init_db.cursor() cur = init_db.cursor()
cur.execute("DELETE from inits WHERE name = :name", {"name": name}) cur.execute("DELETE from inits WHERE name = :name", {"name": name})
@ -239,10 +238,8 @@ class Plugin(PluginBase):
if this_die == 1: if this_die == 1:
ones = ones + 1 ones = ones + 1
if this_die == 6: if this_die == 6:
i = i-1 number_of_dice = number_of_dice + 1
explosions = explosions + 1 explosions = explosions + 1
if i < 1:
ret_text +=f", "
i = i + 1 i = i + 1
ret_text += f"<br>Successes: {successes} , Ones: {ones} , Explosions: {explosions}" ret_text += f"<br>Successes: {successes} , Ones: {ones} , Explosions: {explosions}"
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='left') gs.gui_service.quick_gui(ret_text, text_type='header', box_align='left')

Loading…
Cancel
Save