From 017b2b6d3d8924925b7aa493fcc0566511c0d4fb Mon Sep 17 00:00:00 2001 From: Alby <100009818+alby-shinoj@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:04:47 +0530 Subject: [PATCH 1/3] Create code.py --- adv-mouse mover/code.py | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 adv-mouse mover/code.py diff --git a/adv-mouse mover/code.py b/adv-mouse mover/code.py new file mode 100644 index 0000000..b755756 --- /dev/null +++ b/adv-mouse mover/code.py @@ -0,0 +1,43 @@ +import win32api +import win32con +import time +import random +import threading +import logging + +# Set up logging +logging.basicConfig(filename='click_log.txt', level=logging.INFO, format='%(asctime)s - %(message)s') + +def click(x, y): + win32api.SetCursorPos((x, y)) + win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0) + win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0) + logging.info(f'Clicked at: ({x}, {y})') + +def clicker(click_count, x_min, x_max, y_min, y_max, interval): + for _ in range(click_count): + x = random.randint(x_min, x_max) + y = random.randint(y_min, y_max) + click(x, y) + time.sleep(interval) + +def main(): + # User-defined settings + click_count = 10 # Number of clicks + x_min, x_max = 0, 1920 # Screen width range (example for 1920x1080) + y_min, y_max = 0, 1080 # Screen height range (example for 1920x1080) + interval = 2 # Time in seconds between clicks + + print("Clicking will start...") + click_thread = threading.Thread(target=clicker, args=(click_count, x_min, x_max, y_min, y_max, interval)) + click_thread.start() + + try: + while click_thread.is_alive(): + time.sleep(1) # Keep the main thread alive while clicks are happening + except KeyboardInterrupt: + print("Clicking stopped by user.") + # Optionally, you could set a flag here to stop the clicker thread gracefully. + +if __name__ == "__main__": + main() From 9324f9416305719328580d2dc907614ebd4946b7 Mon Sep 17 00:00:00 2001 From: Alby <100009818+alby-shinoj@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:06:16 +0530 Subject: [PATCH 2/3] Create info.txt --- adv-mouse mover/info.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 adv-mouse mover/info.txt diff --git a/adv-mouse mover/info.txt b/adv-mouse mover/info.txt new file mode 100644 index 0000000..6d84963 --- /dev/null +++ b/adv-mouse mover/info.txt @@ -0,0 +1,5 @@ +Key Features in the Enhanced Code: +Logging: Each click is logged to a file named click_log.txt, which records the coordinates of each click along with the timestamp. +Configurable Parameters: The number of clicks, clicking area, and interval between clicks can be easily configured at the beginning of the main() function. +Threading: The clicking process runs in a separate thread, allowing the main thread to remain responsive. This also makes it easier to implement a graceful exit. +Keyboard Interrupt Handling: You can stop the clicking process by pressing Ctrl+C in the terminal. From 11fcf169aa630d4a231f2e1e6cc7e032a1d86f55 Mon Sep 17 00:00:00 2001 From: Alby <100009818+alby-shinoj@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:10:55 +0530 Subject: [PATCH 3/3] Create code.py --- ip-Ge0/code.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 ip-Ge0/code.py diff --git a/ip-Ge0/code.py b/ip-Ge0/code.py new file mode 100644 index 0000000..a101513 --- /dev/null +++ b/ip-Ge0/code.py @@ -0,0 +1,55 @@ +import requests +import csv +import sys + +URL = "http://ip-api.com/json/" + +def locate_ip(ip): + try: + response = requests.get(URL + ip, headers={"User -Agent": "GeoLocator/1.0"}) + response.raise_for_status() # Raise an error for bad responses + data = response.json() + + if data["status"] == "success": + return { + "IP": ip, + "Country": data["country"], + "Region": data["regionName"], + "City": data["city"], + "ZIP": data["zip"], + "Latitude": data["lat"], + "Longitude": data["lon"], + "Timezone": data["timezone"], + "ISP": data["isp"], + } + else: + return {"IP": ip, "Error": "Unable to locate IP address."} + + except requests.RequestException as e: + return {"IP": ip, "Error": str(e)} + +def save_to_csv(results, filename='ip_geolocation_results.csv'): + keys = results[0].keys() + with open(filename, 'w', newline='') as output_file: + dict_writer = csv.DictWriter(output_file, fieldnames=keys) + dict_writer.writeheader() + dict_writer.writerows(results) + +def main(ip_addresses): + results = [] + for ip in ip_addresses: + result = locate_ip(ip) + results.append(result) + print(result) + + # Save results to CSV + save_to_csv(results) + +if __name__ == "__main__": + if len(sys.argv) > 1: + ip_addresses = sys.argv[1:] # Get IP addresses from command-line arguments + else: + ip_input = input("Enter IP Addresses to Geolocate (comma-separated): ") + ip_addresses = [ip.strip() for ip in ip_input.split(",")] + + main(ip_addresses)