Discuss Scratch
- mybearworld
-
Scratcher
1000+ posts
"Query" blocks
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
What would happen is that you would have Turbowarp.org/xyz?q=queryI don't think you understood me. I'm not talking about embeds, I'm talking about scratch modifications, such as turbowarp.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.
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.
- mybearworld
-
Scratcher
1000+ posts
"Query" blocks
…yes it does? https://potatojek.github.io/scratchqueryblocks/?q=hello%20worldI 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
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
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.
i think a UI where you can edit them manually works good enough.
- JackK211424
-
Scratcher
500+ 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?
Just like the username block.How would this work off-line<query exists?::sensing> // is always false
(query::sensing)// is always blank
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
Try hello%2Fworldou 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.

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
one thing that nobody seems to have mentioned is the desktop offline editor - how should this work when there is no query string?The desktop offline editor wouldn't have them at all.
i think a UI where you can edit them manually works good enough.
- Prime689
-
Scratcher
1000+ posts
"Query" blocks
What is a queryIt is a command prompting to extract data from a database.
- 8-BitCoder_
-
New Scratcher
19 posts
"Query" blocks
Too complicated for scratch
no supportWhy? These are forums, not a ballot box.
Last edited by 8-BitCoder_ (Oct. 9, 2021 20:37:28)
- mybearworld
-
Scratcher
1000+ posts
"Query" blocks
Too complicated for scratchIt really isn't. it's just ?q=hello+worldno supportWhy? These are forums, not a ballot box.
- Prime689
-
Scratcher
1000+ posts
"Query" blocks
Too complicated for scratchI 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
If the query/project was incorrect, it would do this: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, likethink [error!] for (2) secsTHe rest would be the same
if <(query ::sensing)= []> then
go crazy ::motion
end







