Thank you!!!
I will ask 1 more request then I will post custom blocks for all the functions.
Can you do a
players in game page
So I can make a
add all players to list ...
block
please!
Offline
Oh and you may want to add a 5 min deletion time, so you can keep clearing your records.
Offline
johnnydean1 wrote:
Thank you!!!
I will ask 1 more request then I will post custom blocks for all the functions.
Can you do a
players in game page
So I can make a
add all players to list ...
block
please!
Done. See guide.
Last edited by TheSuccessor (2010-09-24 15:16:22)
Offline
Oh 1 last thing I cant seem to override variables.
Offline
Does now.
Offline
Yay I got the guide but still cant override
Offline
Try overriding now.
Offline
johnnydean1 wrote:
Oh and you may want to add a 5 min deletion time, so you can keep clearing your records.
And have you done this?
Offline
Block Spec
('set Game %s Player %s Type %s Var %s to %s' #- #setgame:player:type:name:value: '' '' '' '' '') ('Players in game %s' #r #phpgame: '') ('get Game %s Player %s Type %s Var %s' #r #game:player:type:name: '' '' '' '')
Code1:
game: t1 player: t2 type: t3 name: t4
| t5 t6 t7 t8 t9 |
t6 _ 'get'.
t5 _ 'http://domc.eu5.org/jd1/?action='.
t5 _ t5 , t6.
t5 _ t5 , '&' , 'game=' , t1 asString , '&' , 'player=' , t2 asString , '&' , 'type=' , t3 asString , '&' , 'name=' , t4 asString.
t6 = 'set' ifTrue: [t5 _ t5 , '&' , 'value=' , t7].
t8 _ (HTTPSocket httpGet: t5) contents.
t9 _ 'ERROR!'.
t8 = t9 ifTrue: [^ 0].
t9 _ 'INVALID ACTION!'.
t8 = t9 ifTrue: [^ 0].
^ t8
Code2:
phpgame: t1
| t2 t3 t4 t5 t6 |
t3 _ 'players'.
t2 _ 'http://domc.eu5.org/jd1/?action='.
t2 _ t2 , t3.
t2 _ t2 , '&' , 'game=' , t1 asString.
t3 = 'set' ifTrue: [t2 _ t2 , '&' , 'value=' , t4].
t5 _ (HTTPSocket httpGet: t2) contents.
t6 _ 'ERROR!'.
t5 = t6 ifTrue: [^ 0].
t6 _ 'INVALID ACTION!'.
t5 = t6 ifTrue: [^ 0].
t3 = 'players' ifTrue: [t5 _ t5 asString].
t3 _ 0.
t4 _ t5 size.
t6 _ ''.
t4
timesRepeat:
[t3 _ t3 + 1.
t7 _ self letter: t3 of: t5.
t7 = ',' ifTrue: [t7 _ '/'].
t6 _ t6 , t7].
t5 _ t6.
^ t5
Code3:
setgame: t1 player: t2 type: t3 name: t4 value: t55
| internet type value error r1 r2 r3 r4 r5 r6 t5 |
r5 _ #(' ' ).
r5 _ self letter: 3 of: r5.
r6 _ self letter: 4 of: r5.
r1 _ t55 size.
r2 _ 0.
r3 _ ''.
r1
timesRepeat:
[r2 _ r2 + 1.
r4 _ self letter: r2 of: t55.
r4 = ' '
ifTrue: [r4 _ '+']
ifFalse: [r4 = r5
ifTrue: [r4 _ '\' , r5]
ifFalse: [r4 = r6 ifTrue: [r4 _ '+']]].
r3 _ r3 , r4].
t5 _ r3.
type _ 'set'.
internet _ 'http://domc.eu5.org/jd1/?action='.
internet _ internet , type.
internet _ internet , '&' , 'game=' , t1 asString , '&' , 'player=' , t2 asString , '&' , 'type=' , t3 asString , '&' , 'name=' , t4 asString.
type = 'set' ifTrue: [internet _ internet , '&' , 'value=' , t5 asString].
value _ (HTTPSocket httpGet: internet) contents.
error _ 'ERROR!'.
value = error ifTrue: [^ 0].
error _ 'INVALID ACTION!'.
value = error ifTrue: [^ 0].
^ value
Add all of that to get them working
(It should work if not tell me!)
Last edited by johnnydean1 (2010-09-24 16:06:23)
Offline
Try now.
Offline
Yay it works, can you post your code now...
And add a 5 min delete time
Offline
5 min deletion time would be tricky, but I can do something where all the variables for a particular player could be deleted. I can also add something where you can get all the existing games.
Offline
ok yep delete all variables for player. And all games then.
Also delete game... would be nice
Offline
Oh and maybe delete variable... too.
Offline
Ok
Offline
Ok new block:
Games
blockspec
('games' #r #phpgames)
phpgames
| t2 t3 t4 t5 t6 t7 t1 |
t1 _ ''.
t7 _ self internet.
t7 = false ifTrue: [^ 0].
t3 _ 'games'.
t2 _ 'http://domc.eu5.org/jd1/?action='.
t2 _ t2 , t3.
t2 _ t2 , '&' , 'game=' , t1 asString.
t3 = 'set' ifTrue: [t2 _ t2 , '&' , 'value=' , t4].
t5 _ (HTTPSocket httpGet: t2) contents.
t6 _ 'ERROR!'.
t5 = t6 ifTrue: [^ 0].
t6 _ 'INVALID ACTION!'.
t5 = t6 ifTrue: [^ 0].
t3 = 'players' ifTrue: [t5 _ t5 asString].
t3 _ 0.
t4 _ t5 size.
t6 _ ''.
t4
timesRepeat:
[t3 _ t3 + 1.
t7 _ self letter: t3 of: t5.
t7 = ',' ifTrue: [t7 _ '/'].
t6 _ t6 , t7].
t5 _ t6.
^ t5Offline
delete all variables for player ...
delete game...
delete variable...
Can you make these
Offline