Discuss Scratch

davidtheplatform
Scratcher
500+ posts

Online Cloud Variable

Ghxstify2009 wrote:

ninjaMAR wrote:

davidtheplatform wrote:

(#17)
There's roughly 65 characters you can use in a username, so if we encode them properly we only need 1.8 digits per character. Some letters are more/less common, ie. “Q” is probably used less than “e”. We can use huffman coding (or something similar) to get a little bit more compression. Normal english text can be compressed by about 8x for reference.

Various other methods could be used, like truncating usernames to 5 characters, but then you'd have to deal with collisions.
Interesting! Do you have a Proof-Of-Concept?

ninjaMAR wrote:

(#11)
https://scratch.mit.edu/projects/495545839/
I updated the project to include an API that you can use. Directions are in the editor.
I would also like to associate a rank with specific usernames though, and allow other people to see it.

Is there a way on Scratch like in Python to add onto the username such as: +“Rank = Bronze”
There’s a “join () ()” block:
(join [hello ] [world])
Ghxstify2009
Scratcher
100+ posts

Online Cloud Variable

So if I'm using cloud variables like everyone is saying I use

(join (☁ username) [Bronze])

ninjaMAR
Scratcher
1000+ posts

Online Cloud Variable

Ghxstify2009 wrote:

(#22)
So if I'm using cloud variables like everyone is saying I use

(join (☁ username) [Bronze])


You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
(join (join (username) [,]) [1])
Ghxstify2009
Scratcher
100+ posts

Online Cloud Variable

ninjaMAR wrote:

Ghxstify2009 wrote:

(#22)
So if I'm using cloud variables like everyone is saying I use

(join (☁ username) [Bronze])


You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
(join (join (username) [,]) [1])
But then how will others see their ranks?
ninjaMAR
Scratcher
1000+ posts

Online Cloud Variable

Ghxstify2009 wrote:

(#24)

ninjaMAR wrote:

Ghxstify2009 wrote:

(#22)
So if I'm using cloud variables like everyone is saying I use

(join (☁ username) [Bronze])


You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
(join (join (username) [,]) [1])
But then how will others see their ranks?
Since you don't have much experience doing this, I recommend using an existing implementation of a cloud list. For each item of the list, store the username + a delimiter (can't be “:” if you use my implementation) + the rank. Then do something like the following
set [buffer v] to []
set [i v] to [1]
repeat (length of (word))
if <<(letter (i) of (word)) = [;]> or <(letter (i) of (word)) = []>> then
add (buffer) to [output v]
else
set [buffer v] to (join (buffer) (letter (i) of (word)))
end
change [i v] by (0)
end
Assuming word is “ninjamar:bronze”, output will be

OR you could ignore the cloud lists, and just use cloud variables with the same method described above


If you want, I could make a demonstration

Last edited by ninjaMAR (May 8, 2024 13:33:21)

Ghxstify2009
Scratcher
100+ posts

Online Cloud Variable

ninjaMAR wrote:

Ghxstify2009 wrote:

(#24)

ninjaMAR wrote:

Ghxstify2009 wrote:

(#22)
So if I'm using cloud variables like everyone is saying I use

(join (☁ username) [Bronze])


You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
(join (join (username) [,]) [1])
But then how will others see their ranks?
Since you don't have much experience doing this, I recommend using an existing implementation of a cloud list. For each item of the list, store the username + a delimiter (can't be “:” if you use my implementation) + the rank. Then do something like the following
set [buffer v] to []
set [i v] to [1]
repeat (length of (word))
if <<(letter (i) of (word)) = [;]> or <(letter (i) of (word)) = []>> then
add (buffer) to [output v]
else
set [buffer v] to (join (buffer) (letter (i) of (word)))
end
change [i v] by (0)
end
Assuming word is “ninjamar:bronze”, output will be

OR you could ignore the cloud lists, and just use cloud variables with the same method described above


If you want, I could make a demonstration
If you don't mind making a demo that'd be great, because I don't follow you reading your comment
ninjaMAR_alt
Scratcher
14 posts

Online Cloud Variable

Ghxstify2009 wrote:

(#26)

ninjaMAR wrote:

Ghxstify2009 wrote:

(#24)

ninjaMAR wrote:

Ghxstify2009 wrote:

(#22)
So if I'm using cloud variables like everyone is saying I use

(join (☁ username) [Bronze])


You probably want to include a delimiter, so you know what is the username, and what is the rank. To make this more space efficient, store the rank as a number
(join (join (username) [,]) [1])
But then how will others see their ranks?
Since you don't have much experience doing this, I recommend using an existing implementation of a cloud list. For each item of the list, store the username + a delimiter (can't be “:” if you use my implementation) + the rank. Then do something like the following
set [buffer v] to []
set [i v] to [1]
repeat (length of (word))
if <<(letter (i) of (word)) = [;]> or <(letter (i) of (word)) = []>> then
add (buffer) to [output v]
else
set [buffer v] to (join (buffer) (letter (i) of (word)))
end
change [i v] by (0)
end
Assuming word is “ninjamar:bronze”, output will be

OR you could ignore the cloud lists, and just use cloud variables with the same method described above


If you want, I could make a demonstration
If you don't mind making a demo that'd be great, because I don't follow you reading your comment
https://scratch.mit.edu/projects/1016092363/
heitorBrazillindo
Scratcher
12 posts

Online Cloud Variable

LIZARD_OFFICIAL wrote:

EasyDB is great for that!
lol and what you put in the define block and the name of all cloud variables needed
define 
(join [idk] [])
heitorBrazillindo
Scratcher
12 posts

Online Cloud Variable

when green flag clicked
say [idk] for (2) secs
heitorBrazillindo
Scratcher
12 posts

Online Cloud Variable

when green flag clicked
say [i dont know...........] for (2) secs
Goldking9
Scratcher
67 posts

Online Cloud Variable

Ghxstify2009 wrote:

How do I create an online library full of usernames and corresponding ‘ranks’? I want to do this so that I can keep track of my members and associate a rank with their username, so that when they enter their username in a rank tracker project they will be able to see their rank
Use my Intelligent Storage project which senses a lot! I added status or rank (I named it rank).

Then use
when this sprite clicked
ask [Username?] and wait
say (join [Username:] [(yourrank v)])for (2) secs

Last edited by Goldking9 (Oct. 19, 2025 21:39:13)

retro2D
Scratcher
20 posts

Online Cloud Variable

Please don't post on old topics, as OP is likely no logger interested in the topic anymore.

Powered by DjangoBB