Advertisement
Guest User

Untitled

a guest
Mar 20th, 2013
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. //**********************************************************************************
  2. // ____ _ _ _ ____
  3. //| _ \ ___ ___ ____ | | ___ ____ ___ ___ __ ___ _ _ | |_| |/ __ |
  4. //| |__// _ \ / _ \ | _ \| | / _ \ | _ \ / _ \ / _| / _)/ _ \ | \| ||___ |\__ |
  5. //| | | __/ ||_|| | |__/| || __/ | |__/| __/ | | _\ \ ||_|| | \\ | | | | |
  6. //|_|___\___|_\___/_| |___|_|_\___|_| |____\___|_|_|_(___/ \___/_|_|\_|____|_|___|_|
  7. //------------------|_|-------------|_|---------------------------------------------
  8. //**********************************************************************************
  9. //===== rAthena Script =============================================================
  10. //= Security Manager
  11. //===== By: ========================================================================
  12. //= Peopleperson49 (Eddie)
  13. //===== Start Date: ================================================================
  14. //= 07MAR2010
  15. //===== Current Version: ===========================================================
  16. //= 1.4
  17. //===== Compatible With: ===========================================================
  18. //= rAthena SVN
  19. //===== Description: ===============================================================
  20. //= Allows a player to set up a password to help protect their account. It uses a
  21. //= simple OnWhisperGlobal function.
  22. //===== Version Control: ===========================================================
  23. //= 1.0 First Version.
  24. //= 1.1 Added option to change the current password.
  25. //= 1.2 Optomized script to remove #PWCheck and just use the #AccountPW$. Thanks to
  26. //= Joseph on rAthena.org.
  27. //= 1.3 Replaced the last #PWCheck that I missed before.
  28. //= 1.4 Replaced the whisper command with bindatcmd function.
  29. //===== Additional Comments:========================================================
  30. //=
  31. //==================================================================================
  32.  
  33. - script SecurityManager -1,{
  34.  
  35. OnInit:
  36. bindatcmd("security","SecurityManager::OnAtcommand");
  37. end;
  38.  
  39. OnAtcommand:
  40. switch(prompt("Change Current Password:Set New Password:Delete Current Password:Why Passwords Are Important?")) {
  41. case 1:
  42. if(#PWCheck==0) { mes "You do not currently have a password set."; close; }
  43. mes "Please enter your current personal account password.";
  44. input .@AccountPW$;
  45. if(.@AccountPW$!=#AccountPW$) { next; mes "That password does not match your original one."; close; }
  46. next;
  47. mes "What would you like to change your current password to?";
  48. input .@AccountPW$;
  49. next;
  50. set .@RandomFinalize,rand(100,999);
  51. mes "Are you sure you want to change your password to ^FF0000"+.@AccountPW$+"^000000? If your 100% sure type the number ^0000FF"+.@RandomFinalize+"^000000.";
  52. input .@Finalize;
  53. if(.@Finalize!=.@RandomFinalize) { next; mes "It is probably for the best that you keep your current password!"; close; }
  54. set #AccountPW$,.@AccountPW$;
  55. set #PWCheck,1;
  56. next;
  57. mes "You password has been set as ^FF0000"+#AccountPW$+"^000000.";
  58. close;
  59. case 2:
  60. if(#PWCheck!=0) { mes "You already have a personal account password."; close; }
  61. mes "What would you like your new password to be?";
  62. input .@AccountPW$;
  63. next;
  64. set .@RandomFinalize,rand(100,999);
  65. mes "Are you sure you want to set your password to ^FF0000"+.@AccountPW$+"^000000? If your 100% sure type the number ^0000FF"+.@RandomFinalize+"^000000.";
  66. input .@Finalize;
  67. if(.@Finalize!=.@RandomFinalize) { next; mes "You really should set up a personal account password."; close; }
  68. set #AccountPW$,.@AccountPW$;
  69. set #PWCheck,1;
  70. next;
  71. mes "Your password has been set as ^FF0000"+#AccountPW$+"^000000.";
  72. close;
  73. case 3:
  74. if(#PWCheck==0) { mes "You do not currently have a personal account password set."; close; }
  75. mes "Please enter your current personal account password.";
  76. input .@AccountPW$;
  77. if(.@AccountPW$!=#AccountPW$) { next; mes "That password does not match your original one."; close; }
  78. next;
  79. set .@RandomFinalize,rand(100,999);
  80. mes "Are you sure you want to clear your current password? If your 100% sure type the number ^0000FF"+.@RandomFinalize+"^000000.";
  81. input .@Finalize;
  82. if(.@Finalize!=.@RandomFinalize) { next; mes "It is probably for the best that you keep your current password!"; close; }
  83. set #AccountPW$,0;
  84. set #PWCheck,0;
  85. mes "Your password has been deleted.";
  86. close;
  87. case 4:
  88. mes "- Setting a personal account password adds an additional layer of defense to protecting your account.";
  89. mes "- It cannot be accessed by GameMaster's or other players without direct access to the RoUG database.";
  90. mes "- The downside is that if you forget your password it cannot be easily retrieved!";
  91. mes "- Passwords must be from 4 to 16 characters long and are CASE SENSITIVE!";
  92. close;
  93. case 255:
  94. mes "Your security is our business!";
  95. close;
  96. }
  97. }
  98.  
  99. OnPCLoginEvent:
  100. if(#AccountPW$!="") { next; mes "[Securty Manager]"; mes "Enter your personal account password."; input .@AccountPW$; if(.@AccountPW$!=#AccountPW$) { mes "[Securty Manager]"; mes "Invalid password entry."; close2; atcommand "@kick "+strcharinfo(0); end; } next; mes "[Securty Manager]"; mes "You password has been accepted."; }
  101. end;
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement