Password Bank + Generator V.2

By ^Neptune on Apr 26, 2008

Image

Put in remotes and type /passbank

This snippet will store your passwords (useful for people who go on a lot of servers) and has a generator found at http://www.hawkee.com/snippet/2419/ albeit a bit edited, so PowerDragon technically gets credit for that.

I guess you can use it for websites too, but you'd have to change the box text to Server/Website.

--Updates--
Doesn't use $? anymore
Error Messages
Generator updated

Enjoy!

alias passbank {
  dialog -md passbank passbank
}

dialog passbank {
  title "Password Bank"
  size -1 -1 470 139
  option pixels
  list 1, 10 15 150 90, vsbar size
  box "Server", 2, 5 0 160 110
  list 3, 175 15 135 90, vsbar size
  box "Nickname", 4, 170 0 145 110
  list 5, 325 15 135 90, vsbar size
  box "Password", 6, 320 0 145 110
  button "Add", 7, 10 112 65 25
  button "Edit", 8, 80 112 65 25
  button "Delete", 9, 150 112 65 25
  button "Password Generator", 10, 355 112 110 25
}

on *:dialog:passbank:sclick:*: {
  if ($did == 7) {
    dialog -md add add 
  }
  if ($did == 8) {
    if (!$did(1).sel) {
      noop $input(You have not selected anything to edit.,uwo,Error!)
    }
    else {
      dialog -md edit edit
    }
  }
  if ( $did == 1 ) || ($did == 3) || ($did == 5) { did -c passbank 1,3,5 $did($dname,$did).sel
  }
  if ($did == 9) {
    if (!$did(1).sel) {
      noop $input(You have not selected anything to delete.,uwo,Error!)
    }
    else {
      did -d $dname 1 $did(1).sel
      write -dl $+ $did(1).sel servpass.txt
      did -d $dname 3 $did(3).sel
      write -dl $+ $did(3).sel nickpass.txt
      did -d $dname 5 $did(5).sel
      write -dl $+ $did(5).sel passpass.txt
    }
  }
  if ($did == 10) {
    dialog -md generater generater
  }
}
on *:dialog:passbank:init:0: {
  if $read(servpass.txt) { 
    var %x = 1
    while ( %x <= $lines(servpass.txt)) {
      did -a passbank 1 $read(servpass.txt,%x)
      inc %x
    }
  }
  if $read(nickpass.txt) { 
    var %x = 1
    while ( %x <= $lines(nickpass.txt)) {
      did -a passbank 3 $read(nickpass.txt,%x)
      inc %x
    }
    if $read(passpass.txt) { 
      var %x = 1
      while ( %x <= $lines(passpass.txt)) {
        did -a passbank 5 $read(passpass.txt,%x)
        inc %x
      }
    }
  }
}

dialog generater {
  title "Password Generator"
  size -1 -1 289 45
  option pixels
  edit "", 4, 1 24 285 19, read autohs
  text "Character Number:", 1, 2 4 95 17
  edit "", 2, 100 2 100 20
  button "Generate", 3, 204 2 81 20
}

on *:dialog:generater:sclick:*: {
  if (!$did(2).text) {
    noop $input(Please enter a character number.,uwo,Error!)
  }
  elseif ($did(2).text > 100) {
    noop $input(Please do not put in a number over 100 or any any other characters except 0-9.,uwo,Error!)
  }
  elseif ($did == 3) {
    createpass
  }
}

