Discuss Scratch

MooMoo5678star
Scratcher
38 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

infintyrussia_test wrote:

I don't know what to do with this error:



Edit: works now.
Can you send us your code?


hi @Timmccool!

my main profile:@MooMoo5678star




when green flag clicked
say (cool)
Funtoot_BG
Scratcher
3 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

MagicCrayon9342 wrote:

-FreeEngines- wrote:

MagicCrayon9342 wrote:

Funtoot_BG wrote:

I found that pip install scratchattach doesn't work for me, so if you have that problem then try py -m pip install scratchattach.
What OS do you use? on Windows, pip is in path by default. As with linux, pip should be installed by default. Same thing with MacOS right?
no, pip isnt installed on windows lol
Not by default, should of phrased that better. The Python installer installs pip as well, and adds it to the PATH.
Actually Its working now lol
Loganmcc04
Scratcher
57 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

SubscribeToZadpi wrote:

I don't know if i'm just stupid or something, but when I type pip install scratchattach to Python it says an error
Try running it in the shell. (Second tab of the window at the bottom right / right) Hopefully this fixes your problem.

Last edited by Loganmcc04 (June 1, 2022 08:15:11)


I saw him standing there in the bakery
Holding the biggest sausage roll I've ever seen

Didn't know it would turn me on
But I'd never seen one so long

And I knew it was gonna be wrong
But I want meat, yeah, meat
Baked in puff pastry
Yeah, I want meat, yeah, meat

Singing, I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

She smiled at me
As she took hold of my snack
She put it in her mouth

I nearly had a heart attack
I couldn't put up a fight

Knew it was friends at first bite
And I could tell it was gonna be right

'Cause I want meat, yeah, meat
A beige and savory treat

Yeah, I want meat, yeah, meat
Singing, I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

We don't want to start a riot
We're not on a vegan diet
We know Quorn will never be a client

'Cause we want meat, yeah, meat
We eat it on every street

Yeah we want meat, yeah meat
Singing, I love sausage rolls
So put another one in the oven, baby

I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

Hold on, who eats a sausage roll with gravy?

Are you joking?

Seriously? Gravy?

Yes, mate

aaaaaaaaaaaaaaa
youhan_school
Scratcher
41 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

New in v0.5.5:


- Getting and following Forum Topics (new scratch3.ForumTopic class)
- Getting list of the forum topics in a category
- Getting forum topic change log

- Getting and editing Forum Posts (new scratch3.ForumPost class)
- Getting forum posts of a topic
- Searching forum posts all over Scratch
- Getting the forum posts made by a user

- Getting a post's ocular reactions
- Getting a user's ocular status

