This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#126 2010-08-31 15:49:31

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP

Make it not display any text between <script> tags or your pages will be cluttered with stuff the user won't understand.


/* No comment */

Offline

 

#127 2010-08-31 15:54:25

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

How to use?


You can now reach me on Twitter @johnnydean1_

Offline

 

#128 2010-08-31 21:07:28

DistantVisit
Scratcher
Registered: 2010-07-29
Posts: 100+

Re: Online Multiplayer PHP

fullmoon wrote:

I would do the PHP if I had a place to host it!

I recommend t35 hosting if you need free hosting. I haven't used it in a while so I'm not sure on the current bandwidth allowed. If you don't mind the ads it's a great choice to use.  wink

Offline

 

#129 2010-09-01 03:42:55

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Online Multiplayer PHP

DistantVisit wrote:

fullmoon wrote:

I would do the PHP if I had a place to host it!

I recommend t35 hosting if you need free hosting. I haven't used it in a while so I'm not sure on the current bandwidth allowed. If you don't mind the ads it's a great choice to use.  wink

Nah, want free hosting and no ads? Then use 000webhost


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#130 2010-09-01 07:39:32

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP

Shall I make source code available so others can help improve?


/* No comment */

Offline

 

#131 2010-09-01 11:11:13

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

please and give us a guide!


You can now reach me on Twitter @johnnydean1_

Offline

 

#132 2010-09-07 12:47:13

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

guide...


You can now reach me on Twitter @johnnydean1_

Offline

 

#133 2010-09-07 13:41:40

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP

Sorry, the project's sort of stuck as I've just got back to school and the homework's piling up. But I'm still working on it when I can.


/* No comment */

Offline

 

#134 2010-09-08 03:05:58

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

ok  smile


You can now reach me on Twitter @johnnydean1_

Offline

 

#135 2010-09-08 11:55:23

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP

PHP source (updated as I go): http://domc.eu5.org/jd1/source.txt.
If you have any suggestions or improvements for the code, post and I will update.


/* No comment */

Offline

 

#136 2010-09-08 12:58:14

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

And a guide!


You can now reach me on Twitter @johnnydean1_

Offline

 

#137 2010-09-11 06:48:13

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP


/* No comment */

Offline

 

#138 2010-09-11 08:52:53

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

That links missing stuff


You can now reach me on Twitter @johnnydean1_

Offline

 

#139 2010-09-11 09:49:10

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP

I know. I haven't finished it yet.


/* No comment */

Offline

 

#140 2010-09-11 11:43:25

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

ok


You can now reach me on Twitter @johnnydean1_

Offline

 

#141 2010-09-11 12:44:22

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

After a bit of experimenting a Panther custom block:

johnnydean1 wrote:

Name: 'PHP'

Type: 'r'

Code:
| contents p1  p2 p3 result URL mark length |
URL_ 'http://domc.eu5.org/jd1/?test=yes'. "The URL"
mark_ 'center'. "The part between the <>'s"






p2_ self concatenate: ('<') with: (mark).
result_ self concatenate: (mark) with: ('>').


contents_ self readFromUrl: (URL).
p1_ self indexOf: (result) startingAt: (0) in: (contents).

p2_ self concatenate: ('</') with: (mark).
result_ self concatenate: (mark) with: ('>').

p2_ self indexOf: (result) startingAt: (0) in: (contents).



p1_ p1 - 2.
contents_ self letters: (0) through: (p1) of: (contents).



length_ self stringLength: (contents).


p1_ 0.
p2_ 0.
p3_ 0.
result_ ''.
length timesRepeat: [
p1_ p1 + 1.
p2_ self letter: (p1) of: (contents).
p2 = '<'
ifTrue: [
p3_ 1.
]
ifFalse: [
p2= '>'
ifTrue: [
p3_ 2.
].
].
p3 = 0
ifTrue: [
result_ self concatenate: (result) with: (p2).
].

p3 = 2
ifTrue: [
p3_ 0.
].

].
contents_ result.


^ contents.

This removes all the HTML tags!

