diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..141a7cd --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +# Discord Webhook Configuration +# Set your Discord webhook URL here for Discord notifications +# Get a webhook URL from your Discord server settings +DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-id-here/your-webhook-token-here diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e4087f --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Environment variables +.env +.env.local +.env.*.local + +# Logs and temporary files +*.log +*.txt + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# Screenshot directories +/tmp/mcscreens/ diff --git a/autocraft9x9.py b/autocraft9x9.py index 0319cdf..82132fd 100644 --- a/autocraft9x9.py +++ b/autocraft9x9.py @@ -2,13 +2,14 @@ import subprocess import time import pyautogui import requests +import os def log_and_print(message): print(message) # Add logging here if needed def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/autologin.py b/autologin.py index 81d0123..9e54d53 100644 --- a/autologin.py +++ b/autologin.py @@ -7,6 +7,7 @@ from PIL import ImageGrab from datetime import datetime, timedelta import time import random +import os # Define the paths to your screenshots back_to_server_image_path = '/home/alex/minecraft/screenshots/back_to_server.png' @@ -14,7 +15,7 @@ join_button_image_path = '/home/alex/minecraft/screenshots/join_button.png' log_file_path = '/home/alex/minecraft/autologin.log' # Set up the Discord webhook URL -webhook_url = 'https://discord.com/api/webhooks/your_webhook_url_here' +webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') def log(message, discord_notify=True): timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S') diff --git a/autologin_no_attack.py b/autologin_no_attack.py index eac478e..531e21a 100644 --- a/autologin_no_attack.py +++ b/autologin_no_attack.py @@ -15,7 +15,7 @@ temp_screenshot_directory = '/tmp/mcscreens' os.makedirs(temp_screenshot_directory, exist_ok=True) # Your Discord webhook URL -discord_webhook_url = 'https://discord.com/api/webhooks/1191486208895877150/-pxqBZs6RSUOBFFhPH8SwelQoaU5MEU9XX28fmp90EqNM0G98qkkZxsXfRxu7nN2Ze1X' +discord_webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') # Base64 encoded images for both buttons encoded_images = { diff --git a/raidfarm2.py b/raidfarm2.py index f75d021..f3b3723 100644 --- a/raidfarm2.py +++ b/raidfarm2.py @@ -9,7 +9,7 @@ import requests # Configuration temp_screenshot_directory = '/tmp/mcscreens' -discord_webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxx' +discord_webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') screenshot_interval = 3600 # seconds (1 hour) disconnect_check_interval = 10800 # seconds (3 hours) diff --git a/trader.py b/trader.py index 44a2169..dbf4efb 100644 --- a/trader.py +++ b/trader.py @@ -4,6 +4,7 @@ import time from PIL import Image, ImageGrab import logging from Xlib import display +import os # Setup logging logging.basicConfig(filename='minecraft_automation_log.txt', level=logging.INFO, format='%(asctime)s: %(message)s') @@ -13,7 +14,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/trader2.py b/trader2.py index 4f1a463..b70901c 100644 --- a/trader2.py +++ b/trader2.py @@ -3,6 +3,7 @@ import pyautogui import time from PIL import ImageGrab import logging +import os # Setup logging logging.basicConfig(filename='minecraft_automation_log.txt', level=logging.INFO, format='%(asctime)s: %(message)s') @@ -12,7 +13,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/trader_laptop.py b/trader_laptop.py index 65cf617..91cace0 100644 --- a/trader_laptop.py +++ b/trader_laptop.py @@ -3,6 +3,7 @@ import subprocess import time from PIL import Image, ImageGrab import logging +import os # Setup logging logging.basicConfig(filename='minecraft_automation_log.txt', level=logging.INFO, format='%(asctime)s: %(message)s') @@ -12,7 +13,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/trader_laptopv2.py b/trader_laptopv2.py index 12f658f..91cace0 100644 --- a/trader_laptopv2.py +++ b/trader_laptopv2.py @@ -3,6 +3,7 @@ import subprocess import time from PIL import Image, ImageGrab import logging +import os # Setup logging logging.basicConfig(filename='minecraft_automation_log.txt', level=logging.INFO, format='%(asctime)s: %(message)s') @@ -12,7 +13,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/trader_wayland.py b/trader_wayland.py index 7798c30..d330bb4 100644 --- a/trader_wayland.py +++ b/trader_wayland.py @@ -3,6 +3,7 @@ import subprocess import time from PIL import Image import logging +import os from wayland_screenshot import take_screenshot # This will be a custom function you need to implement # Setup logging @@ -13,7 +14,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'YOUR_DISCORD_WEBHOOK_URL' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/trader_win.py b/trader_win.py index 67fc588..f45475c 100644 --- a/trader_win.py +++ b/trader_win.py @@ -3,6 +3,7 @@ import pyautogui import time from PIL import ImageGrab import logging +import os # Setup logging logging.basicConfig(filename='minecraft_automation_log.txt', level=logging.INFO, format='%(asctime)s: %(message)s') @@ -12,7 +13,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}") diff --git a/traderv2.py b/traderv2.py index 9881d59..e678621 100644 --- a/traderv2.py +++ b/traderv2.py @@ -3,6 +3,7 @@ import subprocess import time from PIL import Image, ImageGrab import logging +import os print("") # Setup logging logging.basicConfig(filename='minecraft_automation_log.txt', level=logging.INFO, format='%(asctime)s: %(message)s') @@ -22,7 +23,7 @@ def log_and_print(message): logging.info(message) def post_to_discord(message): - webhook_url = 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' + webhook_url = os.environ.get('DISCORD_WEBHOOK_URL', '') data = {"content": message} response = requests.post(webhook_url, json=data) log_and_print(f"Posted to Discord: {message}")