A-3-i
Compared to A-2 and before: Put everything in a try/except loop Added Toggle WiFi Changed menu selection keys Simplified menu items
This commit is contained in:
123
tificut-a-3-i.py
Normal file
123
tificut-a-3-i.py
Normal file
@@ -0,0 +1,123 @@
|
||||
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:
|
||||
try:
|
||||
print("=" * 80)
|
||||
print("TiFiCut WDS (WiFi Disconnection System) A-3-i")
|
||||
print("-" * 80)
|
||||
print("Choose a duration to cut wifi:")
|
||||
print("[1] Optimal 10 Seconds (note 1)")
|
||||
print("[2] N Seconds")
|
||||
print("[3] N Minutes")
|
||||
print("[4] N Hours (note 2)")
|
||||
print("[5] N Days (note 2)")
|
||||
print("[6] Fake Lag")
|
||||
print("[7] Toggle WiFi")
|
||||
print("")
|
||||
print("[h] Help (w/Notes)")
|
||||
print("[d] Toggle Diagnostics")
|
||||
print("[x] 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.")
|
||||
try:
|
||||
while True:
|
||||
time.sleep(random.randint(3, 12))
|
||||
cut_wifi(random.randint(3, 12))
|
||||
except KeyboardInterrupt:
|
||||
print("User stopped. Reconnecting...")
|
||||
try:
|
||||
subprocess.run(
|
||||
f"netsh wlan connect ssid=\"{wifi}\" name=\"{wifi}\"",
|
||||
check=True,
|
||||
creationflags=flags
|
||||
)
|
||||
print("Success.")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
pass
|
||||
elif second_choice == "7":
|
||||
print("Press Ctrl+C to stop.")
|
||||
try:
|
||||
while True:
|
||||
subprocess.run(
|
||||
"netsh wlan disconnect interface=\"Wi-Fi\"",
|
||||
check=True,
|
||||
creationflags=flags
|
||||
)
|
||||
except:
|
||||
print("User has stopped. Reconnecting...")
|
||||
try:
|
||||
subprocess.run(
|
||||
f"netsh wlan connect ssid=\"{wifi}\" name=\"{wifi}\"",
|
||||
check=True,
|
||||
creationflags=flags
|
||||
)
|
||||
print("Success.")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
else:
|
||||
print("Error: option passed isdigit() criteria but did not get selected")
|
||||
elif second_choice.isalpha():
|
||||
if second_choice.lower() == "h":
|
||||
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() == "d":
|
||||
print("Attempting to cut WiFi for 1 second...")
|
||||
try:
|
||||
cut_wifi(1)
|
||||
print("Success!")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
elif second_choice.lower() == "x":
|
||||
sys.exit(0)
|
||||
else:
|
||||
print("Error: option passed isalpha() criteria but did not get selected")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user