Compare commits

...

78 Commits

Author SHA1 Message Date
41f5f8e2b8 Wheel spin testing 2026-02-04 22:38:18 +10:00
e544b505f5 Fixed randomness - moved randomising to wheel class 2026-02-03 21:05:17 +10:00
4122817fae Slight Comment Change 2026-02-03 18:53:19 +10:00
c6ee83e51a Transposed wheels in machine str 2026-02-03 18:46:51 +10:00
13eb629a16 Added machine spinning 2026-02-03 18:35:49 +10:00
543b57603e Added wheels to slot machine. 2026-02-02 22:44:40 +10:00
a5d86f822c Added basic wheel functionality 2026-02-02 22:42:08 +10:00
d72a6ef6f2 Removed completed Todo 2025-08-15 19:35:42 +10:00
b3b8c2917e Deleted test files
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-15 19:27:37 +10:00
0fdf305cd4 Test again
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-14 18:09:40 +10:00
01170a3849 Docker changes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-14 18:06:43 +10:00
c088dd276e noo
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:50:13 +10:00
6f30a23b49 a bit more bs
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:46:38 +10:00
adfafa5af0 fasdfhjaksdf
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:44:57 +10:00
519528830c gemini will mess with me at all times is
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:43:58 +10:00
0d280777ff Gemini is stupid
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:42:54 +10:00
b7d1ecb8d6 debugging 2025-08-13 21:42:01 +10:00
9abaa12dce Idek
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:37:32 +10:00
1ceaa85589 debug
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:32:49 +10:00
2502b8e70e what
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:22:16 +10:00
7bdb6f613c Remove placeholders
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:19:37 +10:00
53458625c9 More syntax fixing
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:18:47 +10:00
7c1a21d802 Edit to fix syntax
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:17:48 +10:00
17178704a3 New from Gemini 2025-08-13 21:16:46 +10:00
ffa748f5de A bit of debug
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:12:10 +10:00
24dba9d952 Added safe directory in woodpecker
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:09:03 +10:00
14e64ba038 Added safe directory on server
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:08:29 +10:00
d58d35f354 Added git
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:07:31 +10:00
a46962fdcb Test
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:06:24 +10:00
d5ec4ad054 Adding sleep
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:04:55 +10:00
50e100d2ff Just shutdown
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:03:59 +10:00
659de90936 removing bs
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 21:02:42 +10:00
ff4d40b81c every time
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:01:59 +10:00
500c6ee002 syntax err
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 21:01:11 +10:00
ff53fd25cd More debugging 2025-08-13 21:00:14 +10:00
e664ad9d03 compose
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 20:58:08 +10:00
4465e6a84b Slimming
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:57:31 +10:00
0b1b4bc503 ffs
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 20:56:13 +10:00
b1b040f2a5 Added debugging
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:55:36 +10:00
ce7dd4ab94 Hard restart
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 20:51:13 +10:00
a53903bd36 Updates and testing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 20:49:43 +10:00
42555b8920 docker?
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 20:46:25 +10:00
6ee556ff60 debian again
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:45:07 +10:00
acdf1a393c Added daemon path
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:41:39 +10:00
4f7e2373cd Removed bottom volumes moving host path upwards
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:40:42 +10:00
28245c231d Added some logging for assistance
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:39:06 +10:00
cbce0eec68 added dash
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:38:28 +10:00
bc33de6a1f removed latest
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:37:59 +10:00
ecc6f4cabc Short syntax
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:37:29 +10:00
2b4dd965f5 Adding app path
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:35:58 +10:00
ac8dd1ad42 Uncomment bottom volumes
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:35:28 +10:00
3723bc2b82 Commenting top volumes
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:34:47 +10:00
27c3b7dc48 Comment bottom volumes 2025-08-13 20:34:24 +10:00
69fad2c469 Gemini Test 2025-08-13 20:33:44 +10:00
e433d622f9 Type docker 2025-08-13 20:32:42 +10:00
d0d8e24623 Debian 2025-08-13 20:29:59 +10:00
70abd8977b Reverting again 2025-08-13 20:29:26 +10:00
cc403c9789 Going back to debian 2025-08-13 20:28:55 +10:00
2614ad052c Manually reverting changes 2025-08-13 20:28:26 +10:00
7ef3a32e68 Removing volumes
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 20:22:30 +10:00
b22269a5b8 Debian 2025-08-13 20:22:04 +10:00
261f4e87ed Test 2025-08-13 20:20:54 +10:00
0373b51af9 Test 2025-08-13 20:19:55 +10:00
1bc5dd7198 Test 2025-08-13 20:13:52 +10:00
adfaafaf67 test 2025-08-13 20:12:21 +10:00
dccfb79ace Update .woodpecker.yml 2025-08-13 20:06:38 +10:00
028cab2de8 Update .woodpecker.yml
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 20:03:14 +10:00
d40308e1a4 Edits 2025-08-13 19:23:23 +10:00
7990cec65c edits 2025-08-13 19:21:41 +10:00
a1eca76102 Delete .woodpecker/test
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 18:45:41 +10:00
b891e3d00b Update .woodpecker.yml
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-08-13 18:45:25 +10:00
Gary
61b29eea67 Added test file 2025-08-13 18:35:03 +10:00
43b53d3ee8 edits 2025-08-13 18:29:33 +10:00
1073882d31 test 2025-08-13 18:27:30 +10:00
5bdc618d5c More changes for getting woodpecker to work 2025-08-13 18:26:15 +10:00
ab56bd5319 Updated for compose 2025-08-13 18:25:01 +10:00
68d366822b Added woodpecker file 2025-08-13 18:21:13 +10:00
692a160972 Added docker files for remote 2025-08-13 16:51:59 +10:00
9 changed files with 188 additions and 2 deletions

