Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Cloud list
- AnyOtherGuy123
-
37 posts
Cloud list
Can I find out how to make cloud lists? I want to make a live leaderboard with cloud but I'm not sure how to
- medians
-
1000+ posts
Cloud list
Cloud lists were removed before the official release of 2.0 and were eventually rejected to add so there isn't an in-built option for it, but there are engines you can use.
- medians
-
1000+ posts
Cloud list
If you look up “cloud list” on Scratch, you might be able to find it, though skip over the 2.0 ones and stuff like that since updates broke 2.0 cloud projects, including cloud lists. Also, there might be a workaround to using cloud lists if it's a scoreboard or sth like that, and you can encode and decode the usernames (note users can have any letter or digit, underscores, and dashes). Does anyone have an engine for it then
- Fakedrift
-
5 posts
Cloud list
Well you could use something like:
set ☁ Data to join (Item 1 of list) (join (“|”) (join (Item 2 of list) (|)))
then do something like:
set DataLength to length of (☁ Data)
set Letter to (“”)
set Output to (“”)
set idx to (0)
repeat (DataLength)
repeat until <Letter = “|”>
change idx by (1)
set Output to (join (Output) (Letter))
set Letter to (letter (idx) of (☁ Data))
end
set ☁ Data to join (Item 1 of list) (join (“|”) (join (Item 2 of list) (|)))
then do something like:
set DataLength to length of (☁ Data)
set Letter to (“”)
set Output to (“”)
set idx to (0)
repeat (DataLength)
repeat until <Letter = “|”>
change idx by (1)
set Output to (join (Output) (Letter))
set Letter to (letter (idx) of (☁ Data))
end
Last edited by Fakedrift (Nov. 12, 2023 19:22:08)
- pomnii__
-
1 post
Cloud list
Can I find out how to make cloud lists? I want to make a live leaderboard with cloud but I'm not sure how to
if its a score leaderboard for ur game, then u should make a cloud score bc it will show the score.
- broskinumber3
-
41 posts
Cloud list
Well I want the username too
this would require encoding and decoding
and youd have to encode the player's username into a bunch of numbers, and encode their score next to it too, since cloud variables cant support letters or symbols. and then write the given string into a cloud variable.
decoding would just decode the given cloud variables and write the usernames & scores into a list.
beware that this is MUCH harder to code than i am making it seem
overwriting could just be seeing if your given score is bigger than a current score in the table, finding the table index thats less than your score, and rewriting your data into the cloud variable corresponding to it.
b#3
- Rafael_Bagi123
-
86 posts
Cloud list
my thought is to send like one variable that works like a list, something like that: Can I find out how to make cloud lists? I want to make a live leaderboard with cloud but I'm not sure how to
variable data = 897|784|728
but you will need to encrypt it, so will be a HUGE PROBLEM
the most simplest way to encode something in my opinion is using morse code
…—… = SOS
to encrypt using numbers is easy
. = 0
- = 1
/ = 2
Last edited by Rafael_Bagi123 (Nov. 13, 2023 00:51:45)
- AnyOtherGuy123
-
37 posts
Cloud list
Hmm I think maybe if we do a list with a numbers and letters and special chracters stuff like that in a list, then we have a computer get a number, go through the list, and see if the number has the letter it needs. So like a list has numbers that are divided right? The computer runs through them, using an encrypted language to know what to look for. But the problem is, how are we going to teach the computer to know the encrypted language? I want to have a optimized cloud list, NOT using like 100 if statements running through them.
- Rafael_Bagi123
-
86 posts
Cloud list
Hmm I think maybe if we do a list with a numbers and letters and special chracters stuff like that in a list, then we have a computer get a number, go through the list, and see if the number has the letter it needs. So like a list has numbers that are divided right? The computer runs through them, using an encrypted language to know what to look for. But the problem is, how are we going to teach the computer to know the encrypted language? I want to have a optimized cloud list, NOT using like 100 if statements running through them.
Search on scratch: morse code, but change the . To a 0, - to a 1 and the / to a 2
Easy game
- ProfessorUelf
-
100+ posts
Cloud list
Keep in mind that cloud variables can store numbers only, no symbols! (exept for the dot I think)
The way encoding and decoding for cloud variables is done usually is by using a encode decoder list, that starts at 10. This also allows for numbers and other symbols to be encoded:
The reason index 1-9 is not used ist to avoid single digit numbers for easy decoding. If you have only 2 digit numbers, you can simply loop through the variable when decoding and replace every two digits with the corresponding letter or symbol. If 90 symbols isn't enough (which i doubt), just use 3 digit encoding / decoing. It is still much smaller than morse code and definetly saves some valuable space in the limited length cloud variable.
Another useful aspect of not using 00 - 09 for encoding is that they can be used as delimiters. So e.g. if the script reads 00, it jumps to the next item of the list. (Next username & score)
The way encoding and decoding for cloud variables is done usually is by using a encode decoder list, that starts at 10. This also allows for numbers and other symbols to be encoded:
10 = A
11 = B
12 = C
...
99 = $
The reason index 1-9 is not used ist to avoid single digit numbers for easy decoding. If you have only 2 digit numbers, you can simply loop through the variable when decoding and replace every two digits with the corresponding letter or symbol. If 90 symbols isn't enough (which i doubt), just use 3 digit encoding / decoing. It is still much smaller than morse code and definetly saves some valuable space in the limited length cloud variable.
Another useful aspect of not using 00 - 09 for encoding is that they can be used as delimiters. So e.g. if the script reads 00, it jumps to the next item of the list. (Next username & score)
Last edited by ProfessorUelf (Nov. 13, 2023 09:15:45)
- cookieclickerer33
-
1000+ posts
Cloud list
That is the least simple possible way of encoding cloud datamy thought is to send like one variable that works like a list, something like that: Can I find out how to make cloud lists? I want to make a live leaderboard with cloud but I'm not sure how to
variable data = 897|784|728
but you will need to encrypt it, so will be a HUGE PROBLEM
the most simplest way to encode something in my opinion is using morse code
…—… = SOS
to encrypt using numbers is easy
. = 0
- = 1
/ = 2
- cookieclickerer33
-
1000+ posts
Cloud list
Nope, cloud variables can only store 0,1,2,3,4,5,6,7,8,9 Keep in mind that cloud variables can store numbers only, no symbols! (exept for the dot I think)
The way encoding and decoding for cloud variables is done usually is by using a encode decoder list, that starts at 10. This also allows for numbers and other symbols to be encoded:10 = A
11 = B
12 = C
...
99 = $
The reason index 1-9 is not used ist to avoid single digit numbers for easy decoding. If you have only 2 digit numbers, you can simply loop through the variable when decoding and replace every two digits with the corresponding letter or symbol. If 90 symbols isn't enough (which i doubt), just use 3 digit encoding / decoing. It is still much smaller than morse code and definetly saves some valuable space in the limited length cloud variable.
Another useful aspect of not using 00 - 09 for encoding is that they can be used as delimiters. So e.g. if the script reads 00, it jumps to the next item of the list. (Next username & score)
You can store a decimal but only if the provided input is a number not a string (there’s a difference)
Nothing more nothing less (at the very least I wish we could store spaces)
And by number I mean
All of these blocks return numbers. And yes there is a difference
Is a diffrent 5 from
The biggest example of this is costumes
If you put a number into the costume block drop-down it will switch to the number that costume is. If you put a string into the drop down it will swap to that costume name
So if you have a costume named “5” but isn’t in the 5th costume slot then doing
Will change to a diffrent costume than
Cloud variables will only let you store a decimal point if the thing inputted is a number and not a string, variables also store wether or not their value is a number or string
Booleans are also a data type that are a sort of inbetween, when called in any block that returns a number (other than length of) it behaves as a 1 or 0, but when called in any block that returns a string then it acts as the text “true” or “false”
Last edited by cookieclickerer33 (Nov. 13, 2023 12:44:36)
- Dog-lover-123456789
-
7 posts
Cloud list
Cloud Lists Would Be Usefull
Last edited by Dog-lover-123456789 (Dec. 11, 2023 07:14:21)
- froggy1The
-
4 posts
Cloud list
PLEASE, I NEED CLOUD LISTS FOR MY VOTING PLATFORM “WHO IS THE BEST SCRATCHER?”
- bsteichman
-
500+ posts
Cloud list
this is a 2 year old post, please make a new topic. PLEASE, I NEED CLOUD LISTS FOR MY VOTING PLATFORM “WHO IS THE BEST SCRATCHER?”
that being said, the basics of making a cloud list is to use a regular cloud vafr.
1. pick a separator, some uncommon symbol, EX: §
2. join all your items together in one variable: "froggy1The§bsteichman§griffpatch
3. convert letters to numbers:
EX:
a->01
b->02
c->03
z->26
1->27
!->52
such that ABCZ -> 01020326
now that it is a number, it can be saved to a cloud variable
then do this process in reverse to get your list back
NOTE: there is a length limit of 255 numbers, so for you that would be 128 letters
if you want more, use more cloud vars
- Discussion Forums
- » Help with Scripts
-
» Cloud list