Password Script

By DragonFlare on Oct 24, 2015

This is a password script i made for a friend it is fully tested and works. You have to replace "Change To File Path" with the path where your files will be i am working on adding more functions to it like the options to create directories, change directories and delete directories along with other functions. I will keep the script updated so check back often for updates.

Menu Channel,Status,Query,Nicklist {
  -
  Password
  .Create Password File {
    set %filepath Change to Filepath $+ $network $+ .password.txt
    if $isfile(%filepath) {
      halt
      echo -a File Exists
    }
    else {
      if ($$?!="File does not exist, Would you like to create this file?" == $true) {
        write %filepath $$?*="What would you like your password to be?"
        echo -a File %filepath Created.
        unset %filepath
      }
      else echo -a Operation Canceled
      unset %filepath
    }
  }
  .Create Password {
    set %filepath Change To File Path $+ $network $+ .password.txt
    if ($read(%filepath) == $null) {
      write %filepath $$?*="Please enter your password."
      unset %filepath
    }
    else {
      if ($$?!="There is currently a password set, Would you like to change this password?" == $true) && ($$?*="Please enter your current password." == $read(%filepath)) {
        write -c %filepath
        write %filepath $$?*="Please enter your new password."
        echo -a Password Changed
        unset %filepath
      }
      else echo -a Password Unchanged
      unset %filepath
    }
  }
  .Change Password {
    set %filepath Change To File Path $+ $network $+ .password.txt
    if ($$?!="There is currently a password set, Would you like to change this password?" == $true) && ($$?*="Please enter your current password." == $read(%filepath)) {
      write -c %filepath
      write %filepath $$?*="Please enter your new password."
      echo -a Password Changed
      unset %filepath
    }
    else echo -a Password Unchanged
    unset %filepath
  }
  .Change Nickserv Password {
    set %filepath Change To File Path $+ $network $+ .password.txt
    if ($$?!="There is currently a password set, Would you like to change this password?" == $true) && ($$?*="Please enter your current password." == $read(%filepath)) {
      write -c %filepath
      write %filepath $$?*="Please enter your new password."
      ns set password $read(%filepath)
      echo -a Password Changed
      unset %filepath
    }
    else echo -a Password Unchanged
    unset %filepath
  }
}

Comments

Sign in to comment.
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.