- Getting site statistics (from https://scratch.mit.edu/statistics/)
- Getting site health

To prevent spam, adding posts to topics is not a scratchattach feature and never will be.

If you find any bugs in the new features, please report them.
ok
youhan_school
Scratcher
41 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

MooMoo5678star wrote:

I m new here!
Hi! If you need help just create a post through here ya! thanks!
Loganmcc04
Scratcher
57 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

infintyrussia_test wrote:

I don't know what to do with this error:



Edit: works now.
Can you send us your code?
Hey, I have been trying to return multiple values from cloud requests too but it doesn't seem to work.
It looks like this.

Example:

return (argument1) - Username
return user.message_count - Message Count
return user.follower_count - Follower Count
return user.following_count - Following Count

Result:
error (could also return just (argument1) in scratch)

I also tried sending it in a big long string, but it just pasted into scratch as the actual functions names instead of what the functions contain.

Example:

name = (argument1)
message = user.message_count
follower = user.follower_count
following = user.following_count
return (argument1) + message + follower + following

Result in scratch:
(argument1) user.message_count user.follower_count user.following_count

I hope you can fix this..

Last edited by Loganmcc04 (June 1, 2022 09:06:42)


I saw him standing there in the bakery
Holding the biggest sausage roll I've ever seen

Didn't know it would turn me on
But I'd never seen one so long

And I knew it was gonna be wrong
But I want meat, yeah, meat
Baked in puff pastry
Yeah, I want meat, yeah, meat

Singing, I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

She smiled at me
As she took hold of my snack
She put it in her mouth

I nearly had a heart attack
I couldn't put up a fight

Knew it was friends at first bite
And I could tell it was gonna be right

'Cause I want meat, yeah, meat
A beige and savory treat

Yeah, I want meat, yeah, meat
Singing, I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

We don't want to start a riot
We're not on a vegan diet
We know Quorn will never be a client

'Cause we want meat, yeah, meat
We eat it on every street

Yeah we want meat, yeah meat
Singing, I love sausage rolls
So put another one in the oven, baby

I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

Hold on, who eats a sausage roll with gravy?

Are you joking?

Seriously? Gravy?

Yes, mate

aaaaaaaaaaaaaaa
infintyrussia_test
Scratcher
9 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

infintyrussia_test wrote:

I don't know what to do with this error:



Edit: works now.
Can you send us your code?
The problem was that I was setting a var to an image load and a string. If that makes sense.
xxxxxxx-70
Scratcher
17 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

hello
Ameise15
Scratcher
8 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Thanks in advance! Anyways, scratchattach ist awesome!

Last edited by Ameise15 (June 1, 2022 14:05:39)


when green flag clicked
forever
change [My followers v] by (1)
end
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Ameise15 wrote:

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
What error does it show? Thanks

Last edited by TimMcCool (June 1, 2022 13:51:21)


My profile / Mein Profil: @TimMcCool
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Loganmcc04 wrote:

TimMcCool wrote:

infintyrussia_test wrote:

I don't know what to do with this error:



Edit: works now.
Can you send us your code?
Hey, I have been trying to return multiple values from cloud requests too but it doesn't seem to work.
It looks like this.

Example:

return (argument1) - Username
return user.message_count - Message Count
return user.follower_count - Follower Count
return user.following_count - Following Count

Result:
error (could also return just (argument1) in scratch)

I also tried sending it in a big long string, but it just pasted into scratch as the actual functions names instead of what the functions contain.

Example:

name = (argument1)
message = user.message_count
follower = user.follower_count
following = user.following_count
return (argument1) + message + follower + following

Result in scratch:
(argument1) user.message_count user.follower_count user.following_count

I hope you can fix this..

That's not a bug. “message_count()”, “follower_count()” and “following_count()” are functions, not attributes.
“user.message_count” will only reference the function. To get the user's message count, use "message = user.message_count()“.

”user.message_count()“ will return an integer while argument1 is a string. You can't add integers to string. Therefore ”return (argument1) + message + follower + following" won't work either. You could use an f-string to join the numbers and letters.

I fixed your code:
name = argument1
user = scratch3.get_user(name)
message = user.message_count()
follower = user.follower_count()
following = user.following_count()
return f"{argument1} {message} {follower} {following}"

Last edited by TimMcCool (June 1, 2022 14:04:23)


My profile / Mein Profil: @TimMcCool
Ameise15
Scratcher
8 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

Ameise15 wrote:

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
What error does it show? Thanks

It's showing:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 40, in _connect
self.websocket.connect(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_core.py”, line 244, in connect
self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_http.py”, line 136, in connect
sock = _ssl_socket(sock, options.sslopt, hostname)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_http.py”, line 272, in _ssl_socket
sock = _wrap_sni_socket(sock, sslopt, hostname, check_hostname)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_http.py”, line 248, in _wrap_sni_socket
return context.wrap_socket(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py”, line 512, in wrap_socket
return self.sslsocket_class._create(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py”, line 1070, in _create
self.do_handshake()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py”, line 1341, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “cloud2.py”, line 4, in <module>
conn = session.connect_cloud(project_id=“698201759”)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_session.py”, line 238, in connect_cloud
return _cloud.CloudConnection(username = self._username, session_id = self.session_id, project_id = int(project_id))
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 17, in __init__
self._connect(cloud_host=cloud_host)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 47, in _connect
raise(_exceptions.ConnectionError)
scratchattach._exceptions.ConnectionError

Last edited by Ameise15 (June 1, 2022 15:19:54)


when green flag clicked
forever
change [My followers v] by (1)
end
SansStudios
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Ameise15 wrote:

TimMcCool wrote:

Ameise15 wrote:

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
What error does it show? Thanks

It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

scratchattach._exceptions.ConnectionError

To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.

Also, your computer's name is included in the traceback—you might want to remove that.

scratchcloud
Click above to check it out! I've worked on it for over a year!























Just like sudden sadness comes hangin' on the breeze
xxxxxxx-70
Scratcher
17 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

when green flag clicked
change [ ] by (10000000000000000000000000000)
xxxxxxx-70
Scratcher
17 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

join me here follow me please…
Ameise15
Scratcher
8 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

SansStudios wrote:

Ameise15 wrote:

TimMcCool wrote:

Ameise15 wrote:

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
What error does it show? Thanks

It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

scratchattach._exceptions.ConnectionError

To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.

Also, your computer's name is included in the traceback—you might want to remove that.
Thanks alot. I just realized it's working perfectly when I do it on replit instead vs code (That was the only python editor I had)

when green flag clicked
forever
change [My followers v] by (1)
end
-FreeEngines-
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Ameise15 wrote:

SansStudios wrote:

Ameise15 wrote:

TimMcCool wrote:

Ameise15 wrote:

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
What error does it show? Thanks

It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

scratchattach._exceptions.ConnectionError

To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.

Also, your computer's name is included in the traceback—you might want to remove that.
Thanks alot. I just realized it's working perfectly when I do it on replit instead vs code (That was the only python editor I had)
please differentiate. replit isnt an editor but an coding platform on its own with an own vm. i have absolutely no clue why youre certificate seems to be wrong, but thats not because of vscode
SubscribeToZadpi
Scratcher
14 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

bruh doesn't work
<touching [ working thing] ?>
say [happy]

My Game

Hello everyone!:)
Loganmcc04
Scratcher
57 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Thank you!

Last edited by Loganmcc04 (June 1, 2022 18:53:23)


I saw him standing there in the bakery
Holding the biggest sausage roll I've ever seen

Didn't know it would turn me on
But I'd never seen one so long

And I knew it was gonna be wrong
But I want meat, yeah, meat
Baked in puff pastry
Yeah, I want meat, yeah, meat

Singing, I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

She smiled at me
As she took hold of my snack
She put it in her mouth

I nearly had a heart attack
I couldn't put up a fight

Knew it was friends at first bite
And I could tell it was gonna be right

'Cause I want meat, yeah, meat
A beige and savory treat

Yeah, I want meat, yeah, meat
Singing, I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

We don't want to start a riot
We're not on a vegan diet
We know Quorn will never be a client

'Cause we want meat, yeah, meat
We eat it on every street

Yeah we want meat, yeah meat
Singing, I love sausage rolls
So put another one in the oven, baby

I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy
I love sausage rolls
So put another one in the oven, baby
I love sausage rolls
So eat it with ketchup or gravy

Hold on, who eats a sausage roll with gravy?

Are you joking?

Seriously? Gravy?

Yes, mate

aaaaaaaaaaaaaaa
Ameise15
Scratcher
8 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

-FreeEngines- wrote:

Ameise15 wrote:

SansStudios wrote:

Ameise15 wrote:

TimMcCool wrote:

Ameise15 wrote:

Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
What error does it show? Thanks

It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

scratchattach._exceptions.ConnectionError

To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.

Also, your computer's name is included in the traceback—you might want to remove that.
Thanks alot. I just realized it's working perfectly when I do it on replit instead vs code (That was the only python editor I had)
please differentiate. replit isnt an editor but an coding platform on its own with an own vm. i have absolutely no clue why youre certificate seems to be wrong, but thats not because of vscode
OK but it's not bad because it's working now

when green flag clicked
forever
change [My followers v] by (1)
end

Powered by DjangoBB

Standard | Mobile