Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- Ryan_shamu_YT
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
You can look at my project (pfp loader) and see how it works how to make pfp renderhttps://scratch.mit.edu/projects/983994522/ python code: https://github.com/Ryan-shamu-YT/pfploader I hope it can give you an understanding, but the code is not the best.
Last edited by Ryan_shamu_YT (March 19, 2024 19:51:54)
I am still alive
- Ryan_shamu_YT
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
how to make pfp render
Just use PILLOW to get the pixels from an image and do this: r * 65536 + g * 256 + b to convert it to a form in which
set pen color to [#b31834]can understand
Last edited by Ryan_shamu_YT (March 19, 2024 19:50:54)
I am still alive
- Lurdumoloch
- Scratcher
3 posts
scratchattach - A Scratch API wrapper (Python)
How can I run the python script gratis 24/7 on a server ?
say [?????]
- justablock
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
i already figured out but thxhow to make pfp render
Just use PILLOW to get the pixels from an image and do this: r * 65536 + g * 256 + b to convert it to a form in whichset pen color to [#b31834]can understand
- Ryan_shamu_YT
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
No problemi already figured out but thxhow to make pfp render
Just use PILLOW to get the pixels from an image and do this: r * 65536 + g * 256 + b to convert it to a form in whichset pen color to [#b31834]can understand
I am still alive
- scaryghost14
- Scratcher
46 posts
scratchattach - A Scratch API wrapper (Python)
i need some help to make a follower count and i cant find out how to this is what i am doing
import os
os.system(“pip install -U scratchattach”)
session = scratch3.login(“scaryghost14, ”**********“)
conn = session.connect_cloud(”988062367“)
conn.set_var(”variable", 10)
import os
os.system(“pip install -U scratchattach”)
session = scratch3.login(“scaryghost14, ”**********“)
conn = session.connect_cloud(”988062367“)
conn.set_var(”variable", 10)
play https://scratch.mit.edu/projects/860188790/ it is fun follow scaryghost14
when I receive [I'm board v]
follow [scaryghost14]
- scaryghost14
- Scratcher
46 posts
scratchattach - A Scratch API wrapper (Python)
yay i do not know that too How can I run the python script gratis 24/7 on a server ?say [?????]
play https://scratch.mit.edu/projects/860188790/ it is fun follow scaryghost14
when I receive [I'm board v]
follow [scaryghost14]
- Mr_rudy
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
try using glitch, look up python3 on glitch then follow the tutorialyay i do not know that too How can I run the python script gratis 24/7 on a server ?say [?????]
CHECK OUT SNAIL IDE:
Website
Fourm Post
i make games and other cool stuff
when @greenFlag [clicked v]:: events hatevil kumquats ate this sentenc-
when (when @greenFlag clicked:: events) clicked:: events stack
when @greenFlag clicked {
when @greenFlag clicked:: events stack
}:: events
when <@greenFlag:: events> clicked:: events
when ({when @greenFlag clicked:: events stack}@addInput:: events) clicked:: events stack
when @greenFlag clicked:: events cap
- justablock
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
oh hey mr_rudy… not long time ago we met :skull:try using glitch, look up python3 on glitch then follow the tutorialyay i do not know that too How can I run the python script gratis 24/7 on a server ?say [?????]
- justablock
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
you are Norwegian or Swedish or Danish bcs gratis is free on scandi languages How can I run the python script gratis 24/7 on a server ?say [?????]
- TheMobileGames
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
@TimMcCool, soon, could you please fix an issue in Scratchattach where it does not allow me to set a cloud variable to a completely empty value using the code: conn.set_var(“Cloud”, “”). I currently get an error like this: scratchattach.exceptions.InvalidCloudValue. I know it’s possible with regular Scratch as seen here with this test project: https://scratch.mit.edu/projects/992175539
If anyone else can help me let me know how.
If anyone else can help me let me know how.
Last edited by TheMobileGames (March 31, 2024 00:38:12)
—————————— —————————— —————————— —————————— ——————————
A way to make any game easily mobile (no remixing needed): https://scratch.mit.edu/discuss/topic/733837
My mobile engine (use to add buttons/controls to a game): https://scratch.mit.edu/projects/778848092/
—————————— —————————— —————————— —————————— ——————————
- TheMobileGames
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Furthermore, @TimMcCool, I have another problem with no stated solution in Scratchattach’s documentation as far as I have seen. I need a function that takes in any scratch username and returns a True or False boolean value based on whether that scratch account is a “New Scratcher” or not. The closest thing that I can find this is: session.new_scratcher but correct me if I’m wrong, I don’t think you can get whether or not the scratch account is a “New Scratcher” or not for any user using this line of code. The best I can do right now is just check if the account is older than 2 weeks using: user.join_date which probably will work pretty well.
If anyone else can help me let me know how.
If anyone else can help me let me know how.
—————————— —————————— —————————— —————————— ——————————
A way to make any game easily mobile (no remixing needed): https://scratch.mit.edu/discuss/topic/733837
My mobile engine (use to add buttons/controls to a game): https://scratch.mit.edu/projects/778848092/
—————————— —————————— —————————— —————————— ——————————
- Redstone1080
- Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
You could just query the Scratch API directly using the requests library. It has what you need. I need a function that takes in any scratch username and returns a True or False boolean value based on whether that scratch account is a “New Scratcher” or not.
Unofficial docs for the Scratch api: https://en.scratch-wiki.info/wiki/Scratch_API
Last edited by Redstone1080 (March 31, 2024 02:58:18)
const juniper = programmer && musician; // my pronouns are she/her // i am trans and bi :P // you can call me june or juni for short but i prefer juniper
juniper = programmer and musician # my pronouns are she/her # i am trans and bi :P # you can call me june or juni for short but i prefer juniper
- wvzack
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
i have not tried this code so it may not work but try this: i need some help to make a follower count and i cant find out how to this is what i am doing
import os
os.system(“pip install -U scratchattach”)
session = scratch3.login(“scaryghost14, ”**********“)
conn = session.connect_cloud(”988062367“)
conn.set_var(”variable", 10)
import os import time os.system("pip install -U scratchattach") session = scratch3.login("scaryghost14, "**********") conn = session.connect_cloud("988062367") while True: user = session.connect_user("griffpatch") #gets griffpatches stats conn.set_var("variable", user.follower_count()) #gets the follower count time.sleep(10) #waits 10 seconds
Last edited by wvzack (March 31, 2024 04:17:25)
- redspacecat
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Does anyone have any ideas for good python code hosting services?
Highlight and do Shift + Down Arrow to see the rest of my signature.
Click Here To Get A Scratch 4.0 Sneak Peak!
You should probably know that I don't actually use forbidden word, I just use this bookmarklet to upload to the assets server. I wonder who else knows what forbidden word is.
You got TROLLED
- -theGameMaker
- Scratcher
11 posts
scratchattach - A Scratch API wrapper (Python)
I'm really interested in this topic, but I've got some questions. (Also if there is any info that can answer my questions on the documentation page, let me know as I didn't get that deep into reading it.) First, I noticed that on the cloud request examples page, there was a window that looked similar to the Scratch project window. Is that included with the package, and does it appear when testing your script? I assume it does, but I'm not 100% sure. Also, I assume there are limits to what projects you can change, right? If I were to use this and make a project with cloud variables, I really don't want random people changing the cloud variables and messing with the project.
Have a great day!
when I receive [Start New Day v]
forever
Be Happy! :: custom
end
- justablock
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
GUYS I FOUND 24/7 FREE HOSTING NOT BANNED BY SCRATCH!!! YT VIDEO: https://www.youtube.com/watch?v=tyGwGSrujV4
- redspacecat
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
I know how to send data to Scratch from my python server, but how do I do that the other way around? I need to send large amounts of data from Scratch to my python server, which I don't know how to do.
Last edited by redspacecat (April 4, 2024 02:17:47)
Highlight and do Shift + Down Arrow to see the rest of my signature.
Click Here To Get A Scratch 4.0 Sneak Peak!
You should probably know that I don't actually use forbidden word, I just use this bookmarklet to upload to the assets server. I wonder who else knows what forbidden word is.
You got TROLLED
- justablock
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
events… to send many arguments, I think 4th block in example when importing scratch events sprite it shows how to have more then 2 arguments. If you send more then 3000 characters it wont cancel request, it will just take longer for request to proceed. Character limit is ∞. I know how to send data to Scratch from my python server, but how do I do that the other way around? I need to send large amounts of data from Scratch to my python server, which I don't know how to do.