Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Mod Help
- shadowmouse
-
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.
- stickdude123
-
85 posts
Mod Help
I was caught in a loop with the URL block, and I survived. 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.
- shadowmouse
-
100+ posts
Mod Help
What I meant was: Say someone had an old slow computer, with a slow internet connection, and there was the script:I was caught in a loop with the URL block, and I survived. 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.
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.
- plasma26
-
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
-
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?
- shadowmouse
-
100+ posts
Mod Help
Here they are, these are taken off branch and as far as I know they work perfectly:
leave mesh (stack):
getIP (reporter):
host mesh (stack):
ishostingmesh (boolean):
joinmesh (stack):
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 ().
leave mesh (stack):
leaveMesh
| t1 |
(t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame) ifNil: [^ self]].
t1 exitScratchSession
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
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
| t1 t2 |
(t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame].
(t2 _ t1 workPane scratchServer) ifNil: [^ false].
^ t2 isHosting
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
- plasma26
-
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
-
100+ posts
Mod Help
What do you mean by a dev menu? Shift-clicking file gives you all you need.
- Discussion Forums
- » Advanced Topics
-
» Mod Help