int tokenEg
declare variable tokenEg as integer Math.floor()
Returns the value less than or equal to the specified number
ex 4.78 = 4.00 Math.random()
generate random number username.length()
length of the username

I know what each part means but i don’t know how can i proceed to apply that in the OB program.
I noticed there are options to add floor, random integer and length of username but how can i combine? and multiply like the code does, ty.

If you’re using OB2 you can use C# which is pretty similar to java.

int tokenEg = ((int)(Math.Floor((data.Random.Next() * input.USERNAME.Length))));

You can do the same with blocks easily. You want to start from the Length, then the random, then use a COMPUTE block to multiply them together, then pass the result to a Floor block and you’re done.