Discuss Scratch

programORdie
Scratcher
28 posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
programORdie
Scratcher
28 posts

scratchattach - A Scratch API wrapper (Python)

ronsinda wrote:

Hey, does anyone know how you can get image data, like profile pictures, into numerical data so scratchattach can send it? Can't find someone's source code for pfp lookup projects so I have no idea how that works.
You should use the openCV library or PIL+numpy.
ScratchTheCoder12345
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

programORdie wrote:

ronsinda wrote:

Hey, does anyone know how you can get image data, like profile pictures, into numerical data so scratchattach can send it? Can't find someone's source code for pfp lookup projects so I have no idea how that works.
You should use the openCV library or PIL+numpy.
I've done it before, check out my project https://scratch.mit.edu/projects/877729608/ I could supply the backend code for it, I used Pillow to get the RGBA values of the PFP and send them back.
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
ScratchTheCoder12345
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
Hey, could you send your Python code?
programORdie
Scratcher
28 posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
No, thats all
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
Hey, could you send your Python code?

resolved

Last edited by CodingAnomaly (Aug. 4, 2023 15:55:28)

CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

never mind, i've found the issue! sorry!
ScratchTheCoder12345
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
Hey, could you send your Python code?

Here it is:

import os
my_secret = os.environ

import scratchattach as scratch3

session = scratch3.Session(my_secret, username=“CodingAnomaly”)

conn = session.connect_cloud(“879988737”) #replace with your project id

client = scratch3.CloudRequests(conn)

@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project

@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()

@client.event
def on_ready():
print(“Request handler is running”)

client.run()
Share your Scratch project so we can see if you have any issues there.

Last edited by ScratchTheCoder12345 (Aug. 4, 2023 15:49:50)

programORdie
Scratcher
28 posts

scratchattach - A Scratch API wrapper (Python)

deleted

Last edited by programORdie (Aug. 4, 2023 15:50:48)

programORdie
Scratcher
28 posts

scratchattach - A Scratch API wrapper (Python)

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
Hey, could you send your Python code?

Here it is:

import os
my_secret = os.environ

import scratchattach as scratch3

session = scratch3.Session(my_secret, username=“CodingAnomaly”)

conn = session.connect_cloud(“879988737”) #replace with your project id

client = scratch3.CloudRequests(conn)

@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project

@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()

@client.event
def on_ready():
print(“Request handler is running”)

client.run()
Share your Scratch project so we can see if you have any issues there.
i think the problem is not cloud cloud vars
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
Hey, could you send your Python code?

Here it is:

import os
my_secret = os.environ

import scratchattach as scratch3

session = scratch3.Session(my_secret, username=“CodingAnomaly”)

conn = session.connect_cloud(“879988737”) #replace with your project id

client = scratch3.CloudRequests(conn)

@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project

@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()

@client.event
def on_ready():
print(“Request handler is running”)

client.run()
Share your Scratch project so we can see if you have any issues there.

sorry! i fixed it! sorry for wasting your time!
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

programORdie wrote:

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

ScratchTheCoder12345 wrote:

CodingAnomaly wrote:

programORdie wrote:

CodingAnomaly wrote:

are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯
Did you converted the variables back to cloud vars?
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?
Hey, could you send your Python code?

Here it is:

import os
my_secret = os.environ

import scratchattach as scratch3

session = scratch3.Session(my_secret, username=“CodingAnomaly”)

conn = session.connect_cloud(“879988737”) #replace with your project id

client = scratch3.CloudRequests(conn)

@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project

@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()

@client.event
def on_ready():
print(“Request handler is running”)

client.run()
Share your Scratch project so we can see if you have any issues there.
i think the problem is not cloud cloud vars

^^^ see above
programORdie
Scratcher
28 posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

sorry! i fixed it! sorry for wasting your time!
np!
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

deleted.

Last edited by CodingAnomaly (Aug. 4, 2023 17:49:01)

CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

is there any way to still use replit with scratchattach?
infintyrussia
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

is there any way to still use replit with scratchattach?
Just use the session log in instead of the normal login.
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

infintyrussia wrote:

CodingAnomaly wrote:

is there any way to still use replit with scratchattach?
Just use the session log in instead of the normal login.
when i do that, it still blocks cloud requests?
infintyrussia
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

CodingAnomaly wrote:

infintyrussia wrote:

CodingAnomaly wrote:

is there any way to still use replit with scratchattach?
Just use the session log in instead of the normal login.
when i do that, it still blocks cloud requests?
When you use session login you may use cloud vars but other features such as loving a project and posting comments cannot be completed.
CodingAnomaly
Scratcher
59 posts

scratchattach - A Scratch API wrapper (Python)

infintyrussia wrote:

CodingAnomaly wrote:

infintyrussia wrote:

CodingAnomaly wrote:

is there any way to still use replit with scratchattach?
Just use the session log in instead of the normal login.
when i do that, it still blocks cloud requests?
When you use session login you may use cloud vars but other features such as loving a project and posting comments cannot be completed.
so there's no way to do certain things now on Replit, basically?

Powered by DjangoBB