Password Generator.

By Protheus on Nov 18, 2011

First of all, im posting this from my cellphone so if there are any typos i am truly sorry. Second, i welcome criticism as long as you dont insult me or my knowledge of mSL. This is my simple passgen coded with DCX. Uses system icons. Enjoy.

alias pass {
if ($dialog(pass)) { dialog -x pass }
dialog -m pass pass
}

alias DCX_pass {
}
dialog pass {
title "ProSec-iRc PassGen"
size -1 -1 100 60
option dbu
box "", 1, 1 3 98 51
}
on *:dialog:pass:init:*: {
dcx Mark $dname pass_cb
xdialog -g pass +b $rgb(0,0,0)
xdialog -c $dname 2 button 5 18 190 19
xdid -t $dname 2 Alpha
xdid -w $dname 2 +n 146 shell32.dll
xdialog -c $dname 3 button 5 39 190 19
xdid -t $dname 3 Numeric
xdid -w $dname 3 +n 146 shell32.dll
xdialog -c $dname 4 button 5 61 190 19
xdid -t $dname 4 Alpha-Numeric
xdid -w $dname 4 +n 146 shell32.dll
xdialog -c $dname 5 button 5 82 190 19
xdid -t $dname 5 Close
xdialog -w $dname 5 +a 44 shell32.dll
xdid -w $dname 5 +n 27 shell32.dll
}

alias pass_cb {
if ($2 == sclick) && ($3 == 2) {
echo -a $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z)
}
else if ($2 == sclick) && ($3 == 3) {
echo -a $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9)
}
else if ($2 == sclick) && ($3 == 4) {
echo -a $rand(0,9) $+ $rand(0,9) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(A,Z) $+ $rand(a,z)
}
else if ($2 == sclick) && ($3 == 5) {
dialog -x pass
}
}

Comments

Sign in to comment.
Protheus   -  Nov 22, 2011

ah ok.

 Respond  
Lucius   -  Nov 22, 2011

I was just giving an example of what extremity said.

 Respond  
Protheus   -  Nov 22, 2011

@Lucius, what is this?

 Respond  
Lucius   -  Nov 22, 2011
    xdid -t $dname 46 -o
    xdid -C $dname 46 +bk $color(12)
    xdid -c $dname 46 +n $color(4) 

Image
text says -o (for deop)
outline colour is blue
text colour is red

Hope that helps.

 Respond  
Protheus   -  Nov 20, 2011

lmao. good point.

 Respond  
IllogicTC   -  Nov 20, 2011

Nope. I'm not interested in being a product to be sold to advertising companies more often than what already happens in daily life.

 Respond  
Protheus   -  Nov 20, 2011

lol, ill check that out. you have facebook?

 Respond  
IllogicTC   -  Nov 20, 2011

In their forums they've been posting newer and newer DCX versions..... maybe you could thumb through there. Most of them are just development builds, though. It seems like they mostly lost interest in it.

 Respond  
Protheus   -  Nov 20, 2011

thanks. will incorporate that when time permits. working on my about dialog. will post when finished

 Respond  
extremity   -  Nov 19, 2011

Unfortunately, colored buttons have to be drawn using bitmap images in DCX. You can either specify a button bitmap or just use an image control. The windows API allows you to change the background color of a button object, but DCX does not support the property of BackColor yet, as far as i know.

Looking at the documentation, I have never messed with hgradient or vgradient. I do not know how to use them.

On the note of reducing code, if using v6.35 or higher, you can use:

 $regsubex($str(.,4),/./g,$r(a,z) $+ $r(A,Z)) 

rather than

$rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z)

to trim a bit

 Respond  
Protheus   -  Nov 19, 2011

thats my experience, also. i can do color text, i just think it looks cheezy. they need to implement colored buttons in the next release.

 Respond  
IllogicTC   -  Nov 19, 2011

ProSec

i use dcx because it looks cleaner. i just like the look lol. still trying to figure out how to do colored buttons though.

I can show you how to do coloured TEXT. As for coloured buttons, I don't think I had figured that out, either. I faintly remember trying when building Limeplayer... but the text was the best I could get going....

EDIT: Actually, it's not possible as of 1.4.0 (the last official build released via their website). When you try to use xdid -C +b it will just give the button a thick black outline no matter what colour you choose.

 Respond  
Protheus   -  Nov 18, 2011

posted a rough picture.

 Respond  
Protheus   -  Nov 18, 2011

hmmm mine looks loads different than that, and i dont know what the window handle error is about. Cant upload a screen from my retarded phone.

 Respond  
Sorasyn   -  Nov 18, 2011

Ah, sweet thanks!

 Respond  
Frenetic   -  Nov 18, 2011
D_ERROR ChangeHwndIcon (Invalid Flags)

I get that upon opening it.

Also SunnyD: Image

 Respond  
Sorasyn   -  Nov 18, 2011

Hm you'll have to take a screenie or I'll have load it lmao. Curious as to how it looks.

 Respond  
Protheus   -  Nov 18, 2011

i use dcx because it looks cleaner. i just like the look lol. still trying to figure out how to do colored buttons though.

 Respond  
IllogicTC   -  Nov 18, 2011

http://dcx.scriptsdb.org/archive.htm For the official download spot. Also, this site has instructions for all the DCX commands, so if you wanted to modify this script it would be easier.

I don't get why DCX was used for a such a simple system, though x.x

 Respond  
Frenetic   -  Nov 18, 2011

Here's a link to all the DLLs on my site, http://www.hawkee.com/phpBB2/viewtopic.php?t=23225

 Respond  
Protheus   -  Nov 18, 2011

Truthfully i dont like using loops, as its simpler to do it this way, and as far as the dcx dll, when i first started scripting, no one would help me. Im self taught, which means i had to find these particular dlls myself. Made me a better scripter. Besides, a quick google search will get you the appropriate file. And most importantly, im posting these things from a semi-smartphone, so i cant really upload files. It took me around an hour to transcribe these 60+ lines of code from my phone. Thanks for the tip though.

 Respond  
Sorasyn   -  Nov 18, 2011

You could cut down some by using a while loop to create the random passwords by passing a number of arguments to the alias itself, such as: length of the password, Pass type (numeric, alpha-numeric, etc.) Doing so could provide a wider spectrum of passwords to be generated.

It may also be prudent to, since it uses DCX, add a link to the file or post the DCX zip as a 'script' here on Hawkee so we can use it without having to go looking for it..

 Respond  
Protheus   -  Nov 18, 2011

nice. thanks bro.

 Respond  
Frenetic   -  Nov 18, 2011
echo -a $rand(0,9) $+ $rand(0,9) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(A,Z) $+ $rand(a,z)

Could be replaced and possibly shortened, with

$+($R(0,9),$r(0,9),$R(0,9),$r(a,z),$R(A,Z),$r(A,z),$R(0,9))

and so on if you get my point

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.