HadiTheBadie

1600+ Cheap Robux in stock

Robux

Robux 200-250

Price: £3

Brainrots

Los Combination

Price: £9

La Grande Combination

Price: £7

Brainrots 100m–500m Available

Price:

Fun

Pen Watergun

Pen that can shoot water with pressure

Price: £3.99

Website

Your Website

Your own customized website

Price: £20

Roblox Game

Your Roblox Game

Fully customized

Price: £10

Others

99 Nights in Forest

Price: £2.99

Steal a Brainrot

Sab Private Server

Price: £1.20/month

Grow a Garden Pets

Price: £2

Paste Your Text Below

# ================================================================ # PART A — IMPORTS, GLOBALS, SIMPLE STORAGE (FIXED) # ================================================================ import socket import pickle import tkinter as tk from tkinter import filedialog, messagebox import os from PIL import Image, ImageTk # ---------------------------- # Basic UI colors # ---------------------------- BG = "#111111" TXT = "white" BTN = "#222222" BTN_HOVER = "#4444aa" # ---------------------------- # In-memory chat history # ---------------------------- chat_history = [] # ---------------------------- # Data folders # ---------------------------- os.makedirs("feed", exist_ok=True) os.makedirs("pfp", exist_ok=True) # ---------------------------- # USER DATABASE FIX (IMPORTANT) # ---------------------------- USER_DB_FILE = "users.pkl" # Try loading saved users try: with open(USER_DB_FILE, "rb") as f: user_db = pickle.load(f) # If corrupted, replace if not isinstance(user_db, dict): user_db = {} except: user_db = {} # Start fresh if file missing or unreadable def save_users(): with open(USER_DB_FILE, "wb") as f: pickle.dump(user_db, f) # ---------------------------- # Networking (LAN) # ---------------------------- PORT = 5050 def get_local_ip(): """Returns LAN WiFi IP.""" s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: s.connect(("8.8.8.8", 80)) ip = s.getsockname()[0] except: ip = "127.0.0.1" finally: s.close() return ip LOCAL_IP = get_local_ip() IS_SERVER = False server_socket = None client_socket = None clients = [] # connected clients (server only) # ================================================================ # PART B — NON-BLOCKING LAN SERVER (NO THREADS) # ================================================================ def start_server(): """Start server if no one else is using the port.""" global server_socket, IS_SERVER server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.setblocking(False) try: server_socket.bind((LOCAL_IP, PORT)) server_socket.listen(5) IS_SERVER = True print(f"[SERVER] Running at {LOCAL_IP}:{PORT}") except: print("[SERVER] Another device is already the server.") server_socket = None IS_SERVER = False def server_check_messages(root): """Accept clients + receive messages using non-blocking mode.""" global clients, chat_history if IS_SERVER: # -------------------------- # Accept new clients # -------------------------- try: conn, addr = server_socket.accept() conn.setblocking(False) clients.append(conn) print("[SERVER] Client joined:", addr) except BlockingIOError: pass # -------------------------- # Receive messages # -------------------------- dead = [] for conn in clients: try: data = conn.recv(4096) if data: msg = pickle.loads(data) chat_history.append(msg) update_chat_windows(msg) # broadcast to all clients for c in clients: if c != conn: try: c.sendall(pickle.dumps(msg)) except: dead.append(c) except BlockingIOError: pass except: dead.append(conn) # Remove dead sockets for c in dead: if c in clients: clients.remove(c) # schedule again root.after(100, lambda: server_check_messages(root)) # ================================================================ # PART C — NON-BLOCKING LAN CLIENT # ================================================================ def connect_to_server(): """Try connecting to server (another device).""" global client_socket, IS_SERVER if IS_SERVER: print("[CLIENT] This device IS the server.") return client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.setblocking(False) try: client_socket.connect((LOCAL_IP, PORT)) except BlockingIOError: pass except: print("[CLIENT] No server found.") client_socket = None return print("[CLIENT] Connected to server!") def client_check_messages(root): """Receive server messages without blocking.""" global client_socket, chat_history if client_socket is not None: try: data = client_socket.recv(4096) if data: msg = pickle.loads(data) chat_history.append(msg) update_chat_windows(msg) except BlockingIOError: pass except: client_socket = None root.after(100, lambda: client_check_messages(root)) # ================================================================ # PART D — LOGIN + REGISTER (NO SEPARATE REGISTER WINDOW) # ================================================================ CURRENT_USER = None USER_DB_FILE = "users.pkl" # Load or create user database try: with open(USER_DB_FILE, "rb") as f: user_db = pickle.load(f) except: user_db = {} # empty database def save_users(): with open(USER_DB_FILE, "wb") as f: pickle.dump(user_db, f) def open_login_window(root): login = tk.Toplevel(root) login.title("Login / Register") login.geometry("420x330") login.configure(bg=BG) login.resizable(False, False) tk.Label( login, text="Login / Register", fg="white", bg=BG, font=("Segoe UI", 26, "bold") ).pack(pady=15) # Username tk.Label( login, text="Username:", fg="white", bg=BG, font=("Segoe UI", 14) ).pack() user_entry = tk.Entry(login, font=("Segoe UI", 14)) user_entry.pack(pady=5) # Password tk.Label( login, text="Password:", fg="white", bg=BG, font=("Segoe UI", 14) ).pack() pass_entry = tk.Entry(login, font=("Segoe UI", 14), show="*") pass_entry.pack(pady=5) # ---------------------------- # LOGIN FUNCTION # ---------------------------- def do_login(): global CURRENT_USER username = user_entry.get().strip() password = pass_entry.get().strip() if username not in user_db: messagebox.showerror("Login Failed", "Account does not exist!") return if user_db[username] != password: messagebox.showerror("Login Failed", "Incorrect password.") return CURRENT_USER = username login.destroy() open_dashboard(root) # ---------------------------- # REGISTER FUNCTION # ---------------------------- def do_register(): username = user_entry.get().strip() password = pass_entry.get().strip() if not username or not password: messagebox.showerror("Error", "Enter username and password.") return if username in user_db: messagebox.showerror("Register Failed", "Username already exists!") return # Create new account user_db[username] = password save_users() messagebox.showinfo("Success", "Account created! Now login.") # ---------------------------- # Buttons # ---------------------------- tk.Button( login, text="Login", bg=BTN, fg="white", activebackground=BTN_HOVER, width=14, height=2, command=do_login ).pack(pady=10) tk.Button( login, text="Register", bg=BTN, fg="white", activebackground=BTN_HOVER, width=14, height=2, command=do_register ).pack() # ================================================================ # PART E — DASHBOARD (ALL BUTTONS RESTORED) # ================================================================ def open_dashboard(root): dash = tk.Toplevel(root) dash.title("Dashboard") dash.geometry("950x550") dash.configure(bg=BG) dash.resizable(True, True) tk.Label( dash, text=f"Welcome, {CURRENT_USER}", fg="white", bg=BG, font=("Segoe UI", 28, "bold") ).pack(pady=25) container = tk.Frame(dash, bg=BG) container.pack() left = tk.Frame(container, bg=BG) right = tk.Frame(container, bg=BG) left.grid(row=0, column=0, padx=60) right.grid(row=0, column=1, padx=60) # LEFT BUTTONS tk.Button(left, text="Global Chat", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=lambda: open_chat_window(dash)).pack(pady=6) tk.Button(left, text="Open Feed", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=open_feed_window).pack(pady=6) tk.Button(left, text="Upload Media", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=open_upload_window).pack(pady=6) tk.Button(left, text="Snake Game", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=open_snake_game).pack(pady=6) # RIGHT BUTTONS tk.Button(right, text="Change Profile Picture", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=open_pfp_window).pack(pady=6) tk.Button(right, text="Minecraft Website", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=lambda: os.system("start https://example.com")).pack(pady=6) tk.Button(right, text="Credits (Made by Hadi)", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=lambda: messagebox.showinfo("Credits", "Made by Hadi ❤️")).pack(pady=6) tk.Button(right, text="Logout", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=lambda: (dash.destroy(), open_login_window(root))).pack(pady=6) tk.Button(right, text="Exit Program", width=22, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=root.destroy).pack(pady=6) # ================================================================ # PART F — CHAT WINDOW (REAL-TIME, NO THREADS) # ================================================================ open_chat_windows = [] # stores all open text widgets def update_chat_windows(msg): """Update EVERY chat window instantly when new message arrives.""" for log in open_chat_windows: log.config(state="normal") log.insert("end", f"{msg['user']}: {msg['text']}\n") log.config(state="disabled") log.see("end") def open_chat_window(root): chat_win = tk.Toplevel(root) chat_win.title("Global Chat") chat_win.geometry("650x550") chat_win.configure(bg=BG) chat_win.resizable(True, True) tk.Label( chat_win, text="Global Chat", fg="white", bg=BG, font=("Segoe UI", 22, "bold") ).pack(pady=10) # SCROLLABLE CHAT LOG frame = tk.Frame(chat_win, bg=BG) frame.pack(fill="both", expand=True, padx=10, pady=10) scrollbar = tk.Scrollbar(frame) scrollbar.pack(side="right", fill="y") log = tk.Text( frame, bg="#000000", fg="white", font=("Segoe UI", 12), wrap="word", state="disabled", yscrollcommand=scrollbar.set ) log.pack(side="left", fill="both", expand=True) scrollbar.config(command=log.yview) open_chat_windows.append(log) # LOAD HISTORY log.config(state="normal") for msg in chat_history: log.insert("end", f"{msg['user']}: {msg['text']}\n") log.config(state="disabled") log.see("end") entry = tk.Entry( chat_win, font=("Segoe UI", 14), bg="#222", fg="white", relief="flat", insertbackground="white" ) entry.pack(fill="x", padx=10, pady=10) def send_msg(event=None): text = entry.get().strip() if not text: return msg = {"user": CURRENT_USER, "text": text} chat_history.append(msg) update_chat_windows(msg) # Client → send to server if client_socket: try: client_socket.sendall(pickle.dumps(msg)) except: pass # Server → broadcast if IS_SERVER: for c in clients: try: c.sendall(pickle.dumps(msg)) except: pass entry.delete(0, tk.END) entry.bind("", send_msg) tk.Button( chat_win, text="Send", bg=BTN, fg="white", width=12, activebackground=BTN_HOVER, command=send_msg ).pack(pady=5) # ================================================================ # PART G — FEED VIEWER # ================================================================ def open_feed_window(): win = tk.Toplevel() win.title("Image / Video Feed") win.geometry("650x600") win.configure(bg=BG) win.resizable(True, True) tk.Label( win, text="Feed", fg="white", bg=BG, font=("Segoe UI", 22, "bold") ).pack(pady=10) frame = tk.Frame(win, bg=BG) frame.pack(fill="both", expand=True) canvas = tk.Canvas(frame, bg=BG, highlightthickness=0) canvas.pack(side="left", fill="both", expand=True) scrollbar = tk.Scrollbar(frame, command=canvas.yview) scrollbar.pack(side="right", fill="y") canvas.configure(yscrollcommand=scrollbar.set) inner = tk.Frame(canvas, bg=BG) canvas.create_window((0, 0), window=inner, anchor="nw") # LOAD FEED FILES for file in os.listdir("feed"): path = os.path.join("feed", file) tk.Label(inner, text=file, fg="white", bg=BG, font=("Segoe UI", 12, "bold")).pack(pady=5) if file.lower().endswith((".png", ".jpg", ".jpeg", ".gif")): img = Image.open(path) img.thumbnail((400, 400)) photo = ImageTk.PhotoImage(img) lbl = tk.Label(inner, image=photo, bg=BG) lbl.image = photo lbl.pack(pady=10) elif file.lower().endswith((".mp4", ".mov", ".avi")): tk.Label(inner, text="[Video File]", fg="cyan", bg=BG).pack(pady=10) inner.update_idletasks() canvas.configure(scrollregion=canvas.bbox("all")) # ================================================================ # PART H — UPLOAD MEDIA (Feed Upload) # ================================================================ def open_upload_window(): win = tk.Toplevel() win.title("Upload Media") win.geometry("400x250") win.configure(bg=BG) win.resizable(False, False) tk.Label( win, text="Upload Image / Video", fg="white", bg=BG, font=("Segoe UI", 20, "bold") ).pack(pady=20) def do_upload(): file = filedialog.askopenfilename( filetypes=[ ("Media Files", "*.jpg;*.png;*.jpeg;*.gif;*.mp4;*.mov;*.avi"), ("All Files", "*.*") ] ) if not file: return # copy file into "feed/" folder filename = os.path.basename(file) dest = os.path.join("feed", filename) with open(file, "rb") as src: with open(dest, "wb") as dst: dst.write(src.read()) messagebox.showinfo("Success", "Media uploaded!") win.destroy() tk.Button( win, text="Select File", bg=BTN, fg="white", width=18, height=2, activebackground=BTN_HOVER, command=do_upload ).pack(pady=30) # ================================================================ # PART I — CHANGE PROFILE PICTURE # ================================================================ def open_pfp_window(): win = tk.Toplevel() win.title("Change Profile Picture") win.geometry("400x260") win.configure(bg=BG) win.resizable(False, False) tk.Label( win, text="Change Profile Picture", fg="white", bg=BG, font=("Segoe UI", 20, "bold") ).pack(pady=20) def choose_pfp(): file = filedialog.askopenfilename( filetypes=[ ("Image Files", "*.jpg;*.png;*.jpeg;*.gif"), ("All Files", "*.*") ] ) if not file: return dest_path = os.path.join("pfp", f"{CURRENT_USER}.png") # Save image as PNG img = Image.open(file) img.save(dest_path) messagebox.showinfo("Success", "Profile picture updated!") win.destroy() tk.Button( win, text="Choose File", width=18, height=2, bg=BTN, fg="white", activebackground=BTN_HOVER, command=choose_pfp ).pack(pady=30) # ================================================================ # PART J — SNAKE GAME # ================================================================ def open_snake_game(): game = tk.Toplevel() game.title("Snake Game") game.geometry("520x560") game.configure(bg=BG) game.resizable(False, False) W, H = 500, 500 SIZE = 20 tk.Label( game, text="Snake Game", fg="white", bg=BG, font=("Segoe UI", 22, "bold") ).pack(pady=10) canvas = tk.Canvas(game, width=W, height=H, bg="black", highlightthickness=0) canvas.pack() snake = [(100, 100), (80, 100), (60, 100)] direction = "RIGHT" import random def spawn_food(): return ( random.randint(0, (W // SIZE) - 1) * SIZE, random.randint(0, (H // SIZE) - 1) * SIZE ) food = spawn_food() score = 0 def draw(): canvas.delete("all") for x, y in snake: canvas.create_rectangle(x, y, x + SIZE, y + SIZE, fill="lime") fx, fy = food canvas.create_oval(fx, fy, fx + SIZE, fy + SIZE, fill="red") canvas.create_text(10, 10, anchor="nw", fill="white", font=("Segoe UI", 14), text=f"Score: {score}") def tick(): nonlocal food, score, direction x, y = snake[0] if direction == "UP": y -= SIZE elif direction == "DOWN": y += SIZE elif direction == "LEFT": x -= SIZE elif direction == "RIGHT": x += SIZE new_head = (x, y) # Wall / Self collision if x < 0 or x >= W or y < 0 or y >= H or new_head in snake: messagebox.showinfo("Game Over", f"Final Score: {score}") game.destroy() return snake.insert(0, new_head) # Food collision if new_head == food: score += 1 food = spawn_food() else: snake.pop() draw() game.after(100, tick) def key(event): nonlocal direction k = event.keysym.upper() if k in ("W", "UP") and direction != "DOWN": direction = "UP" elif k in ("S", "DOWN") and direction != "UP": direction = "DOWN" elif k in ("A", "LEFT") and direction != "RIGHT": direction = "LEFT" elif k in ("D", "RIGHT") and direction != "LEFT": direction = "RIGHT" game.bind("", key) draw() tick() # ================================================================ # PART K — STARTUP SEQUENCE # ================================================================ def main_startup(): root = tk.Tk() root.withdraw() # Hide base window # Start server if possible start_server() # Connect as client if not server connect_to_server() # Start non-blocking loops server_check_messages(root) client_check_messages(root) # Open Login Screen open_login_window(root) root.mainloop() if __name__ == "__main__": main_startup()

If you want to buy this product, contact us on Discord: Mazm3n