alias -l createpass {
  var %a
  if ($1 == -alnum) {
    %a = 1
    tokenize 32 $2-
  }
  var %i = $iif($1 isnum 5-50,$int($1),$did(2).text)),%r,%t,%z,%o
  while (%i) {
    %t = $r(1,$iif(%a,4,5))
    if (%t isnum 1-2) { %z = $r(0,9) }
    elseif (%t == 3) { %z = $r(a,z) }
    elseif (%t == 4) { %z = $r(A,Z) }
    else { %z = $mid([]()<>?!+-*:=~$&/_|%#,$r(1,21),1) }
    if (%o !=== %z) && ($count(%r,%z) < 2) { %r = %r $+ %z }
    else { continue }
    %o = %z
    dec %i
  }
  $iif($isid,return,did -ra $dname 4 $iif(%a,alpha-numeric):) %r
}

dialog -l add {
  title "Add Information"
  size -1 -1 180 150
  option pixels
  edit "", 1, 10 15 160 20, autohs
  edit "", 2, 10 55 160 20, autohs
  edit "", 3, 11 95 160 20, pass autohs
  box "Server", 4, 5 0 170 40
  box "Nickname", 5, 5 40 170 40
  box "Password", 6, 5 80 170 40
  button "Add", 7, 5 125 170 20
}

on *:dialog:add:sclick:7: {
  if (!$did(1).text) {
    noop $input(You did not put anything in the server box.,uwo,Error!)
  }
  elseif (!$did(2).text) {
    noop $input(You did not put anything in the nickname box.,uwo,Error!)
  }
  elseif (!$did(3).text) {
    noop $input(You did not put anything in the password box.,uwo,Error!)
  }
  else {
    write -a servpass.txt $did(1).text
    did -a passbank 1 $did(1).text
    write -a nickpass.txt $did(2).text
    did -a passbank 3 $did(2).text
    write -a passpass.txt $did(3).text
    did -a passbank 5 $did(3).text
    dialog -x $dname
  }
}

dialog -l edit {
  title "Edit Information"
  size -1 -1 180 150
  option pixels
  edit "", 1, 10 15 160 20, autohs
  edit "", 2, 10 55 160 20, autohs
  edit "", 3, 11 95 160 20, autohs
  box "Server", 4, 5 0 170 40
  box "Nickname", 5, 5 40 170 40
  box "Password", 6, 5 80 170 40
  button "Edit", 7, 5 125 170 20
}

on *:dialog:edit:init:0: {
  did -a $dname 1 $did(passbank,1).seltext
  did -a $dname 2 $did(passbank,3).seltext
  did -a $dname 3 $did(passbank,5).seltext
}

on *:dialog:edit:sclick:7: {
  if (!$did(1).text) {
    noop $input(You did not put anything in the server box.,uwo,Error!)
  }
  if (!$did(2).text) {
    noop $input(You did not put anything in the nickname box.,uwo,Error!)
  }
  if (!$did(3).text) {
    noop $input(You did not put anything in the password box.,uwo,Error!)
  }
  else {
    write -l $+ $did(passbank,1).sel servpass.txt $did(1).text
    did -o passbank 1 $did(passbank,1).sel $did(edit,1).text
    write -l $+ $did(passbank,3).sel nickpass.txt $did(2).text
    did -o passbank 3 $did(passbank,3).sel $did(edit,2).text
    write -l $+ $did(passbank,5).sel passpass.txt $did(3).text
    did -o passbank 5 $did(passbank,5).sel $did(edit,3).text
    dialog -x $dname
  }
}

Comments

Sign in to comment.
Dodge   -  May 08, 2009

Cool Script, Good Idea and Handy. I'll Use This.

 Respond  
eyiezinc   -  May 08, 2009

Nice script Neptune :-)

 Respond  
Pass   -  Oct 03, 2008

I'd recommend an encryption method for the password storage, such as mIRC's $encode, rot13 (doesn't allow symbols), or rot47 (allows symbols).

Here's a smaller alternative for a random password, also

$remove($($str($!r(A,z) $+ $chr(32),$iif($1 isnum,$v1,$r(5,10))),2),$chr(32))

Although, the code above doesn't incorporate the "-alnum" specification.

 Respond  
Bullet_Dodger   -  Oct 03, 2008

Rofl @ Screen shot > Eugene is gay

 Respond  
Lord-Harlot   -  Apr 26, 2008

Lol

It rocks.

sort off.

 Respond  
EL   -  Apr 26, 2008

Still sould find yur source for that generator or code a simple one of yur own its not hard to do im sure use fricken $rand simplle way lol.Anyways also you should use edit fields and not $? its sloppy an lazy not to.other wise it not bad still needs to be cleaner.Adn fix that password gens dialogs it all sortas fecked up man.`-.-

P.S: Least tthis is keepin ya busy so we dotn have to hear about that fuckin mirc browser :P

 Respond  
^Neptune   -  Apr 26, 2008

Accidentally forgot to update it with RusselB\'s suggestion on the forum (thankies!), now has an alias to open.

 Respond  
Jonesy44   -  Apr 26, 2008

lmao @ highlight xD

Nice script Neptune :-)

 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.