Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- ItsDrinkable
-
Scratcher
40 posts
scratchattach - A Scratch API wrapper (Python)
Can you make a tutorial on YT or something?
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
so, scratchattach.There's meowclient for TypeScript, although not a direct port of scratchattach. It's well documented and has a nice API
(i don't think there will be an typescript port neither.)
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
Can you make a tutorial on YT or something?Consider looking at the documentation on the GitHub repo. Using scratchattach assumes a base-level understanding of Python
How exactly do the CloudEvents work? Do they just constantly check the var or does Scratch some how ping the server?If you use `WsCloudEvents`, scratchattach listens for events from Scratch's cloud event WebSockets API. However, the docs only mention `CloudEvents` which polls HTTP cloud event logs. If I used scratchattach often, I would just stick with `WsCloudEvents` since it's more efficient for long operations.
- infintyrussia
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
So this is ineffective. And what if the value is the same? It still detects it.that is probaply how its done.If nobody can explain this to me then how would I be able to find this out myself?How exactly do the CloudEvents work? Do they just constantly check the var or does Scratch some how ping the server?Can someone please explain?
Can someone please explain? Thanks!
just safe a value x for the cloud variables value, and check if the value of the cloud variable is or isnt equal to its “old” value x, and if it isnt, fire the event
- infintyrussia
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Ok! Can you give me a quick code snippet of the WsCloudEvents. I am not sure how to do that. I need max efficiency for long term. Thanks!Can you make a tutorial on YT or something?Consider looking at the documentation on the GitHub repo. Using scratchattach assumes a base-level understanding of PythonHow exactly do the CloudEvents work? Do they just constantly check the var or does Scratch some how ping the server?If you use `WsCloudEvents`, scratchattach listens for events from Scratch's cloud event WebSockets API. However, the docs only mention `CloudEvents` which polls HTTP cloud event logs. If I used scratchattach often, I would just stick with `WsCloudEvents` since it's more efficient for long operations.
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
Ok! Can you give me a quick code snippet of the WsCloudEvents. I am not sure how to do that. I need max efficiency for long term. Thanks!Turns out that `CloudRequests` uses `WsCloudEvents` by default, so I gave an example for that instead.
import scratchattach as scratch3 session = scratch3.Session("session_id", username="username") #replace with your session_id and username conn = session.connect_cloud("project_id") #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.event def on_ready(): print("Request handler is running") client.run()
- infintyrussia
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
But I need the cloud events. I know how to use cloud requests but idk how to use cloud events. Can you please give me an example?Ok! Can you give me a quick code snippet of the WsCloudEvents. I am not sure how to do that. I need max efficiency for long term. Thanks!Turns out that `CloudRequests` uses `WsCloudEvents` by default, so I gave an example for that instead.import scratchattach as scratch3 session = scratch3.Session("session_id", username="username") #replace with your session_id and username conn = session.connect_cloud("project_id") #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.event def on_ready(): print("Request handler is running") client.run()
- fluo1234
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
i ment that replit cant conect to scratc haw they banned replit thats the only ide i haveIf you still want to code in replit, try firewalledreplit.com, however it can't connect to the real world.
- Jake_Playz99
-
Scratcher
40 posts
scratchattach - A Scratch API wrapper (Python)
.
Last edited by Jake_Playz99 (March 17, 2023 19:20:02)
- coolcode22
-
Scratcher
27 posts
scratchattach - A Scratch API wrapper (Python)
(long unnecessary quote removed by moderator - please don't spam)
PLEASE MAKE IT HTML
PLEASE MAKE IT HTML
Last edited by Paddle2See (April 19, 2023 09:59:37)
- bigspeedfpv
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
PLEASE MAKE IT HTML??
- BreadcatGames
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
development stopped on this, I think you guys might want to find another scratch api wrapper for python
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
development stopped on this, I think you guys might want to find another scratch api wrapper for pythonIt's still stable though
- MicroRu
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
development stopped on this, I think you guys might want to find another scratch api wrapper for pythonscratchclient
- 0_dan_0
-
Scratcher
20 posts
scratchattach - A Scratch API wrapper (Python)
insan but im on chromebook
(((((((((((((((((((((((((((
(((((((((((((((((((((((((((- -FreeEngines-
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
what? how would html be used in any context with this?Scratch API wrapper with support for almost all site features. The library can set cloud variables, follow Scratchers, post comments and do so much more!PLEASE MAKE IT HTML
It has special features that make it easy to transmit data through cloud variables.
Available on PyPi and on GitHub: https://github.com/TimMcCool/scratchattach
Quick Documentation
(Full documentation) (Official studio for scratchattach projects)
Installation:
Run this command in your command prompt / shell:pip install -U scratchattach
Features:
- Get and set cloud variables on any Scratch project
- Cloud events
- Cloud requests that allow Scratch projects and Python to interact
- Get and interact with users, projects and studios
- Get and interact with Forum Posts / Topics
… and much more!
Examples
Setting a cloud var with scratchattach:Cloud Requests:import scratchattach as scratch3
session = scratch3.login("username", "password")
conn = session.connect_cloud("project_id")
conn.set_var("variable", value)
Link to examples
Cloud event handler:import scratchattach as scratch3
events = scratch3.CloudEvents("project_id")
@events.event
def on_set(event): #Called when a cloud var is set
print(f"{event.user} set the variable {event.var} to the valuee {event.value} at {event.timestamp}")
events.start()
(Full documentation) (Official studio for scratchattach projects)
Support and Bug Report
If you have a question, ask here or create an issue on the repo.
Reasons to use scratchattach
➥ Simple to use
➥ Fast and safe
➥ Cloud events & built-in class for encoded cloud requests
➥ Users, projects, comments, search, explore & more!
➥ Forum posts and topics
➥ Most features don't require a session
➥ Open-source
Note
This topic is for talking about scratchattach and reporting bugs / glitches, not for advertising projects or other libraries.
- MicroRu
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Guys, why do I get an error when I receive a profile comment? It is connected to the API, which is located on Replit.
- Knightbot63
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
(#1543)What's the code you are trying to run? Scratch has blocked ALL of replit's communication without a proxy of some sorts.
Guys, why do I get an error when I receive a profile comment? It is connected to the API, which is located on Replit.
- fluo1234
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
how do you code a program in html html is for making websites do you mean jsScratch API wrapper with support for almost all site features. The library can set cloud variables, follow Scratchers, post comments and do so much more!PLEASE MAKE IT HTML
It has special features that make it easy to transmit data through cloud variables.
Available on PyPi and on GitHub: https://github.com/TimMcCool/scratchattach
Quick Documentation
(Full documentation) (Official studio for scratchattach projects)
Installation:
Run this command in your command prompt / shell:pip install -U scratchattach
Features:
- Get and set cloud variables on any Scratch project
- Cloud events
- Cloud requests that allow Scratch projects and Python to interact
- Get and interact with users, projects and studios
- Get and interact with Forum Posts / Topics
… and much more!
Examples
Setting a cloud var with scratchattach:Cloud Requests:import scratchattach as scratch3
session = scratch3.login("username", "password")
conn = session.connect_cloud("project_id")
conn.set_var("variable", value)
Link to examples
Cloud event handler:import scratchattach as scratch3
events = scratch3.CloudEvents("project_id")
@events.event
def on_set(event): #Called when a cloud var is set
print(f"{event.user} set the variable {event.var} to the valuee {event.value} at {event.timestamp}")
events.start()
(Full documentation) (Official studio for scratchattach projects)
Support and Bug Report
If you have a question, ask here or create an issue on the repo.
Reasons to use scratchattach
➥ Simple to use
➥ Fast and safe
➥ Cloud events & built-in class for encoded cloud requests
➥ Users, projects, comments, search, explore & more!
➥ Forum posts and topics
➥ Most features don't require a session
➥ Open-source
Note
This topic is for talking about scratchattach and reporting bugs / glitches, not for advertising projects or other libraries.
- MicroRu
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
I want to receive comments in my profile. How to do it?(#1543)What's the code you are trying to run? Scratch has blocked ALL of replit's communication without a proxy of some sorts.
Guys, why do I get an error when I receive a profile comment? It is connected to the API, which is located on Replit.
