Discuss Scratch

M1KOCT
Scratcher
72 posts

How do i make a cloud list?

Im making a chat heres the message receival script and the problem is that i cant make the other user see the other user's message. I also made a whitelist so dont tell me that its not allowed

whenspacekeypressedaddcloud1tolistaddcloud2tolistaddcloud3tolistaddcloud4tolistaddcloud5tolistaddcloud6tolistaddcloud7toChataddcloud8toChataddcloud9toChataddcloud10toChat

Last edited by M1KOCT (Oct. 9, 2020 04:59:58)

mysterious-neutron
Scratcher
1000+ posts

How do i make a cloud list?

There are no cloud lists in scratch so you have to simulate it. Make a cloud variable and encode all the text into numbers and put it in the cloud variable.
Now decode all the numbers into letters but his time into a list
SMKAS
Scratcher
500+ posts

How do i make a cloud list?

It requires you to press space every now and then to never miss a message, and will clog up your list quickly, I already finished my example for you to know how to make an online chat(don't worry its safe).
M1KOCT
Scratcher
72 posts

How do i make a cloud list?

mysterious-neutron wrote:

There are no cloud lists in scratch so you have to simulate it. Make a cloud variable and encode all the text into numbers and put it in the cloud variable.
Now decode all the numbers into letters but his time into a list
what is decode what is encode? WHAT IS HAPENING?
SMKAS
Scratcher
500+ posts

How do i make a cloud list?

encode means turn a normal thing into another, then decode turns your “encoded” thing back to normal. Encoded means it went through the encoding process.
deck26
Scratcher
1000+ posts

How do i make a cloud list?

M1KOCT wrote:

Im making a chat heres the message receival script and the problem is that i cant make the other user see the other user's message. I also made a whitelist so dont tell me that its not allowed

whenspacekeypressedaddcloud1tolistaddcloud2tolistaddcloud3tolistaddcloud4tolistaddcloud5tolistaddcloud6tolistaddcloud7toChataddcloud8toChataddcloud9toChataddcloud10toChat
Your ‘whitelist’ has to be a limited set of things can be said. If you mean a long list of words to be used in any combination that is no longer allowed.

Since you're working with a list like that you can just ensure the item number is expanded to a fixed former (eg adding leading zeroes to ensure a 3-digit value if necessary) so you don't need to encode or decode that but if you want to include usernames you will need encoding/decoding.

Last edited by deck26 (Oct. 9, 2020 07:26:21)

M1KOCT
Scratcher
72 posts

How do i make a cloud list?

deck26 wrote:

M1KOCT wrote:

Im making a chat heres the message receival script and the problem is that i cant make the other user see the other user's message. I also made a whitelist so dont tell me that its not allowed

whenspacekeypressedaddcloud1tolistaddcloud2tolistaddcloud3tolistaddcloud4tolistaddcloud5tolistaddcloud6tolistaddcloud7toChataddcloud8toChataddcloud9toChataddcloud10toChat
Your ‘whitelist’ has to be a limited set of things can be said. If you mean a long list of words to be used in any combination that is no longer allowed.

Since you're working with a list like that you can just ensure the item number is expanded to a fixed former (eg adding leading zeroes to ensure a 3-digit value if necessary) so you don't need to encode or decode that but if you want to include usernames you will need encoding/decoding.
i have a whitelist btw i dont need usernames
creater365
Scratcher
100+ posts

How do i make a cloud list?

First a little lesson, cloud variables can ONLY store numbers. No letters or any other character. ONLY numbers. And in this case, encoding means to turn text –> numbers. Decoding is turning encoded numbers –> text. This is basically how cloud variables work. And since scratch added a cloud variable limit, you want to compress things as much as possible. In this case, since you're using a list of phrases you can say, you only want to include the item # of the thing that's being said saved to the cloud variable. The reason is that a number is much shorter than saving the whole phrase. If you're confused, here is an example.

Say we have a list of phrases:
“Hello!”, “Goodbye!”
You want to save 1 to the cloud variable instead of the whole word hello encoded. This is because hello encoded takes up more space, making fewer messages being able to be sent. In this case, if you wanted to make this work you'd first have to connect a “ask and wait” block and ask them for item # of phrase they're gonna say. You then encode it into numbers, set the cloud variable to join cloud variable encoded answer. You then create a list for the chat, tell it to forever delete all of the chat list, and decode the cloud variable. If you need more help, tell me.
SMKAS
Scratcher
500+ posts

How do i make a cloud list?

Like this?

https://scratch.mit.edu/projects/434346645/

I already made this for them, maybe try modifying it for their needs.

Powered by DjangoBB