Discuss Scratch

plasma26
Scratcher
62 posts

Mod Help

Does anyone know how to make the go to url block for mods?

shadowmouse
Scratcher
100+ posts

Mod Help

I'd advise coming up with some way of restricting these sorts of blocks. Websites could contain malicious/inappropriate data or if this block is used in a repeat loop, it could crash a computer. But it should be in the block library.

I'm making a game! It's a old-metroid/mega man esque side scroller/shooter. If your interested in anything from drawing to sounds, please message on one of my projects!
stickdude123
Scratcher
85 posts

Mod Help

shadowmouse wrote:

I'd advise coming up with some way of restricting these sorts of blocks. Websites could contain malicious/inappropriate data or if this block is used in a repeat loop, it could crash a computer. But it should be in the block library.
I was caught in a loop with the URL block, and I survived.


Quote of the week: Lightnin
Everyone! Repeat after me:
stay on topic… stay on topic……stay on topic….
shadowmouse
Scratcher
100+ posts

Mod Help

stickdude123 wrote:

shadowmouse wrote:

I'd advise coming up with some way of restricting these sorts of blocks. Websites could contain malicious/inappropriate data or if this block is used in a repeat loop, it could crash a computer. But it should be in the block library.
I was caught in a loop with the URL block, and I survived.
What I meant was: Say someone had an old slow computer, with a slow internet connection, and there was the script:
when gf clicked
forever
open url or

or if combined with other easily made blocks

when gf clicked
turbo mode
forever
open url

This would almost definately crash their computer, and even if it didn't, be an absolute pain in the neck to stop.

I'm making a game! It's a old-metroid/mega man esque side scroller/shooter. If your interested in anything from drawing to sounds, please message on one of my projects!
plasma26
Scratcher
62 posts

Mod Help

Ok, well in that case, do you know how to make mesh blocks? I mean the blocks, not the menu

shadowmouse
Scratcher
100+ posts

Mod Help

I have them somewhere. I might be able to give you some code for them. Do you know how to add blocks?

I'm making a game! It's a old-metroid/mega man esque side scroller/shooter. If your interested in anything from drawing to sounds, please message on one of my projects!
plasma26
Scratcher
62 posts

Mod Help

Yes.

shadowmouse
Scratcher
100+ posts

Mod Help

Here they are, these are taken off branch and as far as I know they work perfectly:
leave mesh (stack):
leaveMesh
| t1 |
(t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame) ifNil: [^ self]].
t1 exitScratchSession
getIP (reporter):
getIp
| t1 t2 t3 |
Socket initializeNetwork.
t1 _ NetNameResolver localHostAddress.
t2 _ nil.
t3 _ NetNameResolver stringFromAddress: t1.
(t2 notNil and: [t2 ~= t1])
ifTrue: [t3 _ t3 , String cr , 'Internet: ' , (NetNameResolver stringFromAddress: t2)].
^ t3
host mesh (stack):
hostMesh
| t1 t2 |
(t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame) ifNil: [^ self]].
t1 workPane scratchServer
ifNil:
[t2 _ ScratchServer new.
t2 stage: t1 workPane.
t1 workPane scratchServer: t2].
t1 workPane scratchServer startHosting
ishostingmesh (boolean):
isHostingMesh
| t1 t2 |
(t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame].
(t2 _ t1 workPane scratchServer) ifNil: [^ false].
^ t2 isHosting
joinmesh (stack):
joinMesh: t1 
| t2 t3 t4 |
(t4 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(t4 _ (self ownerThatIsA: OffscreenWorldMorph) frame) ifNil: [^ self]].
t2 _ ScratchServer new.
t2 stage: t4 workPane.
t4 workPane scratchServer: t2.
t1 size = 0 ifTrue: [^ ''].
t3 _ t4 workPane scratchServer joinSessionAt: t1
Obviosly you don't have to call the blocks the above names as long as the blockspec is right. Bear in mind that joinmesh needs an input (advisably a number input so it would end up as join mesh on IP ().

I'm making a game! It's a old-metroid/mega man esque side scroller/shooter. If your interested in anything from drawing to sounds, please message on one of my projects!
plasma26
Scratcher
62 posts

Mod Help

Thanks. One last thing, I figured out how to make the dev menu, but it's sticking to the help menu.

shadowmouse
Scratcher
100+ posts

Mod Help

What do you mean by a dev menu? Shift-clicking file gives you all you need.

I'm making a game! It's a old-metroid/mega man esque side scroller/shooter. If your interested in anything from drawing to sounds, please message on one of my projects!

Powered by DjangoBB