57
.woodpecker.yml Normal file
View File

@@ -0,0 +1,57 @@
kind: pipeline
type: docker # All steps will run in Docker containers.
name: update-and-restart-discord-bot # A descriptive name for the pipeline.
when:
- branch: main # This pipeline triggers on pushes to the 'main' branch.
event: push
steps:
- name: pull-latest-source # Step 1: Pull the latest code from Gitea.
image: alpine/git # A lightweight image that includes the 'git' command.
volumes:
# Mount your bot's source code directory with read-write permissions.
# This is crucial for 'git pull' to update the files on your host machine.
- /home/gary/Discord/Acrybot:/app:rw # ':rw' ensures read-write access.
commands:
- echo "--- Pulling latest source code from Git ---"
- cd /app # Navigate to the mounted project directory.
# Configure Git to trust the mounted directory to avoid 'unsafe repository' warnings.
- git config --global --add safe.directory /app
- git pull # Pulls the latest changes from the tracking branch.
- echo "Source code updated."
- name: manage-bot-containers # Step 2: Manage your bot's Docker containers.
# Changed image to 'docker:latest' to use the unhyphenated 'docker compose'
image: docker:latest
volumes:
# Mount the Docker socket from the host to allow control over host Docker daemon.
- /var/run/docker.sock:/var/run/docker.sock
# Mount your Docker Compose project directory into the container.
- /home/gary/Discord/Acrybot:/app
environment:
# IMPORTANT: Explicitly set the Docker Compose project name to lowercase.
# This ensures containers are managed with the 'acrybot' prefix,
# matching your existing containers.
COMPOSE_PROJECT_NAME: acrybot # Changed to lowercase 'acrybot'
commands:
- echo "--- Building 'python-app' image without cache to ensure latest code ---"
# Explicitly build the image for 'python-app' with --no-cache
- docker compose build --no-cache python-app
- echo "--- Stopping Discord bot service python-app ---"
# Stop the specific Discord bot service using the unhyphenated 'docker compose'.
- docker compose stop python-app
- echo "--- Bringing Discord bot service up python-app ---"
# Bring the specific Discord bot service back up using the unhyphenated 'docker compose'.
# '--build' is no longer needed here as it was already forced by 'docker compose build --no-cache'.
- docker compose up -d python-app
- echo "--- Verifying bot status ---"
# Directly check the status of the service using docker compose ps
- docker compose ps python-app
- echo "--- Logs of Discord bot service ---"
# Fetch the logs of the bot service using docker compose logs
- docker compose logs python-app

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
# Use a full Python runtime image to ensure necessary build tools are available.
FROM python
# Set the working directory to organize application files.
WORKDIR /app
# Copy requirements file to allow pip to find dependencies during build.
COPY requirements.txt /app/
# Install Python dependencies for the application to run correctly.
RUN pip install --no-cache-dir -r requirements.txt

