Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Sun May 20, 2018 1:34 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: A simple password generator
Thanked: 1 time(s)  Unread post Posted: Sat Jun 29, 2013 2:41 am 
New User
New User
User avatar



Joined: Fri Jun 28, 2013 2:28 am
Posts: 6
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 142
Figured I'd make a simple project to get my feet wet with Blue Eye. So i built a simple 12 character random password generator. It was mainly a learning experience since i just started working with Blue Eye yesterday. Hope people can get some use out of it. I didn't add any fancy stuff but and the comments are pretty self explanatory.
Code:
 // Dragonfang's passgen
 // a simple random 12-character password generator
 // with  uppercase, lowercase, and digits
 // Dated: 2013 06 28 1907
 // Note: Places the password on the clipboard so it can be
 // pasted into another document if needed.
 begin
     Variable.Set("password", "")
     Variable.Set("passlen", "12")
     begin loop("{passlen}")
          Variable.Set random number("routing", "1", "3")
          if  Variable.Is equal to("routing", "1")
               begin
                    // inject a digit
                    Variable.Set random number("thischaracter", "1", "9")
               end
          if  Variable.Is greater than (Math)("routing", "1")
               begin
                    // create a lower case letter
                    Variable.Set random text("thischaracter", "1", "abcdefghijklmnopqrstuvwxyz")
               end
          if  Variable.Is equal to("routing", "3")
               begin
                    // make it uppercase
                    Variable.To upper case("thischaracter")
               end
          // append this character to the password
          Variable.Append text("password", "{thischaracter}")
     end
     // then display it and copy to the clipboard
     Window.Display message box("{password}", "yes")
     Clipboard.Set text("{password}")
 End
 

_________________
Computer programs are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent "correction". And once they leave home you can't control them anymore. But you love them anyway.


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Fri Aug 30, 2013 7:03 pm 
Silver Contributor
Silver Contributor
User avatar



Joined: Fri Aug 30, 2013 3:02 pm
Posts: 121
Been thanked: 15 time(s)
Has thanked: 1 time(s)
Contribution Points: 73
ill try this..


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Sat Nov 09, 2013 8:18 pm 
Silver Contributor
Silver Contributor



Joined: Mon Mar 19, 2012 12:49 am
Posts: 152
Been thanked: 3 time(s)
Has thanked: 1 time(s)
Contribution Points: 78
Very nice and creative, it worked for me perfectly even thou i don't like random passwords :D


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Sun Nov 10, 2013 5:33 pm 
Contributor
Contributor



Joined: Sun Nov 10, 2013 1:04 pm
Posts: 51
Been thanked: 5 time(s)
Has thanked: 9 time(s)
Contribution Points: 15
Nice nice that working perfect whit me :D


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Mon Nov 17, 2014 4:14 pm 
New User
New User



Joined: Mon Nov 17, 2014 4:02 pm
Posts: 4
Location: Indonesia
Been thanked: 0 time(s)
Has thanked: 2 time(s)
Contribution Points: 16
DragonFang = I have some questions, How about if i want to generate password that contains character like spaces,*,/, and other things?


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 1 time(s)  Unread post Posted: Mon Nov 17, 2014 5:45 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1775
Location: USA
Been thanked: 373 time(s)
Has thanked: 29 time(s)
Contribution Points: 16174
@fairyhunter13:

There's quite a few ways to do it, but keeping with the flow that he scripted it in I would change the "routing" variable to 1-4 then:
=1: 1-9
=2: abc...
=3: ABC...
=4: !@#...

@DragonFang:

Very nice macro...I've awarded you 100cp for your creativity!

Just so you know, you really don't need that second line in there. Since it's a static 12 character password generator, that number isn't going to change, so instead you could just re-write the third line like this (and delete the second line):
Code:
     begin loop("12")

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Mon Nov 17, 2014 6:40 pm 
Silver Contributor
Silver Contributor



Joined: Wed Jul 09, 2014 1:26 am
Posts: 165
Location: Lilithmon
Been thanked: 26 time(s)
Has thanked: 14 time(s)
Contribution Points: 134
Nice work!

A nice addition would be to let the user choose their password length.


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Thu Nov 20, 2014 9:56 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1775
Location: USA
Been thanked: 373 time(s)
Has thanked: 29 time(s)
Contribution Points: 16174
I finally got my computer in today so after about a month and a half I can finally use BEM again. I was so excited, I wrote the script for you guys (let me re-phrase that...I modified DragonFang's script for you; he's the creator of this macro).

Here's the code with both of your suggestions:
Code:
 begin
     Variable.Set("password", "")
     Window.Request user single choice input("Select the amount of characters you would like your password to be:", "8;9;10;11;12", "passlen")
     begin loop("{passlen}")
          Variable.Set random number("routing", "1", "4")
          if  Variable.Is equal to("routing", "1")
               begin
                    Variable.Set random number("thischaracter", "1", "9")
               end
          if  Variable.Is equal to("routing", "2")
               begin
                    Variable.Set random text("thischaracter", "1", "abcdefghijklmnopqrstuvwxyz")
               end
          if  Variable.Is equal to("routing", "3")
               begin
                    Variable.Set random text("thischaracter", "1", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
               end
          if  Variable.Is equal to("routing", "4")
               begin
                    Variable.Set random text("thischaracter", "1", "!@#$%^&*()")
               end
          Variable.Append text("password", "{thischaracter}")
     end
     Window.Display message box("{password}", "yes")
 end
So it now includes special characters and you can tell it how many characters you want the password; I took out the part about adding it to the clipboard, but you can add that back in if you want.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Mon Nov 24, 2014 7:07 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1182 time(s)
Has thanked: 132 time(s)
Contribution Points: 32823
Nice,

Could extend with:
Code:
Clipboard.Set text("{password}")


to automatically store the new password in clipboard, ready to be pasted somewhere.

Complete:

Code:
 begin
     Variable.Set("password", "")
     Window.Request user single choice input("Select the amount of characters you would like your password to be:", "8;9;10;11;12", "passlen")
     begin loop("{passlen}")
          Variable.Set random number("routing", "1", "4")
          if  Variable.Is equal to("routing", "1")
               begin
                    Variable.Set random number("thischaracter", "1", "9")
               end
          if  Variable.Is equal to("routing", "2")
               begin
                    Variable.Set random text("thischaracter", "1", "abcdefghijklmnopqrstuvwxyz")
               end
          if  Variable.Is equal to("routing", "3")
               begin
                    Variable.Set random text("thischaracter", "1", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
               end
          if  Variable.Is equal to("routing", "4")
               begin
                    Variable.Set random text("thischaracter", "1", "!@#$%^&*()")
               end
          Variable.Append text("password", "{thischaracter}")
     end
     Clipboard.Set text("{password}")
     Window.Display message box("{password}", "yes")
 end
 

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple password generator
Thanked: 0 time(s)  Unread post Posted: Mon Dec 22, 2014 8:39 am 
Silver Contributor
Silver Contributor
User avatar



Joined: Sun Mar 23, 2014 10:45 am
Posts: 122
Been thanked: 4 time(s)
Has thanked: 4 time(s)
Contribution Points: 14
Yes It's Work
GooooooooooooD Job

_________________
hello !


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group