Using the lock script

Using the lock script

When cluck on 1 item it’s asking for enabling a new lock code and then this error coming

]]>
(Next Post) »

7 Commentsto Using the lock script

  1. Anonymous says:

    < ![CDATA[

    Please TrianguloY​ could you help me ?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    The wiki page added tags that are not part of the script. Wait some minutes and get the script from he wiki again (I’ll going to edit it now)

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Should work now

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Same issue there


    Could you post the script here ?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    /* About the script


    * Purpose : This lock screen is made of two scripts: one that unlocks the screen if you click the items in order (configurable, uses the id of the items) and the other just place the items in random cells (configurable too).


    * Author : TrianguloY


    * Link: https://plus.google.com/u/1/105066926163073195690/posts/eCZU9HHJX5F (with video)


    */



    var interval = 2000; /* time in milliseconds to wait until new lock set*/




    var tag = LL.getScriptTag();


    /* in case they don’t exist*/


    if( tag != undefined ){


    var data = JSON.parse( tag );


    }else{


    var data = new Object();


    }



    if(! (“a” in data)){


    data.a=0;


    }


    if(! (“secuence” in data)){


    data.secuence = [];


    data.secuence[0]=0;


    }



    var item = LL.getEvent().getItem();



    /* to notify the click*/


    item.setVisibility(false);


    setTimeout(function(){ item.setVisibility(true) ;},50);




    if(data.a<0){



    /* The set procces: negative numbers*/


    data.secuence[ -data.a -1]=item.getId();


    –data.a;


    data.timeout = setTimeout( function(){isDone(data.a);},interval);



    }else{



    /* The unlock procces: positive and zero numbers*/


    if(item.getId()!=data.secuence[data.a]){


    /* wrong*/


    data.a=0;


    }else{


    ++data.a;


    if(data.a==data.secuence.length){


    /* good*/


    data.a=0;




    /* unlock or set new one*/


    if(LL.isLocked()){


    LL.unlock();


    }else{


    reset();


    }


    }


    }


    }




    /* if no data found*/


    if( data.secuence[0]==0 ) reset();



    save(data);




    function save(tosave){


    LL.setScriptTag( JSON.stringify(tosave) );


    }




    function reset(){


    if(!confirm(“Set a new lock?”))return;


    data.secuence = [];


    data.a= -1;


    Android.makeNewToast(“Click the items in order\nWait “+ interval/1000 + ” second after the last click to apply” , false ).show() ;


    }




    function isDone(old){


    var now = JSON.parse( LL.getScriptTag() );


    if(old!=now.a)return;


    now.a=0;


    Android.makeNewToast(“Lock set with “+ data.secuence.length + ” steps”, false ).show();


    save(now);


    }

    ]]>

  6. Anonymous says:

    < ![CDATA[

    From the repository importer app it works fine. From a browser don’t … Hmm

    ]]>

  7. Anonymous says:

    < ![CDATA[

    TrianguloY yes strange.


    Thank you


    Working on your 2 scripts this evening. I’ll let you know

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *