mIRC profiles

By blackvenomm666 on Oct 30, 2012

Basically what this is is a profile system for mIRC which allows you to easily allow more than one person use one irc client or if you have multiple nicks with different info for each of them this will allow you to easily change information it should be self explanatory once it's open if you have questions ask this was a forum request by @unseen it's not 100% completed i plan to tweak it a bit and make it better but it is fully functional as is

Menu Menubar,Nicklist,Channel {
  .Mirc profile system: dialog $iif($dialog(mircprofile.system),-v,-md mircprofile.system) mircprofile.system 
}
Dialog mircprofile.system {
  Title "mircprofilesystem"
  Size -1 -1 146 86
  Option dbu
  list 1, 02 02 90 90, hsbar vsbar
  Button "add" ,2, 94 02 50 10, autohs
  Button "login" ,3, 94 14 50 10, autohs
  Button "edit" ,4, 94 26 50 10, autohs
}
on *:Dialog:mircprofile.system:*:*: {
  if ($devent == init) {
    set %usernames $readini(mircprofile.ini, users, loginnames)
    testwhile 
  }
  if ($devent == sclick) {
    if ($did == 2) {
      openeditor
      .dialog -x mircprofile.system
    }
    if ($did == 3) {
      if (!$did(1).sel) {
        noop $input(Please select a profile to log into from the list)
      }
      else { var %vartest $?="what's your pw"
        if (%vartest == $readini(mircprofile.ini, $did(1).seltext ,Pass)) {
          .set %mircprofile $did(1).seltext
          .nick $readini(mircprofile.ini, %mircprofile ,nick))
          .anick $readini(mircprofile.ini, %mircprofile ,altnick))
          .emailaddr $readini(mircprofile.ini, %mircprofile ,Email))
          .identd on $readini(mircprofile.ini, %mircprofile ,ident))
          if ($readini(mircprofile.ini, %mircprofile ,serveraddy)) {
            .server -m $readini(mircprofile.ini, %mircprofile ,serveraddy))
          }
        }
      }
    }
    if ($did == 4) {
      if (!$did(1).sel) {
        noop $input(Please select a profile to edit into from the list)
      }
      else { 
        .set %editprofile $did(1).seltext
        set %vartest $?="what's your pw"
        if (%vartest == $readini(mircprofile.ini, $did(1).seltext ,Pass)) {
          .set %mircprofile $did(1).seltext
          openeditor 
          .dialog -x mircprofile.system
        }
      }
    }
  }
}
alias openeditor { dialog -v,-md profeditor.system profeditor.system }
Dialog profeditor.system {
  Title "mircprofileeditor"
  Size -1 -1 55 97
  Option dbu
  edit "Enter real name" ,1, 02 02 50 10, autohs
  edit "Enter email" ,2, 02 12 50 10, autohs
  edit "Enter ident" ,3, 02 22 50 10, autohs
  edit "Enter nick " ,4, 02 32 50 10, autohs
  edit "Enter alt nick" ,5, 02 42 50 10, autohs
  edit "Enter server addy" ,6, 02 52 50 10, autohs
  edit "Enter server pw" ,7, 02 62 50 10, autohs
  Button "save" ,9, 02 74 50 10, autohs
  Button "delete" ,10, 02 86 50 10, autohs

}
on *:Dialog:profeditor.system:*:*: {
  if ($devent == init) {
    if (%editprofile) {
      .did -r profeditor.system 1-7
      .did -a profeditor.system 1 %editprofile
      .did -a profeditor.system 2 $readini(mircprofile.ini, %editprofile ,Email))
      .did -a profeditor.system 3 $readini(mircprofile.ini, %editprofile ,ident))
      .did -a profeditor.system 4 $readini(mircprofile.ini, %editprofile ,nick))
      .did -a profeditor.system 5 $readini(mircprofile.ini, %editprofile ,altnick))
      .did -a profeditor.system 6 $readini(mircprofile.ini, %editprofile ,serveraddy))
      .did -a profeditor.system 7 $readini(mircprofile.ini, %editprofile ,Pass))

    }
  }
  if ($devent == sclick) {
    if ($did == 9) {
      .set %usernames $addtok(%usernames, $did(1).text ,44)
      .timer 1 2 addprofnick
      writeini mircprofile.ini $did(1).text email $did(2).text
      writeini mircprofile.ini $did(1).text ident $did(3).text
      writeini mircprofile.ini $did(1).text nick $did(4).text
      writeini mircprofile.ini $did(1).text altnick $did(5).text
      writeini mircprofile.ini $did(1).text serveraddy $did(6).text
      writeini mircprofile.ini $did(1).text pass $did(7).text

    }
    if ($did == 10) {
      remini mircprofile.ini $did(1).text
      set %usernames $remtok(%usernames, $did(1).text ,44)
      .timer 1 2 addprofnick
    }
  }
  if ($devent == close) {
    .unset %editprofile
    .unset %mircprofile
    .unset %vartest
  }
}
alias openmircprofsystem { dialog -v,-md mircprofile.system mircprofile.system }
alias addprofnick { 
  if (!%usernames) {
    remini mircprofile.ini users
    .dialog -x profeditor.system
    openmircprofsystem
    .unset %editprofile
    .unset %mircprofile
  }
  else {
    .writeini -n mircprofile.ini users loginnames %usernames
    .dialog -x profeditor.system
    openmircprofsystem
    .unset %editprofile
    .unset %mircprofile
  }
}
alias testwhile {
  var %a = 1, %b = $numtok(%usernames,44)
  while (%a <= %b) {
    did -a mircprofile.system 1 $gettok(%usernames,%a,44)
    inc %a
  }
}

