Hi, today I am making a simple Guide on how to add a captcha system.
For this tutorial, we will need the following components:
- - A canvas
- - A text box
- - A button
Generating a code
Add a canvas component to the screen and make it 80x210 pixels (height, width)
Set the line width to 4.
Set the paint color to
#535252FE and font size to 30.
Add a button as well as a textbox.
Change the button text to Verify
Set the textbox hint to Input code
Now, go to the blocks section.
We will start by adding random lines to the screen. Grab a
Screen1.Initialize block and put the following in it:
Now, from the block section change the color to black by adding this block:
Now, make a new variable and name it
Add the following blocks after
Canvas1.Paint Color, this will make a random generated code:
In the text input field, paste this:
Now, after the for range loop add this block, this will write the code:
Screen1.Initialize blocks should look like this:
Checking the code
Checking if the code is correct is simple as 1,2,3.
Button.Click event and make this:
Add the needed blocks up to your needs.
The end blocks should look something like this:
You can download the finished product here:
Feeling generous? Donate to me here: