Discuss Scratch

Air_heads
Scratcher
98 posts

scratchattach - A Scratch API wrapper (Python)

scaryghost14 wrote:

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)

Air_heads wrote:

wvzack wrote:

-ProXeeI wrote:

RandomPerson13764 wrote:

bro, remove the module. delete it now. people are hacking with it like crazy!
who ?
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 projects

People can still do it without scratchattach -_-
True but it sure simplifies it and yes people use html and js but still the blame goes on scratch attach.
mas6y6
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

scaryghost14 wrote:

(#2240)

DebugDungeon wrote:

-ProXeeI wrote:

is
session.connect_project(id_project)
working ??
yes
pls tell me how to get it i linux
Use the same command in the terminal
It may take a while bc linux is not fast. let me know if you need help
Air_heads
Scratcher
98 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

Air_heads wrote:

wvzack wrote:

-ProXeeI wrote:

RandomPerson13764 wrote:

bro, remove the module. delete it now. people are hacking with it like crazy!
who ?
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 projects

People can still do it without scratchattach -_-
True but it sure simplifies it and yes people use html and js but still the blame goes on scratch attach.

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)

Air_heads wrote:

wvzack wrote:

Air_heads wrote:

wvzack wrote:

-ProXeeI wrote:

RandomPerson13764 wrote:

bro, remove the module. delete it now. people are hacking with it like crazy!
who ?
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 projects

People can still do it without scratchattach -_-
True but it sure simplifies it and yes people use html and js but still the blame goes on scratch attach.

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.
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)
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)
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

EpicCoderGamer1000 wrote:

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)
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.
EpicCoderGamer1000
Scratcher
82 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

EpicCoderGamer1000 wrote:

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)
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.
Dang that sucks since the scratch data logs are down
Knightbot63
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

EpicCoderGamer1000 wrote:

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
-snip-
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.
EpicCoderGamer1000
Scratcher
82 posts

scratchattach - A Scratch API wrapper (Python)

Knightbot63 wrote:

EpicCoderGamer1000 wrote:

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
-snip-
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.
It doesn't because i get an error saying did you mean super and not user.

Last edited by EpicCoderGamer1000 (Jan. 13, 2024 04:02:25)

Knightbot63
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

EpicCoderGamer1000 wrote:

It doesn't because i get an error saying did you mean super and not user
The 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")
and then use your code before calling user.follower_count()
EpicCoderGamer1000
Scratcher
82 posts

scratchattach - A Scratch API wrapper (Python)

Knightbot63 wrote:

EpicCoderGamer1000 wrote:

It doesn't because i get an error saying did you mean super and not user
The 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")
and then use your code before calling user.follower_count()
Ok i can try that. EDIT: It works now thanks

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)

caftingdead261 wrote:

CLOUD LOG ARE BACK THIS IS NOT A DRILL I REPEAT CLOUD LOGS ARE BACK THIS IS NOT A DRILL

wvzack wrote:

Good news everyone the logs just came back up
Awesome.
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)

mas6y6 wrote:

THE CLOUD LOGS ARE BACK!!!!!!!@!
We know
scaryghost14
Scratcher
58 posts

scratchattach - A Scratch API wrapper (Python)

EpicCoderGamer1000 wrote:

mas6y6 wrote:

THE CLOUD LOGS ARE BACK!!!!!!!@!
We know
yes back up!!!
when green flag clicked
if <cloud_logs = back up> then
say [yes!!]


else
sad
end

Powered by DjangoBB