NGAL_Account_Management

Neverwinter Gateway Advanced Library - Account Management

Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://update.greasyfork.org/scripts/9664/50209/NGAL_Account_Management.js

  1. // ==UserScript==
  2. // @name Neverwinter Gateway Advanced Library - Account Management
  3. // @description Adds account management functions
  4. // @originalAuthor Mihail Gershkovich
  5.  
  6. /*** Account Management ***/
  7. // Important! First load available GM Data!
  8. function ngaAccPushGM () {
  9. GM_setValue("AccName",ngaGamer.AccName.join(',')); //
  10. GM_setValue("AccMail",ngaGamer.AccMail.join(',')); //
  11. GM_setValue("AccPwd",ngaGamer.AccPwd.join(',')); //
  12. GM_setValue("AccTimer",ngaGamer.AccTimer.join(',')); //
  13. GM_setValue("AccQ",ngaGamer.AccName.length); //
  14. }
  15.  
  16. function ngaAddAcc () {if(GM_getValue("NewAccMail")&&GM_getValue("NewAccPwd")) {// check GM for NewAccMail and NewAccPwd
  17. var NGA_NewAccName = client.dataModel.model.loginInfo.publicaccountname; //read actual Account name
  18. if (!NGA_AccName.indexOf(NGA_NewAccName)) { //add new acc if there is no such element, else - substitute
  19. NGA_AccName.push(NGA_NewAccName);// push new Acc Name to array
  20. }
  21. AccID = NGA_AccName.indexOf(NGA_NewAccName); //get AccID
  22. NGA_AccMail[AccID] = GM_getValue("NewAccMail");// push new AccMail to array
  23. NGA_AccPwd[AccID]= GM_getValue("NewAccPwd");// push new AccPwd to array
  24. NGA_AccTimer[AccID]= 0;// push new AccPwd to array
  25. //now we push new data to GM:
  26. ngaAccPushGM();
  27. //now we add account options to NGA_Accounts select element:
  28. ngaAccOptCreate();
  29. NGA_NewAccName = null;
  30. }}//endif and endfunction
  31.  
  32. function ngaAccOptCreate() {
  33. for(var i = 0; i < ngaGamer.AccName.length; i++) {
  34. var item = document.createElement('option');
  35. item.appendChild(document.createTextNode(ngaGamer.AccName[i]));
  36. document.getElementById("nga_accounts").appendChild(item);
  37. }
  38. }
  39.  
  40. function ngaDelAcc () { //delete account
  41. AccID = NGA_AccName.indexOf(ngaGamer.AccAct); //get AccID
  42. NGA_AccMail.splice(AccID, 1);// delete actual AccMail from array
  43. NGA_AccPwd.splice(AccID, 1);// delete actual AccPwd from array
  44. NGA_AccTimer.splice(AccID, 1);// delete actual AccPwd from array
  45. ngaAccPushGM;
  46. }
  47.  
  48. /** End of Account Management**/