Sid72020123 / scratchconnect

Python Library to connect Scratch API and much more.
https://sid72020123.github.io/scratchconnect/
MIT License
26 stars 14 forks source link

Random crash when setting a cloud variable #29

Closed idkhow2type closed 2 years ago

idkhow2type commented 2 years ago

Occasionally, right after setting a cloud variable, everything crashes, without any errors. Can you look into it? Thanks!

Sid72020123 commented 2 years ago

Can you send the error or the code here? So that I can figure out the problem...

Sid72020123 commented 2 years ago

Maybe you were spamming the Scratch Server and the server disconnected you... Try using time.sleep() Or use try/except statement to catch and handle the error when the Cloud creashes...

Sid72020123 commented 2 years ago

@idkhow2type Is the issue still there?

idkhow2type commented 2 years ago

Sorry for taking a while to respond, here's the code for what I'm doing: https://gist.github.com/idkhow2type/fec1374aa7f8577f51f1ca74076c6d9f For context, I'm making a Scratch project that can read its comments

The issue only seems to happen in this part of the code

if i >= len(comments):
    set_cloud_var(str(i + 1), "")
    continue
Sid72020123 commented 2 years ago

According to your code, the line no. 15 should be CLOUD.set_cloud_variable()

Sid72020123 commented 2 years ago

As the issue has been solved here, I will close this issue...