Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- Air_heads
-
Scratcher
98 posts
scratchattach - A Scratch API wrapper (Python)
when green flag clicked
forever
if <bad> then
close
end
end
Please don’t post irrelevant content in this forum, thanks!
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
True but it sure simplifies it and yes people use html and js but still the blame goes on scratch attach.Check robot destructor people are abusing and I hope this won’t happen but I would not be surprised if the st gets rid of scratchattach projectsbro, remove the module. delete it now. people are hacking with it like crazy!who ?
People can still do it without scratchattach -_-
- Air_heads
-
Scratcher
98 posts
scratchattach - A Scratch API wrapper (Python)
True but it sure simplifies it and yes people use html and js but still the blame goes on scratch attach.Check robot destructor people are abusing and I hope this won’t happen but I would not be surprised if the st gets rid of scratchattach projectsbro, remove the module. delete it now. people are hacking with it like crazy!who ?
People can still do it without scratchattach -_-
I still don’t get your argument as to why the blame should be on Scratchattach …
If the API is public, then anyone can utilize it, and if you’re talking about JavaScript, scratchattach is completely irrelevant as it is a python library.
- 8_bit_pixel
-
Scratcher
1 post
scratchattach - A Scratch API wrapper (Python)
Just found this, seeing how to import to CodeSandbox.
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
The blame goes on scratch attach because it is known of and well people don’t know much more than the basic programming in scratch and they have no idea how everything else works. (Notevveryone of course)True but it sure simplifies it and yes people use html and js but still the blame goes on scratch attach.Check robot destructor people are abusing and I hope this won’t happen but I would not be surprised if the st gets rid of scratchattach projectsbro, remove the module. delete it now. people are hacking with it like crazy!who ?
People can still do it without scratchattach -_-
I still don’t get your argument as to why the blame should be on Scratchattach …
If the API is public, then anyone can utilize it, and if you’re talking about JavaScript, scratchattach is completely irrelevant as it is a python library.
- EpicCoderGamer1000
-
Scratcher
82 posts
scratchattach - A Scratch API wrapper (Python)
So i am trying to make a scratch follower count using “user.follower_count()” but i can't do it for some reason. I don't have much experience with python.
The error I get is
File “C:\Users\PCNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\scratchattach\cloud.py”, line 116, in set_var
raise(exceptions.InvalidCloudValue)
scratchattach.exceptions.InvalidCloudValue
This is my code:
import scratchattach as scratch3
session = scratch3.login(“username”, “password”)
ID = 949764017
conn = session.connect_cloud(ID)
FollowersVAR == “user.follower_count()”
conn.set_var(“Followers”, FollowersVAR)
#the variable name is specified without the cloud emoji
# Set a cloud variable:
conn.set_var(“Followers”, FollowersVAR)
# — TURBOWARP — #
# This connects to your project's TurboWarp cloud variables:
tw_conn = scratch3.connect_tw_cloud(ID)
tw_conn.set_var(“Followers”, FollowersVAR)
The error I get is
File “C:\Users\PCNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\scratchattach\cloud.py”, line 116, in set_var
raise(exceptions.InvalidCloudValue)
scratchattach.exceptions.InvalidCloudValue
This is my code:
import scratchattach as scratch3
session = scratch3.login(“username”, “password”)
ID = 949764017
conn = session.connect_cloud(ID)
FollowersVAR == “user.follower_count()”
conn.set_var(“Followers”, FollowersVAR)
#the variable name is specified without the cloud emoji
# Set a cloud variable:
conn.set_var(“Followers”, FollowersVAR)
# — TURBOWARP — #
# This connects to your project's TurboWarp cloud variables:
tw_conn = scratch3.connect_tw_cloud(ID)
tw_conn.set_var(“Followers”, FollowersVAR)
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
So i am trying to make a scratch follower count using “user.follower_count()” but i can't do it for some reason. I don't have much experience with python.To the most of my knowledge this is happening because the scratch data logs are down which means that scratchattach fetches a non existent number which then returns none which is not a number there for a cloud var cannot be set to it. Unfortunately there is no fix.
The error I get is
File “C:\Users\PCNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\scratchattach\cloud.py”, line 116, in set_var
raise(exceptions.InvalidCloudValue)
scratchattach.exceptions.InvalidCloudValue
This is my code:
import scratchattach as scratch3
session = scratch3.login(“username”, “password”)
ID = 949764017
conn = session.connect_cloud(ID)
FollowersVAR == “user.follower_count()”
conn.set_var(“Followers”, FollowersVAR)
#the variable name is specified without the cloud emoji
# Set a cloud variable:
conn.set_var(“Followers”, FollowersVAR)
# — TURBOWARP — #
# This connects to your project's TurboWarp cloud variables:
tw_conn = scratch3.connect_tw_cloud(ID)
tw_conn.set_var(“Followers”, FollowersVAR)

