Right, so my class is having a competition on who can make the best cutom blok, but my teacher said we can't use any of the online blocks, and it looks like she's blocked pretty much everything. I have NO idea of squeak stuff and I came up with...
Get IP Adress!!
But this is what i wrote:
Get IP Adress t1:
t1 = getIPadress
None of the tutorials I have seen have helped so it would be really nice if someone told me how, not do it for me.
Offline
TornFusion wrote:
Right, so my class is having a competition on who can make the best cutom blok, but my teacher said we can't use any of the online blocks, and it looks like she's blocked pretty much everything. I have NO idea of squeak stuff and I came up with...
Get IP Adress!!
But this is what i wrote:
Get IP Adress t1:
t1 = getIPadress
None of the tutorials I have seen have helped so it would be really nice if someone told me how, not do it for me.
Its a reporter right? Well, if it is, that method doesn't return a value, so add
^ variable
where variable is the thing you want the block to report.
Does this help?

Offline
not really, i am 10, she's just pushing us, and Im the most experienced person in my class. By the way, I have no idea what you're talking about, upload a pic.
Offline
Off the top of my head, I don't know how to get the IP address myself, so I coudln't give you a hint in that direction.
If you want to make a reporter block, it has to actually return something in the method itself. To do this you need to add the ^ sign, then put what you want to return after it.
Also I don't think you need the t1, so remove the t1 in the top line, and then put that code you've got after the ^ sign to return it.
Is that better? I could write a fully blown explanation on how to make a block if you like. When have you got to do this by?

Offline
Sperry wrote:
Off the top of my head, I don't know how to get the IP address myself, so I coudln't give you a hint in that direction.
If you want to make a reporter block, it has to actually return something in the method itself. To do this you need to add the ^ sign, then put what you want to return after it.
Also I don't think you need the t1, so remove the t1 in the top line, and then put that code you've got after the ^ sign to return it.
Is that better? I could write a fully blown explanation on how to make a block if you like. When have you got to do this by?
Monday, If I do it, I get to represent my school on who can make the best scratch project, if I win I get put on the school's hall of fame and win the school £1,000 so it's pretty important. I just made a previous costume without looking at anyone blocks, but I could use a fully blown explanation.
Offline
this is.... odd. You're 10 and your teacher is making you code your own blocks?! most 10 year olds just about stick the blocks together... What are you doing this in? Scratch itself or a modification like BYOB or Panther?
Last edited by sparks (2010-10-01 16:14:03)
Offline
TornFusion wrote:
Sperry wrote:
Off the top of my head, I don't know how to get the IP address myself, so I coudln't give you a hint in that direction.
If you want to make a reporter block, it has to actually return something in the method itself. To do this you need to add the ^ sign, then put what you want to return after it.
Also I don't think you need the t1, so remove the t1 in the top line, and then put that code you've got after the ^ sign to return it.
Is that better? I could write a fully blown explanation on how to make a block if you like. When have you got to do this by?Monday, If I do it, I get to represent my school on who can make the best scratch project, if I win I get put on the school's hall of fame and win the school £1,000 so it's pretty important. I just made a previous costume without looking at anyone blocks, but I could use a fully blown explanation.
I'll write one tomorrow on how to make blocks, and it will have some examples, because I've got to go to bed now, I'm pretty tired after a long week.
What time zone are you in? Just curious as to when you'll see my reply tomorrow.

Offline
representing the school? that's pretty neat
In that case we definetly don't want to give you actual block code, but there are TONS of tutorials around this section of the forums!
TornFusion wrote:
Monday, If I do it, I get to represent my school on who can make the best scratch project, if I win I get put on the school's hall of fame and win the school £1,000 so it's pretty important. I just made a previous costume without looking at anyone blocks, but I could use a fully blown explanation.
^ best scratch project? you don't need to code your own blocks to make a good project. It's more the application of blocks that should win you points...
Last edited by sparks (2010-10-01 16:42:34)
Offline
Hey I'm in a contest like that too. Are you near.. nevermind don't give out any personal information. I'm going to win mine though

