Enable devlopers settings in your phone(check on the internet how to do it, its easy but it might be slightly different for each phone), enable pointer location to be able to check easily x,y coordinates of each click on screen.
Write x,y coordinates for each click that is needed to enter the password (and perform gestures to go to unlocking screen first).
Create macro with any trigger you like and add actions:
Screen on
Wait few seconds
Ui interaction - swipe to go to unlocking screen
Wait a second or even more so it was more reliable
Ui interaction - click - x,y coordinates of first number
Wait like 300ms (need to be tested cause it can't be clicking too quickly)
UI interaction - click - x,y coordinates of next number
Wait like 300ms (need to be tested cause it can't be clicking too quickly)
....