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

#26 2010-08-04 11:52:23

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

can you adapt it to 1 thing please:

my variables are like:
List001
List002

can you make it to exclude them all please!


You can now reach me on Twitter @johnnydean1_

Offline

 

#27 2010-08-04 11:53:24

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

Here a slight thing:

Code:

hookupSensorNames
    | t1 t2 t3 t4 t5 |
    t5 _ 'distance'.
    t1 _ #('slider' 'light' 'sound' 'resistance' ).
    t1 _ t1 , #('-' 'tilt' 'distance' ).
    (t2 _ self ownerThatIsA: ScratchStageMorph) ifNotNil: [t2 scratchServer
            ifNotNil: 
                [t3 _ t2 scratchServer sensorNames.
                t3 size > 0 ifTrue: [^ t1 , {'-'} , t2 scratchServer sensorNames]]].
    t4 _ 1.
    t1 size
        timesRepeat: 
            [(t1 at: t4)
                = t5 ifTrue: [t1 at: t4 put: '-'].
            t4 _ t4 + 1].
    ^ t1

You can now reach me on Twitter @johnnydean1_

Offline

 

#28 2010-08-04 11:58:40

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

Hang on does not work with mesh!


You can now reach me on Twitter @johnnydean1_

Offline

 

#29 2010-08-04 13:00:23

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

hookupSensorNames
    | t1 t2 t3 t4 |
    t1 _ #('slider' 'light' 'sound' 'resistance' ).
    t1 _ t1 , #('-' 'tilt' 'distance' ).
    (t2 _ self ownerThatIsA: ScratchStageMorph) ifNotNil: [t2 scratchServer
            ifNotNil:
                [t3 _ t2 scratchServer sensorNames.
                t3 size > 0 ifTrue: [t1 _ t1 , {'-'} , t2 scratchServer sensorNames]]].
    t4 _ 1.
    t1 size
        timesRepeat:
            [((t1 at: t4) findSubStr: 'distance') > 0 ifTrue: [t1 at: t4 put: '-'].
            t4 _ t4 + 1].
    ^ t1

it should work with mesh now.
it was just a little tweak.
tell me if it does  smile

Last edited by LS97 (2010-08-05 11:45:28)

Offline

 

#30 2010-08-04 13:27:20

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

does this do the 000 001 002 thing


You can now reach me on Twitter @johnnydean1_

Offline

 

#31 2010-08-04 14:52:56

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

johnnydean1 wrote:

does this do the 000 001 002 thing

it should, but that code was from memory, so i mightve got somethng wrong.

tomorrow i'll post the mesh version

Offline

 

#32 2010-08-05 03:05:32

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

ok


You can now reach me on Twitter @johnnydean1_

Offline

 

#33 2010-08-05 11:46:29

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

edited my last post with code (reply number 29, this is #33).
use that code, it should work now.

Offline

 

#34 2010-08-05 14:05:14

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

I will check!


You can now reach me on Twitter @johnnydean1_

Offline

 

#35 2010-08-06 05:42:16

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

findSubString: is not working


You can now reach me on Twitter @johnnydean1_

Offline

 

#36 2010-08-06 06:03:22

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

Dont worry fixed, and I need 1 more thing wheres the code that shows the variables, so if I had variables
Hi
Hello

In the variables tab I have
(Hi)
(Hello)


Wheres the code?
And..

Wheres the code for the make list button?

Last edited by johnnydean1 (2010-08-06 06:04:05)


You can now reach me on Twitter @johnnydean1_

Offline

 

#37 2010-08-06 08:32:17

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

i'm not sure about what you're looking for. if you want to know what method creates the buttons, find it in ScriptableScratch > blocks > variablesPage. if you wan't to know what the code for creating a list look in ScriptableScratch > lists > addGlobalList

Offline

 

#38 2010-08-06 09:26:32

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

Ok Im looking for the list of variables under the variables tab.


You can now reach me on Twitter @johnnydean1_

Offline

 

#39 2010-08-06 10:33:23

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

it should be under 'variablespage'

Offline

 

#40 2010-08-07 04:35:11

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

wheres that?


You can now reach me on Twitter @johnnydean1_

Offline

 

#41 2010-08-07 04:48:25

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

I found it, but I need to mod its in the same way, to not show variables with List in them. How?


You can now reach me on Twitter @johnnydean1_

Offline

 

#42 2010-08-07 13:02:13

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

never looked at its code tbh.
let me see...

it's in addVariableReportersTo:x:y: actually.
try setting a new var to varNames and excluding ones named 'list'

Last edited by LS97 (2010-08-07 13:06:28)

Offline

 

#43 2010-08-07 14:38:17

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

Can you explain this further?


You can now reach me on Twitter @johnnydean1_

Offline

 

#44 2010-08-07 14:59:14

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: A little help

it's pretty hard. i tried, but i'm not sure how to remove an item from an array. sorry.

Offline

 

#45 2010-08-07 15:24:04

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: A little help

@nxiii Look Here!


You can now reach me on Twitter @johnnydean1_

Offline

 

Board footer