87 lines
3.2 KiB
Python
87 lines
3.2 KiB
Python
import subprocess
|
|
import time
|
|
import sys
|
|
import random
|
|
|
|
flags = subprocess.CREATE_NO_WINDOW
|
|
# wifi = "Verizon_3B6SGV"
|
|
wifi = "NHRHS_WiFi"
|
|
|
|
def cut_wifi(seconds):
|
|
print("Cutting WiFi for " + str(seconds) + " seconds...", end = " ")
|
|
start_time = time.time()
|
|
end_time = start_time + seconds
|
|
while time.time() < end_time:
|
|
subprocess.run(
|
|
"netsh wlan disconnect interface=\"Wi-Fi\"",
|
|
check=True,
|
|
creationflags=flags
|
|
)
|
|
print("Cut duration ended.")
|
|
print("Reconnecting WiFi...", end = " ")
|
|
subprocess.run(
|
|
f"netsh wlan connect ssid=\"{wifi}\" name=\"{wifi}\"",
|
|
check=True,
|
|
creationflags=flags
|
|
)
|
|
print("Success.")
|
|
|
|
def main():
|
|
while True:
|
|
print("=" * 80)
|
|
print("TiFiCut WDS (WiFi Disconnection System) A-1")
|
|
print("-" * 80)
|
|
print("Choose a duration to cut wifi:")
|
|
print("[1] Optimal 10 seconds (note 1)")
|
|
print("[2] Specify seconds")
|
|
print("[3] Specify minutes")
|
|
print("[4] Specify hours (note 2)")
|
|
print("[5] Specify days (note 2)")
|
|
print("[6] Fake laggy mode\n")
|
|
print("[x] Help (w/notes)")
|
|
print("[y] Toggle diagnostics")
|
|
print("[c] Exit")
|
|
second_choice = input("Duration > ")
|
|
if second_choice.isdigit():
|
|
if second_choice == "1":
|
|
cut_wifi(10)
|
|
elif second_choice == "2":
|
|
specify_seconds = int(input("Specify seconds > "))
|
|
cut_wifi(specify_seconds)
|
|
elif second_choice == "3":
|
|
specify_minutes = int(input("Specify minutes > "))
|
|
cut_wifi(specify_minutes * 60)
|
|
elif second_choice == "4":
|
|
specify_hours = int(input("Specify hours > "))
|
|
cut_wifi(specify_hours * 3600)
|
|
elif second_choice == "5":
|
|
specify_days = int(input("Specify days > "))
|
|
cut_wifi(specify_days * 86400)
|
|
elif second_choice == "6":
|
|
print("Press Ctrl+C to stop. (Do not spam.)")
|
|
try:
|
|
while True:
|
|
time.sleep(random.randint(3, 12))
|
|
cut_wifi(random.randint(3, 12))
|
|
except KeyboardInterrupt:
|
|
print("User stopped.")
|
|
pass
|
|
else:
|
|
print("Error: option passed isdigit() criteria but did not get selected")
|
|
elif second_choice.isalpha():
|
|
if second_choice.lower() == "x":
|
|
print(" - Note 1: This is the most effective way to take a short break without displaying offline on the Senso screen.")
|
|
print(" - Note 2: WAIT this is so long HOW DID YOU WHAT WHEN WHERE WHY WHA- HUH- UH WHAT HUH AAH")
|
|
elif second_choice.lower() == "y":
|
|
try:
|
|
cut_wifi(1)
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|
|
elif second_choice.lower() == "c":
|
|
sys.exit(0)
|
|
else:
|
|
print("Error: option passed isalpha() criteria but did not get selected")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|