Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Does anybody know how to find whos playing your game
- Par0dy
-
Scratcher
100+ posts
Does anybody know how to find whos playing your game
Does anybody know how to find whos playing your game. I wanted to find out who was playing my game because I am have 199 views+. I tried to find out who is playing my game. I did this:
when green flag clickedBut when I did that whenever I pressed the green flag when ever I was trying to add something to my game I was added onto list again s I tried this:
add (username) to [Players v]
when green flag clickedBut that didn't work coz a few views later I checked and there was nobody on that list. Does it need to be a cloud list or something?
if <(Players(this is meant to be a list)) = (username)> then
else
add (username) to [Players v]
Can (somebody) HELP!
- shiguy101
-
Scratcher
100+ posts
Does anybody know how to find whos playing your game
Try
when green flag clicked
set [v1 v] to [0]
repeat until <(V2) = [1]>
if <not <(username) = (item ((v1) v) of [list v])>> then
change [v1 v] by (1)
else
change [V2 v] by (1)
end
if <(v1) = (length of [list v])> then
add (username) to [list v]
change [V2 v] by (1)
end
end
Last edited by shiguy101 (March 13, 2014 14:18:55)
- MoreGamesNow
-
Scratcher
100+ posts
Does anybody know how to find whos playing your game
Offhand, I can't think of anything (that would work for a decent number of users) to figure out who has seen your project other than this:
Every time a user starts your game, they set one of your public variables to their username (well, actually, it would have to be encoded into number-format). Then you have another script that adds that username to a list of ‘users’ (you could also search to make sure you haven't already added the name, etc.). The downside is, of course, that you'd have to have the project running constantly to have a truly accurate list of who had viewed your project
.
Every time a user starts your game, they set one of your public variables to their username (well, actually, it would have to be encoded into number-format). Then you have another script that adds that username to a list of ‘users’ (you could also search to make sure you haven't already added the name, etc.). The downside is, of course, that you'd have to have the project running constantly to have a truly accurate list of who had viewed your project
.- MoreGamesNow
-
Scratcher
100+ posts
Does anybody know how to find whos playing your game
Wait. Your username can be 30 characters long (I think). With ~60 characters (let's say) that is 60^30 possibilities or ~2.2 x 10^53. I'm not sure how accurate Scratch variables are, but compressing such a string into a number (or even 5 numbers) probably isn't possible 
On the other hand, if you de-capitlize usernames you're left with ~35 characters. Now only look at the first 10 characters of the username (and assume everyone who uses your project will still have a unique name) and you're looking at a much easier (/possible) problem.
Edit:
I believe Scratch integers are accurate up to about 2^55. This is just greater than 37^10, allowing you lower-case characters, numbers, and underscores, as well as usernames less than 10 characters in a single number. Naturally using more of your precious global variables lets you store longer names BUT for the sake of keeping the flow smooth (remember, global variables are kind of laggy), I'd suggest only using one per username, and putting each username that must be processed through the list in a random global variable to minimize the chance of overwriting one of them before it is processed.

On the other hand, if you de-capitlize usernames you're left with ~35 characters. Now only look at the first 10 characters of the username (and assume everyone who uses your project will still have a unique name) and you're looking at a much easier (/possible) problem.
Edit:
I believe Scratch integers are accurate up to about 2^55. This is just greater than 37^10, allowing you lower-case characters, numbers, and underscores, as well as usernames less than 10 characters in a single number. Naturally using more of your precious global variables lets you store longer names BUT for the sake of keeping the flow smooth (remember, global variables are kind of laggy), I'd suggest only using one per username, and putting each username that must be processed through the list in a random global variable to minimize the chance of overwriting one of them before it is processed.
Last edited by MoreGamesNow (March 13, 2014 22:44:45)
- AonymousProfessor
-
Scratcher
100+ posts
Does anybody know how to find whos playing your game
You need to use a cloud list engine. There are some out there, but basically what you do is you decode the list, check if the player is already in the list, and if not, add them to it and update the cloud variable.
- turkey3
-
Scratcher
1000+ posts
Does anybody know how to find whos playing your game
In Scratch 1.4 there was a list of everyone who loved your project.
- -Guy-
-
Scratcher
38 posts
Does anybody know how to find whos playing your game
You get messages of who loved your game
In Scratch 1.4 there was a list of everyone who loved your project.
- 1234abcdcba4321
-
Scratcher
1000+ posts
Does anybody know how to find whos playing your game
If you're wondering JUST FOR YOURSELF and you don't need that info anywhere in the project, then just do something simpler:
Then you can check the cloud log.
when gf clicked
change [cloud var v] by (1)
Then you can check the cloud log.
- lovejoy132
-
Scratcher
2 posts
Does anybody know how to find whos playing your game
help can somebody explain this step by step. cause i don't get it?
- AwesomeBFDIDiaper
-
Scratcher
59 posts
Does anybody know how to find whos playing your game
when clickedset v1 to 0repeat until V2 = 1if not username = item v1 v of list thenchange v1 by 1elsechange V2 by 1if v1 = length of list thenadd username to listchange V2 by
- AwesomeBFDIDiaper
-
Scratcher
59 posts
Does anybody know how to find whos playing your game
when clickedset v1 to 0repeat until V2 = 1if not username = item v1 v of list thenchange v1 by 1elsechange V2 by 1if v1 = length of list thenadd username to listchange V2 byremove this and that
- jedt0
-
Scratcher
1 post
Does anybody know how to find whos playing your game
First go to data and make a list called Usernames. Then you need this script (The list variable will be called list.)
when green flag clicked
add [(username)] to [ List]
- MegaApuTurkUltra
-
Scratcher
1000+ posts
Does anybody know how to find whos playing your game
Use a cloud list, record everyone's username. Cons: Doesn't detect New Scratchers
- ShadowScizor
-
Scratcher
100+ posts
Does anybody know how to find whos playing your game
wait, this was posted on 13 march 2014?
- Birdlegs
-
Scratcher
1000+ posts
Does anybody know how to find whos playing your game
GUYS!!! Good golly, this post got hilarious. Anyway, listen to that smiley Scratcher up there. Increment a cloud variable by one for each flag click and then just check the cloud data log.
- Birdlegs
-
Scratcher
1000+ posts
Does anybody know how to find whos playing your game
GUYS!!! Good golly, this post got hilarious. Anyway, listen to that smiley Scratcher up there. Increment a cloud variable by one for each flag click and then just check the cloud data log.Hold on… That was a necropost…
- ScratchLeagueGames
-
Scratcher
1 post
Does anybody know how to find whos playing your game
Not me…me either
- Discussion Forums
- » Help with Scripts
-
» Does anybody know how to find whos playing your game