Last edited by johnnydean1 (2010-09-11 12:48:08)


You can now reach me on Twitter @johnnydean1_

Offline

 

#142 2010-09-11 12:55:10

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

Oh and this custom block, gets the guide:

Name: PHP Guide
Type: r

Code:

Code:

| contents p1  p2 p3 result URL length |
URL_ 'http://domc.eu5.org/jd1/guide.php'. "The URL"







contents_ self readFromUrl: (URL).


length_ self stringLength: (contents).


p1_ 0.
p2_ 0.
p3_ 0.
result_ ''.
length timesRepeat: [
p1_ p1 + 1.
p2_ self letter: (p1) of: (contents).
p2 = '<'
ifTrue: [
p3_ 1.
]
ifFalse: [
p2 = '{'
ifTrue: [
p3_1.
]
ifFalse: [
p2= '>'
ifTrue: [
p3_ 2.
].

p2 = '}'
ifTrue: [
p3_2.
].

].

].
p3 = 0
ifTrue: [
result_ self concatenate: (result) with: (p2). 
].

p3 = 2
ifTrue: [
p3_ 0.
].

].
contents_ result.


^ contents.

You can now reach me on Twitter @johnnydean1_

Offline

 

#143 2010-09-12 20:39:29

stickdude123
Scratcher
Registered: 2010-05-31
Posts: 100+

Re: Online Multiplayer PHP

fullmoon wrote:

I would do the PHP if I had a place to host it!

CMON! MAN!


http://internetometer.com/imagesmall/34259.png http://www.mediafire.com/convkey/418e/lkb7wmv2n2k73rz5g.jpg         http://blocks.scratchr.org/API.php?user=stickdude123&amp;action=onlineStatus&amp;type=square

Offline

 

#144 2010-09-13 14:01:06

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Online Multiplayer PHP

Sperry wrote:

DistantVisit wrote:

fullmoon wrote:

I would do the PHP if I had a place to host it!

I recommend t35 hosting if you need free hosting. I haven't used it in a while so I'm not sure on the current bandwidth allowed. If you don't mind the ads it's a great choice to use.  wink

Nah, want free hosting and no ads? Then use 000webhost

Yes, 000webhost.com is probably the best place, but I warn you... You're site may be deleted, remember to back-up everything at least each day. At most.

Offline

 

#145 2010-09-13 14:11:29

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Online Multiplayer PHP

Magnie wrote:

Sperry wrote:

DistantVisit wrote:


I recommend t35 hosting if you need free hosting. I haven't used it in a while so I'm not sure on the current bandwidth allowed. If you don't mind the ads it's a great choice to use.  wink

Nah, want free hosting and no ads? Then use 000webhost

Yes, 000webhost.com is probably the best place, but I warn you... You're site may be deleted, remember to back-up everything at least each day. At most.

Yes it may be deleted due to the fact it goes under moderation every so often. Just to check if your site is okay.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#146 2010-09-15 03:19:30

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

Hows it going?


You can now reach me on Twitter @johnnydean1_

Offline

 

#147 2010-09-15 12:17:57

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Online Multiplayer PHP

OK... I should be able to do a lot more Monday onwards because I'll have handed in a large piece of homework.


/* No comment */

Offline

 

#148 2010-09-18 17:05:41

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

ok progress


You can now reach me on Twitter @johnnydean1_

Offline

 

#149 2010-09-19 03:52:32

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Online Multiplayer PHP

No mod, currently, can write to a webpage - the only way it's possible is if at the end of the game a webpage opens like this: www.url.com/index.php?score=122
that way php can write it to an SQL database or a .txt file on the server. That way you can see the top scores ect...
(and no you can't get a webpage to open every second sending info to a webpage, for an start it would be annoying and it takes a while to read a file anyway! So no opening this: www.url.com/index.php?x=45&y=76&game=2&player=6 That would never work!  wink


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#150 2010-09-19 12:09:42

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Online Multiplayer PHP

Daffy just because you think things are not possible doesnt mean then allways are.


You can now reach me on Twitter @johnnydean1_

Offline

 

Board footer