Discuss Scratch

AlfabetonsOfficial
Scratcher
100+ posts

"Query" blocks

No support, just use ask blocks.
mybearworld
Scratcher
1000+ posts

"Query" blocks

AlfabetonsOfficial wrote:

No support, just use ask blocks.
But it's not as intuitive. It'd be really annoying to be asked at the beginning of a project every single time.
JackK211424
Scratcher
500+ posts

"Query" blocks

ScolderCreations wrote:

mybearworld wrote:

ScolderCreations wrote:

Here's another question: what about websites that can run scratch projects, but have their own url parameters?
Again, in the embed link, the query should be included. It has nothing to do with the website's link.
I don't think you understood me. I'm not talking about embeds, I'm talking about scratch modifications, such as turbowarp.
What would happen is that you would have Turbowarp.org/xyz?q=query

That code for queries would work no matter the url. Thats how the window.location.search value works. It returns the query of the current url.

Last edited by JackK211424 (Oct. 8, 2021 19:23:18)

JackK211424
Scratcher
500+ posts

"Query" blocks

I made a mod for this here if anybody wants to take a look. It should work and seems to on my computer but I'm not sure. The blocks are in sensing.
SmartCat3
Scratcher
500+ posts

"Query" blocks

JackK211424 wrote:

I made a mod for this here if anybody wants to take a look. It should work and seems to on my computer but I'm not sure. The blocks are in sensing.
It does have the blocks, but it has no proper functionality
mybearworld
Scratcher
1000+ posts

"Query" blocks

SmartCat3 wrote:

JackK211424 wrote:

I made a mod for this here if anybody wants to take a look. It should work and seems to on my computer but I'm not sure. The blocks are in sensing.
It does have the blocks, but it has no proper functionality
…yes it does? https://potatojek.github.io/scratchqueryblocks/?q=hello%20world

One issue it has is a query like ?q=hello%2Fworld doesn't work - you should use “decodeURIComponent” to fix that. Otherwise - great job!
JackK211424
Scratcher
500+ posts

"Query" blocks

mybearworld wrote:

ou should use “decodeURIComponent” to fix that.
It does use decodeURI. I'm not sure why its not working for you.

Of course, this is just a prototype so I'm not going to try to fix it if it takes more then 20 minutes.

Last edited by JackK211424 (Oct. 9, 2021 13:28:25)

Jeffalo
Scratcher
1000+ posts

"Query" blocks

one thing that nobody seems to have mentioned is the desktop offline editor - how should this work when there is no query string?

i think a UI where you can edit them manually works good enough.
JackK211424
Scratcher
500+ posts

"Query" blocks

Jeffalo wrote:

one thing that nobody seems to have mentioned is the desktop offline editor - how should this work when there is no query string?

mybearworld wrote:

ScolderCreations wrote:

How would this work off-line
<query exists?::sensing> // is always false
(query::sensing)// is always blank
Just like the username block.

Although, your suggestion of manually editing them is actually a pretty good idea.

Last edited by JackK211424 (Oct. 9, 2021 14:33:22)

mybearworld
Scratcher
1000+ posts

"Query" blocks

JackK211424 wrote:

mybearworld wrote:

ou should use “decodeURIComponent” to fix that.
It does use decodeURI. I'm not sure why its not working for you.

Of course, this is just a prototype so I'm not going to try to fix it if it takes more then 20 minutes.
Try hello%2Fworld

https://potatojek.github.io/scratchqueryblocks/?q=hello%2Fworld
Are you sure you're using decodeURIComponent

Last edited by mybearworld (Oct. 9, 2021 17:30:47)

Reev0102
Scratcher
1000+ posts

"Query" blocks

Eh, semi-support. While this may be a cool feature and could be helpful while creating dictionaries, It may confuse some people.
SmartCat3
Scratcher
500+ posts

"Query" blocks

Jeffalo wrote:

one thing that nobody seems to have mentioned is the desktop offline editor - how should this work when there is no query string?

i think a UI where you can edit them manually works good enough.
The desktop offline editor wouldn't have them at all.
8-BitCoder_
New Scratcher
19 posts

"Query" blocks

no support
mybearworld
Scratcher
1000+ posts

"Query" blocks

8-BitCoder_ wrote:

no support
Why? These are forums, not a ballot box.
8-BitCoder_
New Scratcher
19 posts

"Query" blocks

What is a query
Prime689
Scratcher
1000+ posts

"Query" blocks

8-BitCoder_ wrote:

What is a query
It is a command prompting to extract data from a database.
8-BitCoder_
New Scratcher
19 posts

"Query" blocks

Too complicated for scratch

mybearworld wrote:

8-BitCoder_ wrote:

no support
Why? These are forums, not a ballot box.

Last edited by 8-BitCoder_ (Oct. 9, 2021 20:37:28)

mybearworld
Scratcher
1000+ posts

"Query" blocks

8-BitCoder_ wrote:

Too complicated for scratch

mybearworld wrote:

8-BitCoder_ wrote:

no support
Why? These are forums, not a ballot box.
It really isn't. it's just ?q=hello+world
Prime689
Scratcher
1000+ posts

"Query" blocks

8-BitCoder_ wrote:

Too complicated for scratch
I won't call it complicated… It is just vague.

For a normal scratcher, at first glance, it isn't intuitive that q stands for query, nor they would know it is part of the project, nor do they know what is a query. Another aspect to consider if we are going to think about users making their parameter names is that parameters can't recognize spaces.

Last edited by Prime689 (Oct. 9, 2021 23:11:09)

Queer_Royalty
Scratcher
1000+ posts

"Query" blocks

SmartCat3 wrote:

If the query/project was incorrect, it would do this:
think [error!] for (2) secs
THe rest would be the same
That is a good point. What would happen if the query weren't programmed? Would it return a 404 error or would that have to be coded, like
if <(query ::sensing)= []> then
go crazy ::motion
end

Powered by DjangoBB