- EpicCoderGamer1000
-
Scratcher
82 posts
scratchattach - A Scratch API wrapper (Python)
Dang that sucks since the scratch data logs are downSo i am trying to make a scratch follower count using “user.follower_count()” but i can't do it for some reason. I don't have much experience with python.To the most of my knowledge this is happening because the scratch data logs are down which means that scratchattach fetches a non existent number which then returns none which is not a number there for a cloud var cannot be set to it. Unfortunately there is no fix.
The error I get is
File “C:\Users\PCNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\scratchattach\cloud.py”, line 116, in set_var
raise(exceptions.InvalidCloudValue)
scratchattach.exceptions.InvalidCloudValue
This is my code:
import scratchattach as scratch3
session = scratch3.login(“username”, “password”)
ID = 949764017
conn = session.connect_cloud(ID)
FollowersVAR == “user.follower_count()”
conn.set_var(“Followers”, FollowersVAR)
#the variable name is specified without the cloud emoji
# Set a cloud variable:
conn.set_var(“Followers”, FollowersVAR)
# — TURBOWARP — #
# This connects to your project's TurboWarp cloud variables:
tw_conn = scratch3.connect_tw_cloud(ID)
tw_conn.set_var(“Followers”, FollowersVAR)
- Knightbot63
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
So i am trying to make a scratch follower count using “user.follower_count()” but i can't do it for some reason. I don't have much experience with python.By the looks of it, you wrapped the user.follower_count() in quotation marks making that a string instead of the actual value it's fetching. Removing the quotation marks fixes your code.
The error I get is
File “C:\Users\PCNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\scratchattach\cloud.py”, line 116, in set_var
raise(exceptions.InvalidCloudValue)
scratchattach.exceptions.InvalidCloudValue
-snip-
- EpicCoderGamer1000
-
Scratcher
82 posts
scratchattach - A Scratch API wrapper (Python)
It doesn't because i get an error saying did you mean super and not user.So i am trying to make a scratch follower count using “user.follower_count()” but i can't do it for some reason. I don't have much experience with python.By the looks of it, you wrapped the user.follower_count() in quotation marks making that a string instead of the actual value it's fetching. Removing the quotation marks fixes your code.
The error I get is
File “C:\Users\PCNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\scratchattach\cloud.py”, line 116, in set_var
raise(exceptions.InvalidCloudValue)
scratchattach.exceptions.InvalidCloudValue
-snip-
Last edited by EpicCoderGamer1000 (Jan. 13, 2024 04:02:25)
- Knightbot63
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
It doesn't because i get an error saying did you mean super and not userThe variable user wasn't defined, you have to define it or add it into the code to make it work. So assuming you want to get the follower count, you can do this code:
user = scratch3.get_user("username")
- EpicCoderGamer1000
-
Scratcher
82 posts
scratchattach - A Scratch API wrapper (Python)
Ok i can try that. EDIT: It works now thanksIt doesn't because i get an error saying did you mean super and not userThe variable user wasn't defined, you have to define it or add it into the code to make it work. So assuming you want to get the follower count, you can do this code:and then use your code before calling user.follower_count()user = scratch3.get_user("username")
Last edited by EpicCoderGamer1000 (Jan. 13, 2024 03:51:01)
- TheMobileGames
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
Since the cloud logs are down, could anyone help answer this cloud variable related question: https://scratch.mit.edu/discuss/topic/735257/ (different topic because it’s not really about Scratchattach and also so more people will see it hopefully)
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
Good news everyone the logs just came back up


- caftingdead261
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
CLOUD LOG ARE BACK THIS IS NOT A DRILL I REPEAT CLOUD LOGS ARE BACK THIS IS NOT A DRILL 
- Knightbot63
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
CLOUD LOG ARE BACK THIS IS NOT A DRILL I REPEAT CLOUD LOGS ARE BACK THIS IS NOT A DRILL
Good news everyone the logs just came back upAwesome.![]()
- mas6y6
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
THE CLOUD LOGS ARE BACK!!!!!!!@! 









































- EpicCoderGamer1000
-
Scratcher
82 posts
scratchattach - A Scratch API wrapper (Python)
THE CLOUD LOGS ARE BACK!!!!!!!@!We know
- scaryghost14
-
Scratcher
58 posts
scratchattach - A Scratch API wrapper (Python)
yes back up!!!THE CLOUD LOGS ARE BACK!!!!!!!@!We know
when green flag clicked
if <cloud_logs = back up> then
say [yes!!]
else
sad
end