From 686e5d66173a122b81219e65b10ff4cac4a38d2d Mon Sep 17 00:00:00 2001 From: BigGamerGary Date: Sun, 18 Feb 2024 10:00:21 +1000 Subject: [PATCH] Main addition: Russian Roulette --- Database Schema.drawio | 24 ----- docker-compose.yml | 13 ++- ledger.db | Bin 8192 -> 8192 bytes list.txt | 2 +- src/py/Acronymbot.py | 92 +++++++++++++++++- src/py/Dockerfile | 3 +- src/py/Gamepicker.py | 1 - src/py/__pycache__/BlackJack.cpython-310.pyc | Bin 10001 -> 10001 bytes src/py/__pycache__/Calculator.cpython-310.pyc | Bin 4860 -> 4860 bytes src/py/__pycache__/Gamepicker.cpython-310.pyc | Bin 641 -> 641 bytes src/py/__pycache__/Ledger.cpython-310.pyc | Bin 2849 -> 2849 bytes 11 files changed, 105 insertions(+), 30 deletions(-) delete mode 100644 Database Schema.drawio diff --git a/Database Schema.drawio b/Database Schema.drawio deleted file mode 100644 index 792f70e..0000000 --- a/Database Schema.drawio +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docker-compose.yml b/docker-compose.yml index 6d5b113..810923b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,20 @@ version: "3.3" -volumes: - networks: + net: + driver: bridge services: acronymbot: build: ./src/py volumes: - "./src/py:/usr/app/src" + networks: + - "net" + depends_on: + - database + + database: + image: mariadb:latest + networks: + - "net" diff --git a/ledger.db b/ledger.db index 08d94958718c321cf174d81645af9378d997f77d..f0951525b6afde52794b189d9d0ec61d076c27df 100644 GIT binary patch delta 103 zcmZp0XmFSy&FD2z#+lJ;W5N=CK34wa4E#6v-|(O2-^ssxv!K9KeiZ>$HU>5(P7dbm z>kD|A7?>D!1Xv&_d7^JE!~~LJWMs0eol?WZz@RSRQvv`~ C@)u?R delta 65 zcmZp0XmFSy&1gMQ#+lK2W5N=CE@uAI4E#6v-|(N_tSHdNKe54l@@aWl30@C MAXLINELENGTH +tooShort = lambda x: len(x) < MAXLINELENGTH +difference = lambda x: MAXLINELENGTH - len(x) +sidePad = lambda x: " " * (difference(x) // 2) +evenPad = lambda x: sidePad(x) + x + sidePad(x) +oddPad = lambda x: evenPad(x) + " " + +def demon_text_helper(line): + if tooShort(line): + if difference(line) % 2 == 0: + return evenPad(line) + else: + return oddPad(line) + + return line + +def demon_text(lineOne="", lineTwo="", lineThree=""): + + if tooLong(lineOne) or tooLong(lineTwo) or tooLong(lineThree): + print("Line too long lol") + + lineOne = demon_text_helper(lineOne) + lineTwo = demon_text_helper(lineTwo) + lineThree = demon_text_helper(lineThree) + + + + demon = f"``` , , /\ /\ \n\ + /( /\ )\ _\ \_/ /_ ____________\n\ + |\_||_/| < \_ _/ > / \ \n\ + \______/ \|0 0|/ | {lineOne} |\n\ + _\/_ _(_ ^ _)_ | {lineTwo} |\n\ + ( () ) /`\|V\"\"\"V|/`\ | {lineThree} |\n\ + {{}} \ \_____/ / <______________/\n\ + () /\ )=( /\ \n\ + {{}} / \_/\=/\_/ \ \n```" + return demon + +class ShootOrNoShoot(discord.ui.View): + def __init__(self, *, timeout=180): + super().__init__(timeout=timeout) + self.bullets = 6 + + @discord.ui.button(label="Shoot", style=discord.ButtonStyle.red) + async def shoot(self, interaction: discord.Interaction, button: discord.ui.Button): + if self.bullets == 0: + for child in self.children: + child.disabled = True + await interaction.response.edit_message(content=f"What?", view=self) + + if random.randrange(0,self.bullets) == 0: + for child in self.children: + child.disabled = True + + demonDeath = demon_text(lineOne="You died!", lineTwo="Bahahahah!", lineThree=f"Score: {6 - self.bullets}") + await interaction.response.edit_message(content=f"{demonDeath}", view=self) + + else: + + self.bullets -= 1 + button.label = f"Shoot again" + demonLife = demon_text(lineOne="You live", lineTwo="This time!!", + lineThree=f"({6 - self.bullets}/5) blanks") + await interaction.response.edit_message(content=f"{demonLife}", view=self) + + + + + @discord.ui.button(label="PussyOut", style=discord.ButtonStyle.blurple) + async def noshoot(self, interaction: discord.Interaction, button: discord.ui.Button): + for child in self.children: + child.disabled = True + + demonPussy = demon_text(lineOne="You are such", lineTwo="a huge pussy", lineThree= "0 bitches 4u") + await interaction.response.edit_message(content=f"{demonPussy}", view=self) + + +@tree.command(description="????") +async def rr(interaction: discord.Interaction): + await interaction.response.defer() + buttons = ShootOrNoShoot() + demon = demon_text(lineTwo="Shoot urself") + await interaction.followup.send(content=f"{demon}", view=buttons) + """ #### Fin #### """ diff --git a/src/py/Dockerfile b/src/py/Dockerfile index 32c77d2..58ee22d 100644 --- a/src/py/Dockerfile +++ b/src/py/Dockerfile @@ -1,6 +1,7 @@ FROM python:3 -RUN pip install discord +RUN pip install discord \ + && pip install mariadb WORKDIR /usr/app/src diff --git a/src/py/Gamepicker.py b/src/py/Gamepicker.py index 7d19e33..d07f167 100644 --- a/src/py/Gamepicker.py +++ b/src/py/Gamepicker.py @@ -11,7 +11,6 @@ import random # "Viscera Cleanup Detail", # "SCP", # "Satisfactory", -# "Backrooms (Alternate Ending)", # "Ghost Recon Wildlands" # ] diff --git a/src/py/__pycache__/BlackJack.cpython-310.pyc b/src/py/__pycache__/BlackJack.cpython-310.pyc index d026e1c6391347371fa20e5c277577fc4b2bd85f..1cb855bbf81e12cd73816922594131de789ec0b0 100644 GIT binary patch delta 20 acmbQ}H_?wfpO=@50SFf9W^CkUQwIPvHUxbD delta 20 acmbQ}H_?wfpO=@50SMNoq-^A7QwIPw#{|6q diff --git a/src/py/__pycache__/Calculator.cpython-310.pyc b/src/py/__pycache__/Calculator.cpython-310.pyc index 8fa636a5420c6ed10974f137024fd216c32c9b7c..be1f2bb766e1a11016682e2426b31b14cce1227c 100644 GIT binary patch delta 21 bcmeyP`bU)~pO=@50SFf9W~6T9`5*)UMmPpN delta 21 bcmeyP`bU)~pO=@50SLIaTu9l-^FaszN1O(f diff --git a/src/py/__pycache__/Gamepicker.cpython-310.pyc b/src/py/__pycache__/Gamepicker.cpython-310.pyc index 3343ec611afca6beb39fb14718e0598ae23d0b90..1db596f27015b3f45cce309445d59bec43e47c65 100644 GIT binary patch delta 40 ucmZo@)|QTicWT9yv!&uS(GWAm7kA=hZz97%?N$~ delta 40 ucmZoJJ8BM9gK diff --git a/src/py/__pycache__/Ledger.cpython-310.pyc b/src/py/__pycache__/Ledger.cpython-310.pyc index 4a62dedad19d3eef5b299235b09c4d5d8b4c057f..77bbd44318257f796ec733c7c4ca84f5968c0f17 100644 GIT binary patch delta 21 bcmZ1|wor^GpO=@50SFf9W~6T95#