14
docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
# Define the services (containers) that make up your application
services:
# 'python-app' is the name of your service
python-app:
# Build the Docker image using the Dockerfile in the current directory
build: .
# Mount the current directory on the host machine to '/app' inside the container.
# This enables real-time code changes during development.
volumes:
- "/home/gary/Discord/Acrybot:/app"
# EXPLICITLY set the entrypoint for your container.
# This ensures your Python script runs as the primary process and only once.
# Replace 'your_script_name.py' with the actual name of your Python file.
entrypoint: ["python", "src/py/Acronymbot.py"]

2
requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
discord
mariadb

View File

@@ -50,7 +50,7 @@ class Buttons(discord.ui.View):
@tree.command(description="Lmao")
async def test(interaction:discord.Interaction):
print(f"{interaction.user} used command! Woohoo!")
print(f"{interaction.user} used command! BAHHHH!")
try:
await interaction.response.send_message("Pay $5 for a Mario Moment", view=Buttons())
except discord.app_commands.errors.CommandInvokeError:

View File

@@ -4,7 +4,6 @@ from Ledger import Ledger
#TODO Look into 5card jack thingo that Tim mentioned
#TODO Insurance - If dealer starts with 21, you can bet against it and win your money back
#TODO Make each game session more distinct (Embeds?)
#TODO Card counting.
# Game States
INIT = 0

63
src/py/slots/Slots.py Normal file
View File

@@ -0,0 +1,63 @@
from Wheel import Wheel
from random import random
from time import sleep
class SlotMachine():
def __init__(self, screen_w=3, screen_h=3):
jackpot = 0
self.wheels=[]
for i in range(screen_w):
wheel = Wheel(size=screen_h)
self.wheels.append(wheel)
def spin(self, wSpins=1):
for _ in range(wSpins):
for wheel in self.wheels:
wheel.spin()
def __str__(self):
string = ""
# Create an empty matrix with the sole purpose of transposing it
matrix = [[],[],[]]
for i, wheel in enumerate(self.wheels):
for icon in wheel.icons:
matrix[i].append(icon)
# Use Zip function to transpose unpacked matrix (*matrix unpacks it)
matrix = zip(*matrix)
for row in matrix:
for icon in row:
string += str(icon) + " "
string += "\n"
return string
def main():
machine = SlotMachine()
win = False
result = []
machine.spin(wSpins=3)
while win == False:
machine.spin()
result = machine.wheels
first_icon = result[0].icons[1]
if all(wheel.icons[1] == first_icon for wheel in result):
win = True
print(machine)
sleep(1)
print("Woohoo!")
pass
if __name__ == "__main__":
main()

40
src/py/slots/Wheel.py Normal file
View File

@@ -0,0 +1,40 @@
import random as rand
"""
Wheel Class for implementing a wheel that spins in a poker machine
"""
class Wheel():
def __init__(self, size=3, num_icons = 3):
self.size=size
self.icons = list(range(size))
self.num_icons = num_icons
def spin(self, offset=1):
new_icons = list(range(self.size))
# Loop through each icon and move it one space up
# Uses modulus to loop final icon to first position
for i, icon in enumerate(self.icons):
new_icons[(i + offset) % len(new_icons)] = icon
# Randomise the first element
new_icons[0] = rand.randint(0, self.num_icons - 1)
self.icons = new_icons
def __str__(self):
string = ""
for icon in self.icons:
# Print wheel out with spaces between items
string += str(icon) + " "
return string
def main():
# wheel = Wheel()
# print(wheel)
pass
if __name__ == "__main__":
main()

Binary file not shown.