Offline
sparks wrote:
representing the school? that's pretty neat
In that case we definetly don't want to give you actual block code, but there are TONS of tutorials around this section of the forums!
"Monday, If I do it, I get to represent my school on who can make the best scratch project, if I win I get put on the school's hall of fame and win the school £1,000 so it's pretty important. I just made a previous costume without looking at anyone blocks, but I could use a fully blown explanation."
^ best scratch project? you don't need to code your own blocks to make a good project. It's more the application of blocks that should win you points...
Noo... The person in our class that make the best blocks, I have no idea though, I understand your view. But we need to use 3 custom blocks in our best project.
Offline
interesting. have you enabled mesh on your copy of Scratch? if not, your IP block isn't going to help much
I don't know if this will count, but there are a lot of obselete blockspecs hanging round readily taken from the browser. Have a look there if you can find them
Offline
I can help with most blocks, but I dont think a IP block is very useful. Also I believe the code is already online somewhere so...
Offline
johnnydean1 wrote:
I can help with most blocks, but I dont think a IP block is very useful. Also I believe the code is already online somewhere so...
WHAT?!
How about display text from (URL). And by the way, teach me not tell me.
Offline
ok then.
So open up the folder where the Scratch.exe is. You can see .dll files right?
These are plugins.
Are you with me so far?
Offline
johnnydean1 wrote:
ok then.
So open up the folder where the Scratch.exe is. You can see .dll files right?
These are plugins.
Are you with me so far?
yep,but could you try to upload all of it in one go?
Offline
TornFusion wrote:
not really, i am 10, she's just pushing us, and Im the most experienced person in my class. By the way, I have no idea what you're talking about, upload a pic.
Your teacher is asking 10 year olds to code blocks in Smalltalk!?
Offline
an some1 just upload the guide?
Offline
TornFusion wrote:
johnnydean1 wrote:
ok then.
So open up the folder where the Scratch.exe is. You can see .dll files right?
These are plugins.
Are you with me so far?yep,but could you try to upload all of it in one go?
Ok. So these plugins can be called from within small talk (the language scratch runs in)
Heres how you call the web page plugin
(HTTPSocket httpGet: variableHere)
so using this you can code:
|variableHere page|
"This declares the variables"
variableHere_ 'page url'.
"This sets variableHere to page url"
page_ ((HTTPSocket httpGet: variableHere) contents).
"This gets the contents of the page variableHere"
page = 'Server is not responding"
ifTrue: [
page_ ''.
].
"This makes the page set to nothing if the websites down or non-existant"
^ page
"This reports the page value"
On to the next step the code.
Your block needs to look like
getURL: variableHere
| input page|
input_ variableHere asString.
page_ ((HTTPSocket httpGet: input ) contents).
page = 'Server is not responding"
ifTrue: [
page_ ''.
].
^ page
the getURL: bit is the name of the meathod.
':' is a input.
So in this case we are setting variableHere to a input.
Now to the block spec
Your block spec should look like:
('get url %s' #r #getURL: '')
Ok the %s is a string input (a box)
#r means its a reporter
#getUrl: is the meathod name
'' is the deafault value
Congrats you have made a get URL block!
Offline
johnnydean1 wrote:
TornFusion wrote:
johnnydean1 wrote:
ok then.
So open up the folder where the Scratch.exe is. You can see .dll files right?
These are plugins.
Are you with me so far?yep,but could you try to upload all of it in one go?
Ok. So these plugins can be called from within small talk (the language scratch runs in)
Heres how you call the web page plugin
(HTTPSocket httpGet: variableHere)
so using this you can code:
|variableHere page|
"This declares the variables"
variableHere_ 'page url'.
"This sets variableHere to page url"
page_ ((HTTPSocket httpGet: variableHere) contents).
"This gets the contents of the page variableHere"
page = 'Server is not responding"
ifTrue: [
page_ ''.
].
"This makes the page set to nothing if the websites down or non-existant"
^ page
"This reports the page value"
On to the next step the code.
Your block needs to look likegetURL: variableHere
| input page|
input_ variableHere asString.
page_ ((HTTPSocket httpGet: input ) contents).
page = 'Server is not responding"
ifTrue: [
page_ ''.
].
^ pagethe getURL: bit is the name of the meathod.
':' is a input.
So in this case we are setting variableHere to a input.
Now to the block spec
Your block spec should look like:
('get url %s' #r #getURL: '')
Ok the %s is a string input (a box)
#r means its a reporter
#getUrl: is the meathod name
'' is the deafault value
Congrats you have made a get URL block!
Wait, i cant find scratch.exe or dll. plugins
Offline
johnnydean1 wrote:
ok ignore that bit then
That just looks like gobbledegoop. How about get contents of page but dont open it?
Offline
('get url %s' #r #getURL: '')
getURL: variableHere
| input page|
input_ variableHere asString.
page_ ((HTTPSocket httpGet: input ) contents).
page = 'Server is not responding"
ifTrue: [
page_ ''.
].
^ page
is what you asked for!
it gets HTML code off of the page!
Offline
johnnydean1 wrote:
What do you mean?
Like, say if a page had text, set it to a variable
Offline
well that would take me some time but I could do it, but you have a go.
Offline