import tkinter as tk
import urllib.request
import io
import sys
import threading
import winsound
import ctypes
from PIL import Image, ImageTk
# Ссылка на жуткое лицо оригинальной MrsMajor
IMAGE_URL = "https://ytimg.com"
# Ссылка на страшный аудиофайл (формат .wav)
AUDIO_URL = "https://google.com" # Заменится на автоматический доступ к wav через winsound
def set_max_volume():
"""Выкручивает громкость Windows на 100%"""
try:
WM_APPCOMMAND = 0x0319
APPCOMMAND_VOLUME_UP = 0xA0000
hwnd = ctypes.windll.user32.GetForegroundWindow()
for _ in range(50):
ctypes.windll.user32.SendMessageW(hwnd, WM_APPCOMMAND, 0, APPCOMMAND_VOLUME_UP)
except Exception:
pass
def play_real_screamer_sound():
"""Проигрывает настоящий страшный звук из системы по кругу"""
set_max_volume()
while True:
try:
# Используем встроенный в Windows жуткий звук критического системного сбоя на полной громкости
winsound.PlaySound("SystemHand", winsound.SND_ALIAS | winsound.SND_LOOP)
except Exception:
# Альтернативный вариант, если первый заблокирован
winsound.Beep(3500, 150)
winsound.Beep(1200, 150)
def flash_screen():
"""Бешеное мерцание экрана без пауз и таймеров"""
try:
current_bg = label.cget("bg")
if current_bg == "black":
label.config(image="", bg="red", text="SYSTEM DESTROYED\n\nYOU CANNOT RUN", fg="black", font=("Courier", 55, "bold"))
else:
label.config(image=bg_image, bg="black", text="")
except Exception:
pass
root.after(80, flash_screen) # Мерцание стало ещё быстрее для паники
def hard_exit(event):
"""Секретный выход по нажатию клавиши Esc"""
root.destroy()
sys.exit()
# Создаем полноэкранное окно шутки
root = tk.Tk()
root.title("MrsMajor Real Screamer")
root.attributes('-fullscreen', True)
root.attributes('-topmost', True)
root.config(cursor="none") # Прячем мышку
# Кнопка для экстренного выхода
root.bind("<Escape>", hard_exit)
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
try:
# Загружаем лицо Миссис Мажор
with urllib.request.urlopen(IMAGE_URL, timeout=5) as url:
image_data = url.read()
original_img = Image.open(io.BytesIO(image_data))
original_img = original_img.resize((screen_width, screen_height), Image.Resampling.LANCZOS)
bg_image = ImageTk.PhotoImage(original_img)
label = tk.Label(root, image=bg_image, bg="black")
label.pack(fill="both", expand=True)
except Exception:
label = tk.Label(root, text="SYSTEM DESTROYED", fg="red", bg="black", font=("Courier", 60, "bold"))
label.pack(fill="both", expand=True)
# Запуск звукового хоррор-потока
sound_thread = threading.Thread(target=play_real_screamer_sound, daemon=True)
sound_thread.start()
# Мгновенный старт безумного мерцания
flash_screen()
root.mainloop()