------------------------------------------------------------------------

Menu Menubar,Nicklist,Channel {
  .Mirc profile system: dialog $iif($dialog(mircprofile.system),-v,-md mircprofile.system) mircprofile.system 
}
Dialog mircprofile.system {
  Title "mircprofilesystem"
  Size -1 -1 146 86
  Option dbu
  list 1, 02 02 90 90, hsbar vsbar
  Button "add" ,2, 94 02 50 10, autohs
  Button "login" ,3, 94 14 50 10, autohs
  Button "edit" ,4, 94 26 50 10, autohs
}
on *:Dialog:mircprofile.system:*:*: {
  if ($devent == init) {
    set %usernames $readini(mircprofile.ini, users, loginnames)
    testwhile 
  }
  if ($devent == sclick) {
    if ($did == 2) {
      openeditor
      .dialog -x mircprofile.system
    }
    if ($did == 3) {
      if (!$did(1).sel) {
        noop $input(Please select a profile to log into from the list)
      }
      else { 
          .set %mircprofile $did(1).seltext
          .nick $readini(mircprofile.ini, %mircprofile ,nick))
          .anick $readini(mircprofile.ini, %mircprofile ,altnick))
          .emailaddr $readini(mircprofile.ini, %mircprofile ,Email))
          .identd on $readini(mircprofile.ini, %mircprofile ,ident))
          if ($readini(mircprofile.ini, %mircprofile ,serveraddy)) {
            .server -m $readini(mircprofile.ini, %mircprofile ,serveraddy))
          }
        }
      }
      if ($did == 4) {
      if (!$did(1).sel) {
        noop $input(Please select a profile to edit into from the list)
      }
      else { 
        .set %editprofile $did(1).seltext
        set %vartest $?="what's your pw"
        if (%vartest == $readini(mircprofile.ini, $did(1).seltext ,Pass)) {
          .set %mircprofile $did(1).seltext
          openeditor 
          .dialog -x mircprofile.system
        }
      }
    }
  }
}
alias openeditor { dialog -v,-md profeditor.system profeditor.system }
Dialog profeditor.system {
  Title "mircprofileeditor"
  Size -1 -1 55 97
  Option dbu
  edit "Enter real name" ,1, 02 02 50 10, autohs
  edit "Enter email" ,2, 02 12 50 10, autohs
  edit "Enter ident" ,3, 02 22 50 10, autohs
  edit "Enter nick " ,4, 02 32 50 10, autohs
  edit "Enter alt nick" ,5, 02 42 50 10, autohs
  edit "Enter server addy" ,6, 02 52 50 10, autohs
  edit "Enter server pw" ,7, 02 62 50 10, autohs
  Button "save" ,9, 02 74 50 10, autohs
  Button "delete" ,10, 02 86 50 10, autohs

}
on *:Dialog:profeditor.system:*:*: {
  if ($devent == init) {
    if (%editprofile) {
      .did -r profeditor.system 1-7
      .did -a profeditor.system 1 %editprofile
      .did -a profeditor.system 2 $readini(mircprofile.ini, %editprofile ,Email))
      .did -a profeditor.system 3 $readini(mircprofile.ini, %editprofile ,ident))
      .did -a profeditor.system 4 $readini(mircprofile.ini, %editprofile ,nick))
      .did -a profeditor.system 5 $readini(mircprofile.ini, %editprofile ,altnick))
      .did -a profeditor.system 6 $readini(mircprofile.ini, %editprofile ,serveraddy))
      .did -a profeditor.system 7 $readini(mircprofile.ini, %editprofile ,Pass))

    }
  }
  if ($devent == sclick) {
    if ($did == 9) {
      .set %usernames $addtok(%usernames, $did(1).text ,44)
      .timer 1 2 addprofnick
      writeini mircprofile.ini $did(1).text email $did(2).text
      writeini mircprofile.ini $did(1).text ident $did(3).text
      writeini mircprofile.ini $did(1).text nick $did(4).text
      writeini mircprofile.ini $did(1).text altnick $did(5).text
      writeini mircprofile.ini $did(1).text serveraddy $did(6).text
      writeini mircprofile.ini $did(1).text pass $did(7).text

    }
    if ($did == 10) {
      remini mircprofile.ini $did(1).text
      set %usernames $remtok(%usernames, $did(1).text ,44)
      .timer 1 2 addprofnick
    }
  }
  if ($devent == close) {
    .unset %editprofile
    .unset %mircprofile
    .unset %vartest
  }
}
alias openmircprofsystem { dialog -v,-md mircprofile.system mircprofile.system }
alias addprofnick { 
  if (!%usernames) {
    remini mircprofile.ini users
    .dialog -x profeditor.system
    openmircprofsystem
    .unset %editprofile
    .unset %mircprofile
  }
  else {
    .writeini -n mircprofile.ini users loginnames %usernames
    .dialog -x profeditor.system
    openmircprofsystem
    .unset %editprofile
    .unset %mircprofile
  }
}
alias testwhile {
  var %a = 1, %b = $numtok(%usernames,44)
  while (%a <= %b) {
    did -a mircprofile.system 1 $gettok(%usernames,%a,44)
    inc %a
  }
}

