Discuss Scratch

gdfsgdfsgdfg
Scratcher
1000+ posts

When <> is not true block

Xcvfdd wrote:

No support. The workaround is easy:
<not <key [ v] pressed?>>
Or
forever
if <not <key [ v] pressed?>> then

end
end

_ProjectDev wrote:

when green flag clicked
forever
if <not <[x] = [y]>> then
...
end

BrodyTheRedflower wrote:

No support, do this easy workaround
when green flag clicked
forever
if <[thing] = <not <thing>>> then
...

end
end


These workarounds will stop if the stop sign is clicked or the stop block


When is true is a block that cant be stopped
when [timer v] > ((timer) - <…>)

Last edited by gdfsgdfsgdfg (Dec. 8, 2022 20:56:54)

gdfsgdfsgdfg
Scratcher
1000+ posts

When <> is not true block

GUYWHOLOVESCODE wrote:

A lot of people ignored the fact that you're asking for an Events block. My suggestion for the workaround:
when green flag clicked
wait until <not < > >
and then the code meant to happen here. Do you want it to wait until a broadcast is sent to start checking?
when I receive [ v]
wait until <not <>>
That's really all I got for you.

owlover2010 wrote:

I like the idea, but events blocks are already slow. I would use this workaround:

when green flag clicked
forever
if <> then
...
end
end

I do not give support for this suggestion.


same for these
An0therRand0mC0der
Scratcher
1000+ posts

When <> is not true block

gdfsgdfsgdfg wrote:

These workarounds will stop if the stop sign is clicked or the stop block
How can something become true or false while the project is stopped? The project needs to be running for a certain condition to be met.

Last edited by An0therRand0mC0der (Dec. 8, 2022 21:23:52)

-Valtren-
Scratcher
1000+ posts

When <> is not true block

gdfsgdfsgdfg wrote:

These workarounds will stop if the stop sign is clicked or the stop block
isn't that the point? the stop sign is supposed to stop all scripts.
SavetheAtlantic
Scratcher
1000+ posts

When <> is not true block

An0therRand0mC0der wrote:

gdfsgdfsgdfg wrote:

These workarounds will stop if the stop sign is clicked or the stop block
How can something become true or false while the project is stopped? The project needs to be running for a certain condition to be met.
Not true at all. You can have projects function that doesn't use the green flag entirely using the other hat blocks. The hat blocks always check if their condition is met after the project is started; after that, the stop button doesn't do anything. This normally is not a problem since they're all really basic things like whether the timer is greater than a certain value or a key is pressed, but allowing any boolean value to be checked if this block were added would lead to major issues. For example, if a variable is greater than five, you could run some code that crucially does not change that variable's value to be less than five, creating code that can never be stopped.

Last edited by SavetheAtlantic (Dec. 9, 2022 07:21:37)

gdfsgdfsgdfg
Scratcher
1000+ posts

When <> is not true block

bump

Powered by DjangoBB