Discuss Scratch

Angusthemenace
Scratcher
14 posts

I need help to create a username detecter? please help


Please help here


whenIreceive I need helprepeatuntilIgethelpsayHelp

Last edited by Angusthemenace (Feb. 19, 2021 13:45:06)

awesome-llama
Scratcher
1000+ posts

I need help to create a username detecter? please help

Use the username block:

username Reports the username of whoever is running the project. Will report nothing if they aren't signed in.

In your project, you are asking for the user's name. I assume you want this to be automatic so you would want to do something like this:

sayjoinjoinHi username! Welcome to scratchtown zoo.for2secs
My username is awesome-llama.
For me, this say block will say: “Hi awesome-llama! Welcome to scratchtown zoo.”

If a user is not signed in, the username block will be blank, so something extra is needed.
It's up to you to decide. Maybe you could have the current scripts run, asking for the user's name. Alternatively, if you don't know the user's name, you could just not include it and say something like: “Hi! Welcome to scratchtown zoo.”

Last edited by awesome-llama (Feb. 19, 2021 14:24:24)

arvepro3579
Scratcher
100+ posts

I need help to create a username detecter? please help

whenclickedforeverifusername=Anythingthendostuff
CoolLionMan
Scratcher
1000+ posts

I need help to create a username detecter? please help

arvepro3579 wrote:

whenclickedforeverifusername=Anythingthendostuff
it doesn't have to be a forever loop because the username won't change
-Crlxx-
Scratcher
100+ posts

I need help to create a username detecter? please help

usernameDetects username of user

Last edited by -Crlxx- (Feb. 19, 2021 14:06:42)

HermioneGranger929
Scratcher
18 posts

I need help to create a username detecter? please help

You would put this question in Help with scripts, not in questions about scratch.
lordibel
Scratcher
1000+ posts

I need help to create a username detecter? please help

More advanced way
whenclickedifusername=listthendostuff
;harder for people to ‘hack’ and change the username to theirs

Last edited by lordibel (Feb. 19, 2021 14:44:45)

Alphysse
Scratcher
1000+ posts

I need help to create a username detecter? please help

lordibel wrote:

More advanced way
whenclickedifusername=listthendostuff
;harder for people to ‘hack’ and change the username to theirs
So only an amalgamation of the users in “List” can use the project?
lordibel
Scratcher
1000+ posts

I need help to create a username detecter? please help

Yes.
It's also easier so you don't have to do
if username contains ‘a’ or ‘b’ or ‘c’ or ‘d’ or ‘e’ or ‘f’ etc.
Alphysse
Scratcher
1000+ posts

I need help to create a username detecter? please help

lordibel wrote:

Yes.
It's also easier so you don't have to do
if username contains ‘a’ or ‘b’ or ‘c’ or ‘d’ or ‘e’ or ‘f’ etc.
I think you've misunderstood; an amalgam(ation) is the combination of several things.
If the list was [“Alphysse”, “lordibel”], then a user would have to be Alphysse AND lordibel to use the project.
listcontainsusername?
is a better way to implement this.

Last edited by Alphysse (Feb. 19, 2021 15:00:56)

lordibel
Scratcher
1000+ posts

I need help to create a username detecter? please help

Alphysse wrote:

lordibel wrote:

Yes.
It's also easier so you don't have to do
if username contains ‘a’ or ‘b’ or ‘c’ or ‘d’ or ‘e’ or ‘f’ etc.
I think you've misunderstood; an amalgam(ation) is the combination of several things.
If the list was [“Alphysse”, “lordibel”], then a user would have to be Alphysse AND lordibel to use the project.
listcontainsusername?
is a better way to implement this.
Ah yes. You would be right.

Powered by DjangoBB