Comments

Sign in to comment.
blackvenomm666   -  Nov 21, 2012

i had actually stopped doing any type of scripting/coding for a bit then saw a request for this and it was something i had meant to do a while ago lol so i decided to finally do it

 Respond  
blackvenomm666   -  Nov 21, 2012

thanks @bcr0ck and thanks for the like @VxD aka DEATHJ0KER

 Respond  
bcr0ck   -  Nov 11, 2012

very nice well done

 Respond  
blackvenomm666   -  Nov 03, 2012

@unseen the bottom one under then ---------- no longer has the password request upon login

 Respond  
unseen   -  Nov 02, 2012

hello,

as for the delete function, yea I've seen it, sorry it was my bad,
but also would be good if it was out on the main panel, and multi profile select to be possible in case somebody has lots of profiles and wants to filter it.

on the other hand, the server pass I believe is the one of the psybnc / bnc password is. but whenever u click on a profile and press on login,
you receive a box where it asks for a password, and in this case I believe the server pass maybe.

So I was thinking about this specific box that appears after clicking on login. why does it appear ? and if it's possible for it to be removed.
that's because I have lots of shell profiles. and it will be more practical as a fast login.

Kindly let me know if there's more details needed :)

Best regards

 Respond  
blackvenomm666   -  Nov 02, 2012

and as for the password. you can use the pw field on the profilea system for that. give me a server addy that i can find you at and your nick and a good time to find you there in usa central time prefferably

 Respond  
blackvenomm666   -  Nov 02, 2012

you can remove the profiles just click on the profile then click the edit button there is a delete button in the dialog that pops up

 Respond  
unseen   -  Nov 02, 2012

oh and I just noticed,
the ability to remove a profile as well :)

Best regards

 Respond  
unseen   -  Nov 02, 2012

Thanks again for the snippet :)

since you're going to do few more tweaks, few things should be added or being optional.

  • in case of using a psybnc, it requires a password, and I prefer to add that password on the profile as well.
  • Profile password to remain optional, either blank or filled, depends on the user's needs.

your efforts are most appreciated :)

Best regards

 Respond  
Lucius   -  Oct 31, 2012

That was pretty rapid. I never could get dialogs to click in my mind and since I haven't scripted in a long time I know even less XD

good job.

 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.