How do you create new functions?
Offline
SciTecCf wrote:
It has a syntax error.
Change the encoding in notepad to ANSI
Unlike normal patches if you are using the Add patch tool
(If you installed it! )
Offline
LS97 wrote:
blob8108 wrote:
LS97 wrote:
Oh come on, I'm on holiday...
![]()
...you mean you don't do this for fun?
![]()
Of course I do, otherwise I wouldn't have done it in the first place
![]()
But it goes without saying that I prefer a swim in the pool or a day at the beach...
...are you sure you belong here? (Just kidding, of course...)
Offline
lallaway12 wrote:
broadcastv
That's actually a bug in the blocks plugin, I think. It's not in the list of bugs, though, for some reason...
Offline
The .cs isn't a download so I am confused. I tried filing in the code with the workspace, but it didn't work. All I get in the file list is the files in my Scratch folder.
Offline
Randomno wrote:
The .cs isn't a download so I am confused. I tried filing in the code with the workspace, but it didn't work. All I get in the file list is the files in my Scratch folder.
Well yeah, you can use the top left pane to navigate to the folder where you downloaded the CS file!
Offline
LS97 wrote:
Randomno wrote:
The .cs isn't a download so I am confused. I tried filing in the code with the workspace, but it didn't work. All I get in the file list is the files in my Scratch folder.
Well yeah, you can use the top left pane to navigate to the folder where you downloaded the CS file!
Like I said, the .cs file isn't a download.
Offline
Randomno wrote:
LS97 wrote:
Randomno wrote:
The .cs isn't a download so I am confused. I tried filing in the code with the workspace, but it didn't work. All I get in the file list is the files in my Scratch folder.
Well yeah, you can use the top left pane to navigate to the folder where you downloaded the CS file!
Like I said, the .cs file isn't a download.
Try saving the page...?
Offline
Well, saving the page worked. It doesn't say you have to do that, though.whenclicked
stop all soundssayforsqrt ▼ofvarsecssize ▼ofvar
Offline
Randomno wrote:
Well, saving the page worked. It doesn't say you have to do that, though.whenclicked
stop all soundssayforsqrt ▼ofvarsecssize ▼ofvar
I think it depends on the browser. Chrome automatically downloads it for me.
Offline
Bumping an awesome and useful topic
Offline
Excellent idea!
Offline
Thank you!
Offline
Very nice. I used it for the first time today.
The only problem i had with it was that it added some sort of weird line break, which got interpreted as two when i pasted it into an HTML TEXTAREA.
Offline
blob8108 wrote:
lallaway12 wrote:
broadcastvThat's actually a bug in the blocks plugin, I think. It's not in the list of bugs, though, for some reason...
Offline
scimonster wrote:
Very nice. I used it for the first time today.
![]()
The only problem i had with it was that it added some sort of weird line break, which got interpreted as two when i pasted it into an HTML TEXTAREA.
I think it has to do with your Operating system. I used Windows default CRLF...
Offline
LS97 wrote:
scimonster wrote:
Very nice. I used it for the first time today.
![]()
The only problem i had with it was that it added some sort of weird line break, which got interpreted as two when i pasted it into an HTML TEXTAREA.I think it has to do with your Operating system. I used Windows default CRLF...
I'm also using Windows. Perhaps your default is different then mine? Was it you who uses the AZERTY keyboard?
Offline
I found a bug...
when I receiveHTLoad ▼deleteall ▼ofHTArgs ▼deleteall ▼ofHTCommand ▼deleteall ▼ofHTVars ▼deleteall ▼ofLabel ▼deleteall ▼ofMy Code ▼seti ▼to0repeatlength ofCode ▼changei ▼by1setj ▼to1repeat untilchangej ▼by1ififandandletter=ofj+4itemiofCode ▼cletter=ofj+5itemiofCode ▼randletter=ofj+6itemiofCode ▼iletter=ofj+7itemiofCode ▼pifandandletter=ofj+8itemiofCode ▼tletter=ofj+9itemiofCode ▼:notandletter=ofj+10itemiofCode ▼mletter=ofj+11itemiofCode ▼aifnotandletter=ofj+12itemiofCode ▼tletter=ofj+13itemiofCode ▼hadditemtoiofCode ▼My Code ▼seti ▼to1hiderepeat untili>length ofMy Code ▼setj ▼to0repeat untilletter=jofitemiofMy Code ▼:changej ▼by1addtoHTCommand ▼changej ▼by1repeat until>orletter=jofitemiofMy Code ▼;orletter=jofitemiofMy Code ▼=]letter=jofitemiofMy Code ▼replace itemlast ▼ofHTCommand ▼withjoinitemlast ▼ofHTCommand ▼letterjofitemiofMy Code ▼changej ▼by1ifnot>]letter=jofitemiofMy Code ▼ifletter=jofitemiofMy Code ▼=changej ▼by1addtoLabel ▼repeat until>orletter=jofitemiofMy Code ▼;]letter=jofitemiofMy Code ▼replace itemlast ▼ofLabel ▼withjoinitemlast ▼ofLabel ▼letterjofitemiofMy Code ▼changej ▼by1elseaddtoLabel ▼changej ▼by1addtoHTArgs ▼settemp1 ▼to0repeat untilj>length of-itemiofMy Code ▼1ifletter=jofitemiofMy Code ▼;iftemp1=0addHT{end}toHTArgs ▼addtoHTCommand ▼addtoLabel ▼addtoHTArgs ▼addtoHTCommand ▼addtoLabel ▼elseifletter=jofitemiofMy Code ▼%iftemp1=0ifitem=last ▼ofHTArgs ▼replace itemlast ▼ofHTArgs ▼withHT{var}elseaddHT{var}toHTArgs ▼addtoHTCommand ▼addtoLabel ▼addtoHTArgs ▼addtoHTCommand ▼addtoLabel ▼settemp1 ▼to1elseifitem=last ▼ofHTArgs ▼replace itemlast ▼ofHTArgs ▼withHT{endVar}elseaddHT{endVar}toHTArgs ▼addtoHTCommand ▼addtoLabel ▼addtoHTArgs ▼addtoHTCommand ▼addtoLabel ▼settemp1 ▼to0elseifororboolOps ▼containsletterjofitemiofMy Code ▼logicOps ▼containsletterjofitemiofMy Code ▼orParen ▼containsletterjofitemiofMy Code ▼orletter=jofitemiofMy Code ▼!letter=jofitemiofMy Code ▼"ifitem=last ▼ofHTArgs ▼replace itemlast ▼ofHTArgs ▼withletterjofitemiofMy Code ▼elseaddlettertojofitemiofMy Code ▼HTArgs ▼addtoHTCommand ▼addtoLabel ▼addtoHTArgs ▼addtoHTCommand ▼addtoLabel ▼elsereplace itemlast ▼ofHTArgs ▼withjoinitemlast ▼ofHTArgs ▼letterjofitemiofMy Code ▼changej ▼by1iforitem>last ▼ofHTArgs ▼item=last ▼ofHTCommand ▼ifitem=last ▼ofHTArgs ▼replace itemlast ▼ofHTArgs ▼withHT{end}elseaddHT{end}toHTArgs ▼addtoHTCommand ▼addtoLabel ▼elseaddtoLabel ▼addtoHTArgs ▼changei ▼by1deleteall ▼ofHTRunStack ▼deleteall ▼ofHTRunStack_2 ▼deleteall ▼ofHTVars ▼deleteall ▼ofHTVarValues ▼deleteall ▼ofHTLiveObject:Name ▼deleteall ▼ofHTLiveObject:Type ▼deleteall ▼ofHTLiveObject:Args ▼deleteall ▼ofHTLiveObject:OldArgs ▼seti ▼to0setHTErrorLine ▼to0setisBoolean ▼to0repeat untili>length ofHTCommand ▼changei ▼by1ifitem=iofHTCommand ▼onLoadrepeat untilitem=iofHTCommand ▼end_onLoadchangei ▼by1elsebroadcastjoinand waitHTEval:itemiofHTCommand ▼
Offline
blob8108 wrote:
samtwheels wrote:
You should make one that imports scratchblocks code into scratch!
Again, I'm working on exactly that in Python.
It's quite complicated; a bit like writing a parser/compiler. The hardest part is dealing with booleans, because the less than/greater than symbol looks like the beginning/end of a boolean block:
Code:
if <(2)>(3)>I've managed to deal with this by learning how proper parsers work, though.
The way the forum plugin does it is by replacing
) > ( with ) > (, ) < ( with ) < (, ] > [ with ] > [, ] > ( with ] &lgt; (, and so on thit all the possible combinations of ] or ) followed by < or > followed by [ or (
Offline
scimonster wrote:
LS97 wrote:
scimonster wrote:
Very nice. I used it for the first time today.
![]()
The only problem i had with it was that it added some sort of weird line break, which got interpreted as two when i pasted it into an HTML TEXTAREA.I think it has to do with your Operating system. I used Windows default CRLF...
I'm also using Windows. Perhaps your default is different then mine? Was it you who uses the AZERTY keyboard?
Yeah, that's me, but the keyboard has absolutely no effect on line breaks. Are you using Firefox? Maybe it uses different standards of breaking lines...
@Mathwizz: LOL, I doubt anybody will need to paste all that code on the forums... besides, is the bug in my plugin or in the parser?
Offline
Testing this. (BTW perfect platformer script above XD)whenclicked
go to x:0y:-90setxv ▼to0setyv ▼to0foreversetbleh ▼to0ifkeyleft arrow ▼pressed?changexv ▼by-0.7ifkeyright arrow ▼pressed?changexv ▼by0.7setxv ▼toxv*0.9change x byxviftouching color ?change y by1changebleh ▼by1iftouching color ?change y by1changebleh ▼by1iftouching color ?change y by1changebleh ▼by1iftouching color ?change y by1changebleh ▼by1iftouching color ?change y by1changebleh ▼by1iftouching color ?change x byxv*-1setxv ▼to0change y by-5ifkeyup arrow ▼pressed?change x by5setc n ▼to-5iftouching color ?setxv ▼to-10setyv ▼to12elsechange x by-10setc n ▼to5iftouching color ?setxv ▼to10setyv ▼to12change x byc nelsechangexv ▼by0-xv/blehelsesetyv ▼toyv*0.9change y byyviftouching color ?change y byyv*-1setyv ▼to0change y by-1ifkeyup arrow ▼pressed?iftouching color ?setyv ▼to12change y by1ifyv<4change y by-1ifnottouching color ?changeyv ▼by-1change y by1
Offline
Wow, this is really impressive LS97! Quite a useful plugin to have - kudos to you for making it. I hope the Scratch Team adds something like this to Scratch 2.0! Here's a brief test with one of my projects I made to practice vocabulary:
I can't see any problems (except for some graphical issues with the plugin itself). One thing I noticed is that all of the blocks are spaced out with a line in between each other - which although a bit of a hassle to remove, it still gets the job done.whenclicked
deleteall ▼ofLog ▼deleteall ▼ofwordsleft ▼addTo use this program, you will type in a vocabulary word, given the definition.toLog ▼addSpelling does count!toLog ▼addYou will need to successfully need to identify each word TWO times minimum in order to remove it from the list of words to do.toLog ▼addIf you get a word wrong, if you previously had to complete it four times, than you would afterwards have to do it 5 times.toLog ▼addThis helps you study the words you need most help with.toLog ▼addPress enter to continue.toLog ▼askand waitaddLoading...toLog ▼repeat2seti ▼to1repeatlength ofenglish ▼additowordsleft ▼changei ▼by1seti ▼topick random1tolength ofwordsleft ▼repeat untillength of=wordsleft ▼0addjointojoinWhat word means "itemitemofiofwordsleft ▼spanish ▼?"Log ▼askand waitifitem=itemofiofwordsleft ▼english ▼answeraddjointojoinjoinjoinGood job! "itemitemofiofwordsleft ▼english ▼" means "itemitemofiofwordsleft ▼spanish ▼." Press enter to continue.Log ▼askand waitdeleteiofwordsleft ▼elseaddjointojoinjoinjoinSorry, the word "itemitemofiofwordsleft ▼english ▼" means "itemitemofiofwordsleft ▼spanish ▼." Press enter to continue.Log ▼askand waitadditemtoiofwordsleft ▼wordsleft ▼seti ▼topick random1tolength ofwordsleft ▼addYou have completed the program.toLog ▼
Offline
Thanks for your opinions and tests, guys!
It seems to me that the last two scripts were converted perfectly by the plugin. The blank ask block in Lucario's script left me perplexed, but I figure it's also done in the original script (which makes sense, since it looks nicer).
This spacing issue has already been reported by scimonster. What browsers are you guys using? In any case remember blank lines don't actually affect the renderer, so blocks get parsed anyway.
Having such feature in Scratch 2.0 (as well as vice versa -- copying the text of a scratchblocks into Scratch, which I would happily create a plugin for too if it weren't for its current futility for reasons stated at asterisk*) would really be nice. You guys, being mods, don't happen to have any news/influence on this matter?
*Asterisk. I would have created a plugin to parse scratchblocks code and spawn a script, but I found the costs outweighed the benefits. This is because the user that wants the scratchblocks code must either view the wiki source or quote the forum user to get raw code, as selecting the text of the blocks and copying that instead does not work.
However, I thought of a mechanism that would allow such copying supported by all browsers. Shouldn't it be possible to hide brackets and other symbols used in scratchblocks code as invisible text in the rendered version? That way it wouldn't affect viewing, but would be copied when selected.
Anyway, that was a way too long footnote.
Offline
You're welcome Another test:
A binary to image converter me and my friend made
whenclicked
deleteall ▼of#'s ▼clearsetbrightness ▼effect to0go to x:96y:104stamprepeat9change x by4stamprepeat9change y by-4stamprepeat9change x by-4stamprepeat9change y by4stampaskInput #and waitsetInput # ▼toanswersetteh number ▼to2if=answermod21add1to#'s ▼elseadd0to#'s ▼repeat63if=roundmod-answer/teh number0.521add1to#'s ▼elseadd0to#'s ▼setteh number ▼toteh number*2go to x:100y:100ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼change y by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼repeat7change x by-4ifitem=1 ▼of#'s ▼1setbrightness ▼effect to100stampelsesetbrightness ▼effect to-100delete1 ▼of#'s ▼go to x:96y:104setbrightness ▼effect to0
Offline