Discuss Scratch

  • Discussion Forums
  • » Advanced Topics
  • » Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside? [RSS Feed]
donotforgetmycode
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

If you're on a Scratch project with a variable or list that's hidden, is it possible to use Inspect Element to see the value of the variable/list?
Maximouse
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

I don't think that's possible on the Scratch website. If you run a project on TurboWarp, you can use the following code in the console to get values of all variables in the project:
for (let target of vm.runtime.targets) {
    for (let variable of Object.values(target.variables)) {
        console.log(`${target.sprite.name}: ${variable.name} = ${variable.value}`);
    }
}
donotforgetmycode
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

Maximouse wrote:

for (let target of vm.runtime.targets) {
for (let variable of Object.values(target.variables)) {
console.log(`${target.sprite.name}: ${variable.name} = ${variable.value}`);
}
}
thanks!
Sid72020123
Scratcher
500+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

You can also get project scripts in JSON format from the Scratch API and check those values…
I think…
donotforgetmycode
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

Sid72020123 wrote:

You can also get project scripts in JSON format from the Scratch API and check those values…
I think…
Not scripts, variable values
Sid72020123
Scratcher
500+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

donotforgetmycode wrote:

Sid72020123 wrote:

You can also get project scripts in JSON format from the Scratch API and check those values…
I think…
Not scripts, variable values
Oh. Sorry. I misread it as “script”
Chiroyce
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

I don't think this is a good idea to discuss this as it can be used against a project, like for setting high scores in a game while looking at the variables.
god286
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

Chiroyce wrote:

I don't think this is a good idea to discuss this as it can be used against a project, like for setting high scores in a game while looking at the variables.
Well we already are discussing about scratchclient and scratchconnect
Chiroyce
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

god286 wrote:

Well we already are discussing about scratchclient and scratchconnect
This is easier to do for the average scratcher…
god286
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

Chiroyce wrote:

This is easier to do for the average scratcher…
Anyone can make a website, gets username and password, then set any variable. I know one website that was going to be made, or maybe already exists, which does this. That website used the owner's account.

Last edited by god286 (April 4, 2022 06:06:48)

donotforgetmycode
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

completeness wrote:

This would work on the Scratch website:
const { vm } = document.getElementById('app')._reactRootContainer._internalRoot.current.child.pendingProps.store.getState().scratchGui;
for (const target of vm.runtime.targets) {
    for (const variable of Object.values(target.variables)) {
        console.log(`${target.sprite.name}: ${variable.name} = ${variable.value}`);
    }
}
thanks!

Last edited by donotforgetmycode (April 4, 2022 08:01:15)

zadyzad
Scratcher
2 posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

donotforgetmycode wrote:

completeness wrote:

This would work on the Scratch website:
const { vm } = document.getElementById('app')._reactRootContainer._internalRoot.current.child.pendingProps.store.getState().scratchGui;
for (const target of vm.runtime.targets) {
    for (const variable of Object.values(target.variables)) {
        console.log(`${target.sprite.name}: ${variable.name} = ${variable.value}`);
    }
}
thanks!
What does “vm” stand for in this script?
DifferentDance8
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

zadyzad wrote:

donotforgetmycode wrote:

completeness wrote:

This would work on the Scratch website:
const { vm } = document.getElementById('app')._reactRootContainer._internalRoot.current.child.pendingProps.store.getState().scratchGui;
for (const target of vm.runtime.targets) {
    for (const variable of Object.values(target.variables)) {
        console.log(`${target.sprite.name}: ${variable.name} = ${variable.value}`);
    }
}
thanks!
What does “vm” stand for in this script?
vm means scratch vm.
the thing that actually RUNS a scratch project
WojtekGame
Scratcher
1000+ posts

Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside?

DifferentDance8 wrote:

zadyzad wrote:

donotforgetmycode wrote:

completeness wrote:

This would work on the Scratch website:
const { vm } = document.getElementById('app')._reactRootContainer._internalRoot.current.child.pendingProps.store.getState().scratchGui;
for (const target of vm.runtime.targets) {
    for (const variable of Object.values(target.variables)) {
        console.log(`${target.sprite.name}: ${variable.name} = ${variable.value}`);
    }
}
thanks!
What does “vm” stand for in this script?
vm means scratch vm.
the thing that actually RUNS a scratch project
+1
and i think the user is new to scratchfoundation/llk's repos.

Sid72020123 wrote:

donotforgetmycode wrote:

Sid72020123 wrote:

You can also get project scripts in JSON format from the Scratch API and check those values…
I think…
Not scripts, variable values
Oh. Sorry. I misread it as “script”
i think the st has a endpoint for cloud vars but it's kinda hard to get some data out of it, unless there's a script.
  • Discussion Forums
  • » Advanced Topics
  • » Is it possible to use Inspect Element to see the values of a hidden list/variable in a Scratch project without pressing See Inside? [RSS Feed]

Powered by DjangoBB