Pecola1 wrote:
zippynk wrote:
scimonster wrote:
I think you mean cap.No, because a cap would stop the script. This would stop all scripts Except for the current one.
LOL never thought of that.
Me either. XD
Offline
This block is for replicating one list Onto and not Into another list.
Block Picture:
Download Sprite:
Download This Block As A BYOB Sprite (.ysp)
Source Code:
Note: At some point the links may break in some way. If so, I'll try to fix it.
Update: For the download, if it asks you, it's ok to "click here to download your attachment".
Last edited by zippynk (2011-11-02 23:19:39)
Offline
I have an idea, one of the first posts should have the newest 5 blocks added, this way we can tell when there is a new block added, but only once it is actually added, this would catch attention, for all I know there hasn't been any added since i left for vacation, i haven't seen the new ones, it would be like:
Shared by MarioBlender
Shared by MathWizz
Shared by jslomba
Shared by Pecola1
Shared by Pecola1
No new blocks.
No new blocks.
Offline
Hey sparks, I seem to have forgotten the pass for YourLocalBlockLib, can you email me it? Do you have my email? If not I can send you one. I will tell you a clue of what the password is because I slightly remember it, that way you know its really me.
Offline
sparks wrote:
log in here with your account to view the password, Pecola
I knew it was something like that. XD Thanks.
Offline
plb36 wrote:
where do you paste "code" in the system browser on scratch. i have already done blockspecs but now i am confused...
See if this post helps you.
Offline
Pecola1 wrote:
I have an idea, one of the first posts should have the newest 5 blocks added, this way we can tell when there is a new block added, but only once it is actually added, this would catch attention, for all I know there hasn't been any added since i left for vacation, i haven't seen the new ones, it would be like:
http://scratch.mit.edu/redirect/url?lin … 942334.gif
http://scratch.mit.edu/redirect/url?lin … KfDfw=s512
Shared by MarioBlender
http://scratch.mit.edu/redirect/url?lin … 603304.gif
Shared by MathWizz
http://scratch.mit.edu/redirect/url?lin … 212093.gif
Shared by jslomba
http://scratch.mit.edu/redirect/url?lin … 534017.gif
Shared by Pecola1
http://scratch.mit.edu/redirect/url?lin … 685631.gif
Shared by Pecola1
http://scratch.mit.edu/redirect/url?lin … 732043.gif
No new blocks.
http://scratch.mit.edu/redirect/url?lin … 967135.gif
No new blocks.
Just click the link to the latest update.
Offline
Yes, but I mean for blocks. The recent update is saying there is a new librarian. (you know who )
Offline
Pecola1 wrote:
Yes, but I mean for blocks. The recent update is saying there is a new librarian. (you know who )
Yes, but I don't think that happens very often. Maybe a link for "newest ____ update" at the beginning of each section?
Offline
Greenatic wrote:
Pecola1 wrote:
Yes, but I mean for blocks. The recent update is saying there is a new librarian. (you know who )
Yes, but I don't think that happens very often. Maybe a link for "newest ____ update" at the beginning of each section?
Yea... That way it would show the newest updates, but for each category.
Offline
2 new byob blocks:
The swap block swaps all of the items in 2 lists. The for block works just like the for loop in C++ and Javascript. Here is the code:
Edit: oops i forgot in the swap block: before the second repeat loop you need to put in |delete (all) of (other list)|
Last edited by joefarebrother (2011-11-07 15:49:19)
Offline
jernsuz wrote:
<when green flag clicked><wait( -1 )secsc><switch to costume[
Why won't it work? It should.
Jernsuz, if you're asking why that script won't work, then this isn't the place. Try making a thread in All About Scratch.
To answer your question, though, I believe negative numbers register as "0" in the wait block. Try telling it to wait 1 second, not -1 seconds.
Offline
I'm going to post this block here just in case someone manages an update before I do.
Takes a note (i.e. C4) and turns it into a MIDI note (compatible with the note-playing blocks). Use a number sign (#) for sharps and a lowercase B (b) for flats. Obscure/rarely used notes such as Cb and E# are accepted.
('%s%n as MIDI note' #r #AsMIDINote:Num:) AsMIDINote: t1 Num: t2 | t3 t4 | (t1 size) > 2 ifTrue:[^ 0]. [(#('C' 'D' 'E' 'F' 'G' 'A' 'B') detect: [:t6| t6 = (t1 at: 1) asString])] ifError:[^ 0]. t1 size = 2 ifTrue:[ [(#('#' 'b') detect: [:t7| t7 = (t1 at: 2) asString])] ifError:[^ 0]]. t4 _ 1. (#('C' 'D' 'E' 'F' 'G' 'A' 'B')) do:[:t5| t5 = (t1 at: 1) asString ifTrue:[ t3 _ ((#('12' '14' '16' '17' '19' '21' '23') at: t4) asNumber)]. t4 _ t4 + 1]. t1 size = 2 ifTrue:[ (t1 at: 2) asString = '#' ifTrue:[ t3 _ t3 + 1]. (t1 at: 2) asString = 'b' ifTrue:[ t3 _ t3 - 1]]. (t2 abs) timesRepeat:[ t3 _ t3 + ((t2 / t2 abs) * 12)]. ^ t3
Offline
I need some other people's opinions. I have now made a |Google I'm Feeling Lucky for: [ ]| block. Should I keep this as its own block or fuse it into |[google v] [ ]|?
Offline
Greenatic wrote:
I need some other people's opinions. I have now made a |Google I'm Feeling Lucky for: [ ]| block. Should I keep this as its own block or fuse it into |[google v] [ ]|?
Merge. Update.
Offline
scimonster wrote:
Greenatic wrote:
I need some other people's opinions. I have now made a |Google I'm Feeling Lucky for: [ ]| block. Should I keep this as its own block or fuse it into |[google v] [ ]|?
Merge. Update.
Looks like the tables have turned... *dramatic music* XD
What is your opinion on the two gigantic list blocks, here? They fused many blocks together, but do you think these two blocks should be fused together too?
@Sparks: Are you going to remove that page where I logged in to get the password?
Last edited by Greenatic (2011-11-08 10:35:49)
Offline
The code for the I'm Feeling Lucky is:
ScratchPlugin primOpenURL: 'http://google.com/search?sourceid=navclient&btnI=1&q=', t2, '+%s'.
New Block:
('%X for %s' #r #Weather:For:)
Method:
Weather: t2 For: t1 | t3 t4 t5 t6 t7 | t3 _ #() asOrderedCollection. t7 _ #() asOrderedCollection. t4 _ (HTTPSocket httpGet: 'http://www.google.com/ig/api?weather=' , t1) contents. t5 _ 1. [t5 > t4 size] whileFalse: [[(t4 at: t5) asString = '<'] whileFalse: [t5 _ t5 + 1]. t6 _ t5 + 1. [(t4 at: t6) asString = '>'] whileFalse: [t6 _ t6 + 1]. t3 add: (t4 copyFrom: t5 to: t6). t4 _ t4 copyFrom: t6 + 1 to: t4 size]. 13 timesRepeat: [t3 removeAt: 1]. 31 timesRepeat: [t3 removeAt: t3 size]. t3 removeAt: t3 size - 1. t3 do: [:t9 | t7 add: (t9 copyFrom: (t9 findString: '"' startingAt: 1) + 1 to: (t9 findString: '"' startingAt: (t9 findString: '"' startingAt: 1) + 1) - 1)]. t7 at: 4 put: ((t7 at: 4) copyFrom: 11 to: (t7 at: 4) size). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: ' ') + 1 to: ((t7 at: 5) findString: 'a') - 2). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: 't') + 2 to: ((t7 at: 5) findString: 'm') - 2). t7 removeAt: 5. t4 _ 1. #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' ) do: [:t10 | t10 = t2 ifTrue: [^ t7 at: t4]. t4 _ t4 + 1]
ScriptableScratchMorph > sensing ops
weatherMenu ^ #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' )
Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
$X = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #weatherMenu; choice: 'weather'].
Offline
The request inspired me to make 6 new blocks (including it):
A "bubble" counts as: asking while shown, saying, or thinking.
('bubble showing?' #b #BubbleShowing) BubbleShowing ^ (self findA: (ScratchTalkBubbleMorph)) ~= nil
('bubble saying %s showing?' #b #BubbleSaying:) BubbleSaying: t1 (self findA: (ScratchTalkBubbleMorph)) ~= nil ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) message = t1 ifTrue:[ ^ true]]. ^ false
The following blocks require the following new method:
Scratch-UI-Support > ScratchTalkBubbleMorph > accessing
leftPointerForm ^ leftPointerForm
('saying something?' #b #SayingSomething) SayingSomething (self findA: (ScratchTalkBubbleMorph)) ~= nil ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) leftPointerForm = (ScratchFrameMorph skinAt: #talkBubbleTalkPointer) ifTrue:[^ true]]. ^ false
(Requested)
('saying %s?' #b #Saying:) Saying: t1 (self findA: (ScratchTalkBubbleMorph)) ~= nil ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) leftPointerForm = (ScratchFrameMorph skinAt: #talkBubbleTalkPointer) ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) message = t1 ifTrue:[^ true]]]. ^ false
('thinking something?' #b #ThinkingSomething:) ThinkingSomething (self findA: (ScratchTalkBubbleMorph)) ~= nil ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) leftPointerForm = (ScratchFrameMorph skinAt: #talkBubbleThinkPointer) ifTrue:[^ true]]. ^ false
('thinking %s?' #b #Thinking:) Thinking: t1 (self findA: (ScratchTalkBubbleMorph)) ~= nil ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) leftPointerForm = (ScratchFrameMorph skinAt: #talkBubbleThinkPointer) ifTrue:[ (self findA: (ScratchTalkBubbleMorph)) message = t1 ifTrue:[^ true]]]. ^ false
Offline
Greenatic wrote:
The code for the I'm Feeling Lucky is:
Code:
ScratchPlugin primOpenURL: 'http://google.com/search?sourceid=navclient&btnI=1&q=', t2, '+%s'.New Block:
http://www.freewebs.com/polyeztahpuppies/weatherfor.gifCode:
('%X for %s' #r #Weather:For:)Method:
Code:
Weather: t2 For: t1 | t3 t4 t5 t6 t7 | t3 _ #() asOrderedCollection. t7 _ #() asOrderedCollection. t4 _ (HTTPSocket httpGet: 'http://www.google.com/ig/api?weather=' , t1) contents. t5 _ 1. [t5 > t4 size] whileFalse: [[(t4 at: t5) asString = '<'] whileFalse: [t5 _ t5 + 1]. t6 _ t5 + 1. [(t4 at: t6) asString = '>'] whileFalse: [t6 _ t6 + 1]. t3 add: (t4 copyFrom: t5 to: t6). t4 _ t4 copyFrom: t6 + 1 to: t4 size]. 13 timesRepeat: [t3 removeAt: 1]. 31 timesRepeat: [t3 removeAt: t3 size]. t3 removeAt: t3 size - 1. t3 do: [:t9 | t7 add: (t9 copyFrom: (t9 findString: '"' startingAt: 1) + 1 to: (t9 findString: '"' startingAt: (t9 findString: '"' startingAt: 1) + 1) - 1)]. t7 at: 4 put: ((t7 at: 4) copyFrom: 11 to: (t7 at: 4) size). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: ' ') + 1 to: ((t7 at: 5) findString: 'a') - 2). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: 't') + 2 to: ((t7 at: 5) findString: 'm') - 2). t7 removeAt: 5. t4 _ 1. #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' ) do: [:t10 | t10 = t2 ifTrue: [^ t7 at: t4]. t4 _ t4 + 1]ScriptableScratchMorph > sensing ops
Code:
weatherMenu ^ #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' )Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
Code:
$X = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #weatherMenu; choice: 'weather'].
I remember these in NetScratch! They are some VERY cool blocks.
Offline
Pecola1 wrote:
Greenatic wrote:
The code for the I'm Feeling Lucky is:
Code:
ScratchPlugin primOpenURL: 'http://google.com/search?sourceid=navclient&btnI=1&q=', t2, '+%s'.New Block:
http://www.freewebs.com/polyeztahpuppies/weatherfor.gifCode:
('%X for %s' #r #Weather:For:)Method:
Code:
Weather: t2 For: t1 | t3 t4 t5 t6 t7 | t3 _ #() asOrderedCollection. t7 _ #() asOrderedCollection. t4 _ (HTTPSocket httpGet: 'http://www.google.com/ig/api?weather=' , t1) contents. t5 _ 1. [t5 > t4 size] whileFalse: [[(t4 at: t5) asString = '<'] whileFalse: [t5 _ t5 + 1]. t6 _ t5 + 1. [(t4 at: t6) asString = '>'] whileFalse: [t6 _ t6 + 1]. t3 add: (t4 copyFrom: t5 to: t6). t4 _ t4 copyFrom: t6 + 1 to: t4 size]. 13 timesRepeat: [t3 removeAt: 1]. 31 timesRepeat: [t3 removeAt: t3 size]. t3 removeAt: t3 size - 1. t3 do: [:t9 | t7 add: (t9 copyFrom: (t9 findString: '"' startingAt: 1) + 1 to: (t9 findString: '"' startingAt: (t9 findString: '"' startingAt: 1) + 1) - 1)]. t7 at: 4 put: ((t7 at: 4) copyFrom: 11 to: (t7 at: 4) size). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: ' ') + 1 to: ((t7 at: 5) findString: 'a') - 2). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: 't') + 2 to: ((t7 at: 5) findString: 'm') - 2). t7 removeAt: 5. t4 _ 1. #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' ) do: [:t10 | t10 = t2 ifTrue: [^ t7 at: t4]. t4 _ t4 + 1]ScriptableScratchMorph > sensing ops
Code:
weatherMenu ^ #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' )Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
Code:
$X = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #weatherMenu; choice: 'weather'].I remember these in NetScratch! They are some VERY cool blocks.
They were in NetScratch? ...Sorry if it looks like I copied, I promise I came up with this block and its code on my own.
Offline
Greenatic wrote:
Pecola1 wrote:
Greenatic wrote:
The code for the I'm Feeling Lucky is:
Code:
ScratchPlugin primOpenURL: 'http://google.com/search?sourceid=navclient&btnI=1&q=', t2, '+%s'.New Block:
http://www.freewebs.com/polyeztahpuppies/weatherfor.gifCode:
('%X for %s' #r #Weather:For:)Method:
Code:
Weather: t2 For: t1 | t3 t4 t5 t6 t7 | t3 _ #() asOrderedCollection. t7 _ #() asOrderedCollection. t4 _ (HTTPSocket httpGet: 'http://www.google.com/ig/api?weather=' , t1) contents. t5 _ 1. [t5 > t4 size] whileFalse: [[(t4 at: t5) asString = '<'] whileFalse: [t5 _ t5 + 1]. t6 _ t5 + 1. [(t4 at: t6) asString = '>'] whileFalse: [t6 _ t6 + 1]. t3 add: (t4 copyFrom: t5 to: t6). t4 _ t4 copyFrom: t6 + 1 to: t4 size]. 13 timesRepeat: [t3 removeAt: 1]. 31 timesRepeat: [t3 removeAt: t3 size]. t3 removeAt: t3 size - 1. t3 do: [:t9 | t7 add: (t9 copyFrom: (t9 findString: '"' startingAt: 1) + 1 to: (t9 findString: '"' startingAt: (t9 findString: '"' startingAt: 1) + 1) - 1)]. t7 at: 4 put: ((t7 at: 4) copyFrom: 11 to: (t7 at: 4) size). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: ' ') + 1 to: ((t7 at: 5) findString: 'a') - 2). t7 add: ((t7 at: 5) copyFrom: ((t7 at: 5) findString: 't') + 2 to: ((t7 at: 5) findString: 'm') - 2). t7 removeAt: 5. t4 _ 1. #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' ) do: [:t10 | t10 = t2 ifTrue: [^ t7 at: t4]. t4 _ t4 + 1]ScriptableScratchMorph > sensing ops
Code:
weatherMenu ^ #('weather' 'temp F' 'temp C' 'humidity' 'wind direction' 'wind speed' )Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
Code:
$X = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #weatherMenu; choice: 'weather'].I remember these in NetScratch! They are some VERY cool blocks.
They were in NetScratch? ...Sorry if it looks like I copied, I promise I came up with this block and its code on my own.
No no no no no, I can tell you didn't copy it. I think NetScratch used the same type of thing as the time block, either that or an api, your block uses a different source, and more things to insert. I like blocks like this.
Last edited by Pecola1 (2011-11-08 20:06:35)
Offline