Discuss Scratch

Yusei-Fudo
Scratcher
1000+ posts

Jumps

I created a Stop sign clicked detector: https://scratch.mit.edu/projects/524818277/, and I was looking at its cloud data history, and found sudden jumps in the data:






And a lot more jumps. You can take a look at the cloud data history here: https://scratch.mit.edu/cloudmonitor/524818277/

In the past, there were no such problems:


Ignore the 35173… value, it's another cloud variable.

I know this sort of stuff probably doesn't go here, but don't know where else to post this question.

I'm wondering what could've caused the sudden jumps in values, the project gives you one point at a time, they said they didn't turn the internet off:
https://scratch.mit.edu/projects/524818277/#comments-221729790

And yeah. Unless the jumps have to do with Scratch moving comment data around the website, I'm thinking auto clicker, and if not, then I'm out of ideas.

Last edited by Yusei-Fudo (Aug. 24, 2021 05:22:40)


I'm a decent coder who has a huge passion for coding. I taught myself all the coding skills I have now. And with those skills, I have made some pretty decent projects, check them out! Be sure to ⭐ ❤️ & Follow, too! I have a few pictures below which are actually links. Click on them to take to different projects that I made. Might come in handy. :)

Need a project where you can check to see if you can use someone's camera or not? Here's one:


Need a project to detect when someone has clicked the stop sign? Take a look at this:

Need a project that can point at specific clones, etc? Why not use this:


Need to prank someone? Tell them to click this picture, but also make sure they're signed onto Scratch, otherwise, it doesn't work:


For more of my projects, just click on this picture:
Chiroyce
Scratcher
1000+ posts

Jumps

So we all know about cloud variables, right? Here's how they work! Make a default project with just scratch cat, make a cloud variable called cloud, and this code -



Share it, and now go to the project page, now right click, and press “Inspect”, then click on a tab called as “Network” (Looks may vary with browsers)


and then click on WS


Now, reload the page, you should see something like this JUST after the project loads



Do you see that the cloud variable loads after the project has been loaded? If your internet is slow enough, the code will run on the older cloud variable, now click on scratch cat a few times until the variable is = 6

reload the page again, as SOON as the project loads, spam the flag and click on scratch cat

after that, go to the cloud monitor, if you do remember, our code is supposed to ALWAYS increase the variable by one, so lets take two values, foo which is below another value in the cloud log, and baz, so since foo is below baz, it's supposed to be smaller than baz, sort of like this

10
9
8
7
6
5 (baz)
4
3 (foo)
2
1
0 (when the variable was created)

but what do we get? this!

i colour coded groups of values, green = how it's supposed to be, red = mistake #1, brown = mistake #2



since you clicked scratch cat BEFORE the cloud variable was loaded, it would've changed to 1, but then THE CLOUD VARIABLE loads, and overwrites that ONE to the old value, instead of adding one! this then breaks it for others using the project as well, if you're fast enough to click the cat before the cloud var loads, this is what happens, one way you could fix this is to add a wait 1 second block to the sprite clicked hat block, like this -
when this sprite clicked
wait (1) secs
change [☁ cloud v] by (1)
but then we have two problems now
(1) it would be a waste of one second for people who clicked the cat AFTER the cloud var was loaded
(2) it may not be enough for people with VERY slow internet connection, which may load it only after 2-3 seconds, or more!

so yes, this is a bug with scratch.

Last edited by Chiroyce (Aug. 24, 2021 05:56:13)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
Chiroyce
Scratcher
1000+ posts

Jumps

edited my post btw







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
Yusei-Fudo
Scratcher
1000+ posts

Jumps

Chiroyce wrote:

edited my post btw
Don't worry, I didn't see the original version

So IF I got what you mean, this is a bug with Scratch?

Thanks BTW!

I'm a decent coder who has a huge passion for coding. I taught myself all the coding skills I have now. And with those skills, I have made some pretty decent projects, check them out! Be sure to ⭐ ❤️ & Follow, too! I have a few pictures below which are actually links. Click on them to take to different projects that I made. Might come in handy. :)

Need a project where you can check to see if you can use someone's camera or not? Here's one:


Need a project to detect when someone has clicked the stop sign? Take a look at this:

Need a project that can point at specific clones, etc? Why not use this:


Need to prank someone? Tell them to click this picture, but also make sure they're signed onto Scratch, otherwise, it doesn't work:


For more of my projects, just click on this picture:
Chiroyce
Scratcher
1000+ posts

Jumps

Yusei-Fudo wrote:

So IF I got what you mean, this is a bug with Scratch?
What you got is probably not this - someone might've used a script or something to modify values.







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
Vadik1
Scratcher
500+ posts

Jumps

Chiroyce wrote:

Share it, …
Actually cloud variables work even in unshared projects.

Chiroyce wrote:

What you got is probably not this - someone might've used a script or something to modify values.
I think I know what other feature of cloud variables can be causing it. Since scratch 3 released, scratch team implemented a new limit for cloud variables: all cloud variables updates need to be at least 0.1 seconds apart from one another. Any cloud variable updates coming to scratch server faster than that will be ingored. It was done to reduce load on servers and network traffic, since every cloud variable update needs to be resent by scratch server to everyone else viewing the project.
So, if someone in that game increments their score too fast, server will skip many of the updates.

Another thing which makes this problem far worse is the way data is sent over the internet. The person clicking may send cloud variable updates with correct delay between each other, but somewhere along the way internet may be temporarily slow, and as the result scratch server may receive groups of multiple updates all at once, from which server will only consider valid the first ones and skipping the rest.

I mostly make 3D projects. Here are some of them:

han614698
Scratcher
1000+ posts

Jumps

Someone could easily code

change [☁cloud var v] by (17)

<Scratch Wikian | Forum Helper | 6000+ Posts>

Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why




Powered by DjangoBB