This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-10-27 17:04:31

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Help with 'forever'

I'm making an OS, and I want to know who I can create a script that never stops working but doesn't generate infinite results.

Ex:

(forever)
(If <mouse down?>)
(Do whatever)
(end if)
(end forever)

And I only want it to ALWAYS respond, not do what I want it to do when it responds forever.

Some help please? :/

Last edited by JeanTheFox (2010-10-27 17:04:38)


http://i51.tinypic.com/20gcn5j.png

Offline

 

#2 2010-10-27 17:52:25

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: Help with 'forever'

add a repeat until <whatever>

Offline

 

#3 2010-10-27 17:53:57

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

Re: Help with 'forever'

Or you could do <forever><if> <{  }> <(  <=>  )> 1 <<  <and>  >> <mouse down?>

Last edited by recycle49 (2010-10-27 17:54:16)


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#4 2010-10-27 18:56:26

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: Help with 'forever'

Could you guys explain a bit more?

And laser100, I already do have a repeat until block.


http://i51.tinypic.com/20gcn5j.png

Offline

 

#5 2010-10-27 22:21:21

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Help with 'forever'

I think you mean something like this:

Forever
  If (mouse down?)
    If (check=0)
    do this thing you wanted it to do
    set check to 1
    end if
  Else
    set check to 0
  end if
end forever

I think that should work.

Last edited by AtomicBawm3 (2010-10-27 22:21:37)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#6 2010-10-28 04:48:55

2l84zwamani
Scratcher
Registered: 2010-09-27
Posts: 100+

Re: Help with 'forever'

Or you can add a wait until mouse down? block.


I will be a Ms. Pickle Dr. Deadpebble Great Person <forever>
http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3 GROB THE SLIME WILL TAKE OVER THE WORLD!

Offline

 

#7 2010-10-28 07:41:47

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Help with 'forever'

http://img263.imageshack.us/img263/1483/69631744.gif

Like that?


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#8 2010-10-28 07:53:21

chipguy
Scratcher
Registered: 2009-09-09
Posts: 500+

Re: Help with 'forever'

you can make a variable called click or something, set it to zero in the begginning, and set it to one after you clicked. pluse make it:
if clicked=0
if mouse down and touching___
do_______
set clicked to 1

see! it will stop working, and go back on if you set "clicked" to 0!


http://scratch.mit.edu/static/projects/chipguy/2919121_sm.png by yours truly  big_smile

Offline

 

#9 2010-10-28 07:54:52

chipguy
Scratcher
Registered: 2009-09-09
Posts: 500+

Re: Help with 'forever'

chipguy wrote:

you can make a variable called click or something, set it to zero in the begginning, and set it to one after you clicked. pluse make it:
if clicked=0
if mouse down and touching___
do_______
set clicked to 1

see! it will stop working, and go back on if you set "clicked" to 0!

woops! didn't see atomicbawm3's idea! didn't mean to look like i copied!


http://scratch.mit.edu/static/projects/chipguy/2919121_sm.png by yours truly  big_smile

Offline

 

Board footer