import urllib.request, time

print("Waiting 3 seconds for UI to render...")
time.sleep(3)

name = 'gravity_control'
h = 0
for c in name:
    h = ((h << 5) - h + ord(c)) & 0xFFFFFFFF
    if h > 0x7FFFFFFF: h -= 0x100000000
port = 10000 + (abs(h) % 50000)

print(f"Triggering deep-inspect on port {port}...")
try:
    urllib.request.urlopen(urllib.request.Request(f'http://127.0.0.1:{port}/deep-inspect'), timeout=12)
    print("Trigger signal sent successfully")
except Exception as e:
    print("Trigger failed:", e)
