Password for keypad! - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Password for keypad! (/showthread.php?tid=2683) |
Password for keypad! - phongvucba - 11.06.2020 Hi everybody ! I have a difficulty, I have 4 addresses 5/1/1; 5/5/2; 5/5/3; 5/5/4. How do I know in which order I have clicked one by one? For example: I press one by one: 5/1/1; 1/5/3; 1/5/4; 5/1/2 ->, then I know the turn is 1,3,4,2. My intention is to make a password. I press one by one: 5/1/4; 1/5/2; 1/5/1; 1/5/3 ->, then I know the turn is 4,2,1,3 Does anyone have a solution for it, or anyone who has ever done it. Hope everyone help me! Thank so much! RE: Password for keypad! - admin - 11.06.2020 Why not use built-in PIN code option for objects? RE: Password for keypad! - phongvucba - 11.06.2020 Thank Admin ! Not so! My intention is to enter the password using the keypads. The idea is that for each key a number, the problem is to press the correct number (its order). Example 1243 RE: Password for keypad! - Daniel - 11.06.2020 You can always check the update time and sort them from oldest to latest. RE: Password for keypad! - phongvucba - 11.06.2020 Yes, It's right ! We use the function os.time() or os.microtime() ? thank everyone ! RE: Password for keypad! - Daniel - 12.06.2020 Single object update time you collect like this Code: myobject = grp.find('0/0/2') You can do the same with multiple objects when using tag for several objects. Code: myobjects = grp.tag('TAG') RE: Password for keypad! - Erwin van der Zwart - 12.06.2020 Hi, I created this a few years ago in custom JS, works a lot faster and smoother.. 1) Create 10 buttons and give it a custom class pin0 to pin9 2) Create 1 button with custom class "pinback" 3) Create 1 button with custom class "pincancel" 4) Create a text label with custom cllass "entered" 5) Create a 4 byte signed integer object (in this sample "63/7/254") 6) Add this script to custom JS : Code: $(function(){ You can attached a LUA script to 63/7/254 to compare the enter code with your desired code and if it match execute the action.. BR, Erwin RE: Password for keypad! - phongvucba - 13.06.2020 Thank so much ! Everyone ! But I want an address to reset. For example, the address 1/1/1 1byte (it's from 0-255). I want if in 10s it has no activity, it will reset 1/1/1 = 0, and if less than 10s it has an impact then it will count from the last impact. Like the sensor, it turns off every 10 seconds if there is no motion. --------------- (In other words I mean) Alternatively, my Delay command (os.delay) is repeated every time I change the value. I don't want that, I just want the Delay command to work for the first time. For example: grp.write ('1/1/1', true) os.sleep (10) grp.write ('1/1/1', false) ---------------- Then in about 10 seconds, I press the address 1/1/1 4 times, then my Delay command was repeated 4 times, and it made the value of 1/1/1 = fasle repeat 4 times. I don't want that, I just need it to work for the first time(1/1/1 = fasle repeat 0 times). I was thinking Delay just paused the command line to execute. It then executes again after the set number of seconds. Leads to 1/1/1 = false repetition. I tried os.kill and return. but not work. Thanks everyone ! thank all! RE: Password for keypad! - Daniel - 15.06.2020 What about if you just use grp.checkwrite('1/1/1', false) RE: Password for keypad! - phongvucba - 15.06.2020 oh.. Thank so much ! Daniel ! I done it's ! Thank all! |