NGAL_Account_Management

Neverwinter Gateway Advanced Library - Account Management

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/9664/50209/NGAL_Account_Management.js

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Neverwinter Gateway Advanced Library - Account Management
// @description Adds account management functions
// @originalAuthor Mihail Gershkovich

/*** Account Management ***/
// Important! First load available GM Data!
function ngaAccPushGM () {
	GM_setValue("AccName",ngaGamer.AccName.join(',')); //
	GM_setValue("AccMail",ngaGamer.AccMail.join(',')); //
	GM_setValue("AccPwd",ngaGamer.AccPwd.join(',')); //
	GM_setValue("AccTimer",ngaGamer.AccTimer.join(',')); //
	GM_setValue("AccQ",ngaGamer.AccName.length); //
}

function ngaAddAcc () {if(GM_getValue("NewAccMail")&&GM_getValue("NewAccPwd")) {//	check GM for NewAccMail and NewAccPwd
	var NGA_NewAccName = client.dataModel.model.loginInfo.publicaccountname; //read actual Account name
	if (!NGA_AccName.indexOf(NGA_NewAccName)) { //add new acc if there is no such element, else - substitute
	NGA_AccName.push(NGA_NewAccName);// push new Acc Name to array
	}
	AccID = NGA_AccName.indexOf(NGA_NewAccName); //get AccID
	NGA_AccMail[AccID] = GM_getValue("NewAccMail");// push new AccMail to array
	NGA_AccPwd[AccID]= GM_getValue("NewAccPwd");// push new AccPwd to array
	NGA_AccTimer[AccID]= 0;// push new AccPwd to array
	//now we push new data to GM:
	ngaAccPushGM();
	//now we add account options to NGA_Accounts select element:
	ngaAccOptCreate();
	NGA_NewAccName = null;
}}//endif and endfunction

function ngaAccOptCreate() {
	for(var i = 0; i < ngaGamer.AccName.length; i++) {
	  var item = document.createElement('option');
	  item.appendChild(document.createTextNode(ngaGamer.AccName[i]));
	  document.getElementById("nga_accounts").appendChild(item);
	}
}

function ngaDelAcc () {	//delete account
	AccID = NGA_AccName.indexOf(ngaGamer.AccAct); //get AccID
	NGA_AccMail.splice(AccID, 1);// delete actual AccMail from array
	NGA_AccPwd.splice(AccID, 1);// delete actual AccPwd from array
	NGA_AccTimer.splice(AccID, 1);// delete actual AccPwd from array
	ngaAccPushGM;
}

/** End of Account Management**/