FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Password protect script

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
mattyh
Newbie


Joined: 22 Mar 2008
Posts: 4

PostPosted: Sat May 17, 2008 7:15 am    Post subject: Password protect script Reply with quote

Is it possible to password protect a script? eg; Start script -> enter password -> continue script.

I have tried using a few of the widget's available but none seem to be able to handle this kind of task. The closest one I could get working is the TextFieldDialog except I can't get asterisks (*) to show up instead of key's pressed.

Are there key input handler's for widgets other than keypad's?

Cheers,
Matt
Back to top
View user's profile Send private message
mattyh
Newbie


Joined: 22 Mar 2008
Posts: 4

PostPosted: Sat May 17, 2008 7:40 am    Post subject: Reply with quote

What I was after was something like this but instead of Menu/Back buttons would have OK/Cancel.

[code:1]
var password_protected = true;
var passwordRow = null;
var passcode = "";

function check_Password() {
if ( password_protected ) {
var widget = CreateKeypadScreen( "password_" );
widget.title = "Password Protected";
widget.name = "Password";

blankRow1 = widget.CreateRow("", scCenter, scClip, scMedium );
blankRow2 = widget.CreateRow("", scCenter, scClip, scMedium );
promptRow = widget.CreateRow("Please enter your password:", scCenter, scScroll, scSmall );
blankRow3 = widget.CreateRow("", scCenter, scClip, scSmall );
passwordRow = widget.CreateRow( "", scCenter, scWrap, scLarge );

theTerminal.Push(widget);
} else password_OK();
}

function password_KeyUp( theScreen, theKey ) {

if ( theKey == "c" ) passcode = "";
else if ( theKey >= 0 && theKey <=9 && passcode.length < 8 ) passcode += theKey;

passwordRow.textualContent = "";
for (i = 1; i <= passcode.length; i++) passwordRow.textualContent += "*";

showmessage(passcode); // for testing only

}

[/code:1]
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue May 20, 2008 6:47 pm    Post subject: Reply with quote

The buttons of the keypad widget cannot be changed. I think you'd be better off with the text input widget (like you suggested in your first post), and make sure no one is having a peek at your phone when you enter the password.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group