Discuss Scratch

50_scratch_tabs
Scratcher
1000+ posts

desktop buddy

8to16 wrote:

50_scratch_tabs wrote:

(#18)
Just use a paint editor to add it to your desktop image.
i want a moving buddy
I know how to do it in Python but I don't have my PC right now.
King of page no edit
snoopythe3
Scratcher
500+ posts

desktop buddy

guys im kinda busy so dont expect me to respond instantly when you make a forum post ok
TheAutocorrectingCat
Scratcher
1000+ posts

desktop buddy

snoopythe3 wrote:

guys im kinda busy so dont expect me to respond instantly when you make a forum post ok
No experienced forumer expects anyone to respond instantly.
8to16
Scratcher
1000+ posts

desktop buddy

I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
glitcX
Scratcher
1000+ posts

desktop buddy

8to16 wrote:

I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
You should make it a project
bc i can't see it :P
scratchcode1_2_3
Scratcher
1000+ posts

desktop buddy

8to16 wrote:

(#24)
I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
WHAT THE HECK YOU BEAT ME TO IT I JUST MADE IT ON PYTHON WITH PyQt AND MADE IT WALK AROUND WITH MEOW.WAV I JUST COULDN'T GET THE TEXT TO WORK BECAUSE OF THE DUMB SELF.TEXT_LABEL NOT WORKING RAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
scratchcode1_2_3
Scratcher
1000+ posts

desktop buddy

glitcX wrote:

(#25)

8to16 wrote:

I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
You should make it a project
bc i can't see it :P
there is none yet, 8to16 said it will be shared later
8to16
Scratcher
1000+ posts

desktop buddy

scratchcode1_2_3 wrote:

(#26)

8to16 wrote:

(#24)
I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
WHAT THE HECK YOU BEAT ME TO IT I JUST MADE IT ON PYTHON WITH PyQt AND MADE IT WALK AROUND WITH MEOW.WAV I JUST COULDN'T GET THE TEXT TO WORK BECAUSE OF THE DUMB SELF.TEXT_LABEL NOT WORKING RAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
my mockup is more static tho, it can't walk because i don't know how to change images in tkinter

anyways mine has a context menu
will share image when i boot to linux (i don't have my cubeupload password saved on windows)
alpha_ape_13
Scratcher
500+ posts

desktop buddy

Very much unnecesary for the primary coding aspect. But this would be very cool! even though this will give me nightmares and scratch my computer at 3am

Last edited by alpha_ape_13 (Nov. 24, 2024 01:54:33)

DifferentDance8
Scratcher
1000+ posts

desktop buddy

Massive support! I love desktop buddies in general as it's such a cool concept for a program (I only actually used two of them - Desktop Crewmate and Desktop Goose - and I saw a video of PAICom but not prepared to spend 5 dollars for it but that's a discussion for another day and another part of the website that aren't the forums, as this is about a specific one being suggested).
this is probably my second most yappiest paragraph of all time, which goes to show how my autism is willing to write at length for stuff it's interested in to the detriment of the people reading this post.

The only problem is scope, A.K.A “what stuff is essential for a desktop buddy, which stuff isn't but is a neat feature to have and which stuff would be cool but just kinda weird?” Desktop buddies come in different shapes and sizes, from the relative uselessness of D-PET pets all the way to something like BonziBuddy which (despite being spyware) also acts as essentially a Siri before Siri was even a thing. So it's nice to have some kind of ground scale

Last edited by DifferentDance8 (Nov. 24, 2024 05:36:18)

WindowsAdmin
Scratcher
1000+ posts

desktop buddy

Like it's really just a useless thing, like it's cool and all, but if it just sits there, says “Scratch 3.0 was released in 2019” and draws on your screen i don't think the scratch team would put the time it takes to do this
DifferentDance8
Scratcher
1000+ posts

desktop buddy

WindowsAdmin wrote:

Like it's really just a useless thing, like it's cool and all, but if it just sits there, says “Scratch 3.0 was released in 2019” and draws on your screen i don't think the scratch team would put the time it takes to do this
It could also remind you of your latest notification
WindowsAdmin
Scratcher
1000+ posts

desktop buddy

DifferentDance8 wrote:

(#32)

WindowsAdmin wrote:

Like it's really just a useless thing, like it's cool and all, but if it just sits there, says “Scratch 3.0 was released in 2019” and draws on your screen i don't think the scratch team would put the time it takes to do this
It could also remind you of your latest notification
adding browser notifications would be way simpler
8to16
Scratcher
1000+ posts

desktop buddy

alright here's the mockup

it has a menu to go to the scratch homepage, or close the desktop buddy

will make an animated mockup when i can

Last edited by 8to16 (Nov. 25, 2024 11:59:46)

hydrofungus
Scratcher
1000+ posts

desktop buddy

eh i don’t use a computer but sounds okay enough

he needs to move around if he can
DifferentDance8
Scratcher
1000+ posts

desktop buddy

hydrofungus wrote:

he needs to move around if he can
And he will. The only desktop buddy I know which is stationary is PAICom which is really obscure anyway.
snoopythe3
Scratcher
500+ posts
Maximouse
Scratcher
1000+ posts

desktop buddy

This is an interesting idea, but I don't think there's a reason for this to be an official thing made by the Scratch Team. Since you already implemented it, why not publish the code somewhere and let others contribute to add the features you want?
8to16
Scratcher
1000+ posts

desktop buddy

Maximouse wrote:

(#38)
This is an interesting idea, but I don't think there's a reason for this to be an official thing made by the Scratch Team. Since you already implemented it, why not publish the code somewhere and let others contribute to add the features you want?
ok here.

buddy.py
import tkinter as tk
from PIL import Image, ImageTk
from pygame import mixer
import webbrowser
from time import sleep
# Meow sound
mixer.init()
meow = mixer.Sound("Meow.wav")
meow2 = mixer.Sound("Meow2.wav")
pop = mixer.Sound("pop.wav")
# Functions to handle dragging
def start_drag(event):
    global x_offset, y_offset
    x_offset = event.x
    y_offset = event.y
    meow2.play()
def drag_window(event):
    x = event.x_root - x_offset
    y = event.y_root - y_offset
    root.geometry(f"+{x}+{y}")
# Function to show speech bubble
def show_speech_bubble(text):
    speech_bubble = tk.Toplevel(root)
    speech_bubble.overrideredirect(True)
    speech_bubble.attributes('-topmost', True)
    
    label = tk.Label(speech_bubble, text=text, bg="white", fg="black", bd=2, padx=5, pady=5, relief="solid")
    label.pack()
    
    # Position the speech bubble
    bubble_x = root.winfo_x() + 50  # Adjust as needed
    bubble_y = root.winfo_y() - 50  # Adjust as needed
    speech_bubble.geometry(f"+{bubble_x}+{bubble_y}")
    # Play sound
    meow.play()
    
    # Auto-remove the speech bubble after a few seconds
    root.after(3000, speech_bubble.destroy)
# Create the main window
root = tk.Tk()
# Remove the title bar
root.overrideredirect(True)
# Make the window always on top
root.attributes('-topmost', True)
# transparency
root.wm_attributes("-transparentcolor", "darkgray")
# Load the image (replace 'buddy.png' with your image file)
image = Image.open("ScratchBuddy.png")
photo = ImageTk.PhotoImage(image)
# Create a label to hold the image
label = tk.Label(root, image=photo, bg='darkgray')
label.pack()
# Bind mouse events to the functions
label.bind("<Button-1>", start_drag)
label.bind("<B1-Motion>", drag_window)
# Schedule the speech bubble to show 2 seconds after startup
root.after(500, lambda: show_speech_bubble("Meow!"))
def scratch():
  webbrowser.open("https://scratch.mit.edu")
def bye():
  pop.play()
  root.destroy()
  sleep(0.3)
  exit()
m = tk.Menu(root, tearoff = 0) 
m.add_command(label ="Scratch Website", command=scratch) 
m.add_command(label ="Goodbye", command=bye) 
def do_popup(event): 
    try: 
        m.tk_popup(event.x_root, event.y_root) 
    finally: 
        m.grab_release() 
label.bind("<Button-3>", do_popup)
# Position the window (can be adjusted as needed)
root.geometry("+300+300")
# Run the application
root.mainloop()
assets: ScratchBuddy.png, Meow.wav, Meow2.wav, pop.wav
scratchcode1_2_3
Scratcher
1000+ posts

desktop buddy

8to16 wrote:

(#39)

Maximouse wrote:

(#38)
This is an interesting idea, but I don't think there's a reason for this to be an official thing made by the Scratch Team. Since you already implemented it, why not publish the code somewhere and let others contribute to add the features you want?
ok here.

buddy.py
import tkinter as tk
from PIL import Image, ImageTk
from pygame import mixer
import webbrowser
from time import sleep
# Meow sound
mixer.init()
meow = mixer.Sound("Meow.wav")
meow2 = mixer.Sound("Meow2.wav")
pop = mixer.Sound("pop.wav")
# Functions to handle dragging
def start_drag(event):
    global x_offset, y_offset
    x_offset = event.x
    y_offset = event.y
    meow2.play()
def drag_window(event):
    x = event.x_root - x_offset
    y = event.y_root - y_offset
    root.geometry(f"+{x}+{y}")
# Function to show speech bubble
def show_speech_bubble(text):
    speech_bubble = tk.Toplevel(root)
    speech_bubble.overrideredirect(True)
    speech_bubble.attributes('-topmost', True)
    
    label = tk.Label(speech_bubble, text=text, bg="white", fg="black", bd=2, padx=5, pady=5, relief="solid")
    label.pack()
    
    # Position the speech bubble
    bubble_x = root.winfo_x() + 50  # Adjust as needed
    bubble_y = root.winfo_y() - 50  # Adjust as needed
    speech_bubble.geometry(f"+{bubble_x}+{bubble_y}")
    # Play sound
    meow.play()
    
    # Auto-remove the speech bubble after a few seconds
    root.after(3000, speech_bubble.destroy)
# Create the main window
root = tk.Tk()
# Remove the title bar
root.overrideredirect(True)
# Make the window always on top
root.attributes('-topmost', True)
# transparency
root.wm_attributes("-transparentcolor", "darkgray")
# Load the image (replace 'buddy.png' with your image file)
image = Image.open("ScratchBuddy.png")
photo = ImageTk.PhotoImage(image)
# Create a label to hold the image
label = tk.Label(root, image=photo, bg='darkgray')
label.pack()
# Bind mouse events to the functions
label.bind("<Button-1>", start_drag)
label.bind("<B1-Motion>", drag_window)
# Schedule the speech bubble to show 2 seconds after startup
root.after(500, lambda: show_speech_bubble("Meow!"))
def scratch():
  webbrowser.open("https://scratch.mit.edu")
def bye():
  pop.play()
  root.destroy()
  sleep(0.3)
  exit()
m = tk.Menu(root, tearoff = 0) 
m.add_command(label ="Scratch Website", command=scratch) 
m.add_command(label ="Goodbye", command=bye) 
def do_popup(event): 
    try: 
        m.tk_popup(event.x_root, event.y_root) 
    finally: 
        m.grab_release() 
label.bind("<Button-3>", do_popup)
# Position the window (can be adjusted as needed)
root.geometry("+300+300")
# Run the application
root.mainloop()
assets: ScratchBuddy.png, Meow.wav, Meow2.wav, pop.wav
hey i made some too
import sys
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QApplication, QLabel
from playsound import playsound
import random
class DesktopBuddy(QLabel):
    def __init__(self):
        super().__init__()
        self.phrases = ["Hello!", "I'm Scratch Cat!", "MEOW", "Yay!"]
        self.pixmap = QPixmap("scratch_cat_walk1.png")
        self.setPixmap(self.pixmap)
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setFixedSize(self.pixmap.size())
        self.show()
        self.timer = QTimer(self)
        self.timer.timeout.connect(self.move_buddy)
        self.timer.start(100)
        self.dx, self.dy = 5, 0
        self.speech_timer = QTimer(self)
        self.speech_timer.timeout.connect(self.say_something)
        self.speech_timer.start(10000)
            
        
    def say_something(self):
        try:
 
            if hasattr(self, 'text_label') and self.text_label.isVisible():
                self.text_label.hide()
            random_phrase = random.choice(self.phrases)
            self.text_label = QLabel(random_phrase, self)
            self.text_label.setAlignment(Qt.AlignCenter)
            self.text_label.setStyleSheet("""
            background-color: rgba(0, 0, 0, 200); 
            color: white; 
            font-size: 90px; 
            padding: 5px;
            border-radius: 5px;
            """)
            self.text_label.adjustSize()  
            geometry = self.geometry()
            self.text_label.move(geometry.center().x() - self.text_label.width() // 2, geometry.top() - self.text_label.height() - 10)
            self.text_label.show()  
            print(f"Text: {random_phrase}, Position: ({geometry.center().x() - self.text_label.width() // 2}, {geometry.top() - self.text_label.height() - 10})")
            QTimer.singleShot(3000, self.text_label.hide)
            playsound("Meow.wav")
        
        except Exception as e:
            print(f"Error in say_something: {e}")
             
    def move_buddy(self):
        x, y = self.x(), self.y()
        self.move(x + self.dx, y + self.dy)
        if x <= 0 or x + self.width() >= QApplication.primaryScreen().size().width():
            self.dx *= -1
        if y <= 0 or y + self.height() >= QApplication.primaryScreen().size().height():
            self.dy *= -1
    def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            self.drag_pos = event.globalPos()
    def mouseMoveEvent(self, event):
        if event.buttons() == Qt.LeftButton:
            self.move(self.pos() + event.globalPos() - self.drag_pos)
            self.drag_pos = event.globalPos()
app = QApplication(sys.argv)
buddy = DesktopBuddy()
sys.exit(app.exec_())

Powered by DjangoBB