Hello, I create a auto login system for lucera, my objetive is share for all on this community, but I cant get the window in the login lobby if someone can help I'll share all
My interface script (credits to BIT for the help):
BIT_AutologinWnd:
And next I edited the login.uc:
And in the xdat I make the next interface:






and in the "GFX" log7:

PROGRAM USE: xdat editor, LUSE, JPEXS FLASH DEMCOPILER and L2TOOL package gfx.
ERRORS:
Not appear the window.. if someone know the problem or want try, i can help to try it
My interface script (credits to BIT for the help):
BIT_AutologinWnd:
JavaScript:
/************************************
class BIT_AutologinWnd extends UICommonAPI;
const MAX_SAVE_LOGIN = 10;
var WindowHandle Me;
var ListCtrlHandle LoginListCtrl;
var CheckBoxHandle AutoSaveCheckBox;
function OnLoad() {
Me = GetWindowHandle("BIT_AutologinWnd");
LoginListCtrl = GetListCtrlHandle("BIT_AutologinWnd.LoginListCtrl");
AutoSaveCheckBox = GetCheckBoxHandle("BIT_AutologinWnd.AutoSaveCheckBox");
}
function OnShow() { /* Se ejecuta al cargar el juego */
local int i;
local string Login;
local array<string> SplitStr, empty;
local LVDataRecord Record;
SortInI();
LoginListCtrl.DeleteAllItem();
Record.LVDataList.length = 2;
Record.LVDataList[1].buseTextColor = True;
Record.LVDataList[1].TextColor = getInstanceL2Util().Yellow;
for(i = 0; i < MAX_SAVE_LOGIN; i++) { // ? Corrección: < en lugar de <=
GetINIString("BIT_AUTO_LOGIN", string(i), Login, "AUTOLOGIN.ini");
Split(Login, ",", SplitStr);
Record.LVDataList[0].szData = String(i);
Record.LVDataList[1].szData = SplitStr[0];
LoginListCtrl.InsertRecord(Record);
SplitStr = empty; // ? Corrección: "empty" en lugar de "emty"
}
}
function SortInI() { // Ordenar entradas del INI
local int i, inc;
local string Login, SortLogin[MAX_SAVE_LOGIN];
for(i = 0; i < MAX_SAVE_LOGIN; i++) { // ? Corrección: <
GetINIString("BIT_AUTO_LOGIN", string(i), Login, "AUTOLOGIN.ini");
if (Login != "") {
SortLogin[inc] = Login;
inc++;
}
}
for(i = 0; i < MAX_SAVE_LOGIN; i++) { // ? Corrección: <
SetINIString("BIT_AUTO_LOGIN", string(i), SortLogin[i], "AUTOLOGIN.ini");
}
RefreshINI("AUTOLOGIN.ini");
}
function AutoSaveLogin(String LoginID, String Pass) { // Autoguardar login y contraseña
local int i;
local string Login;
local array<string> SplitStr, empty;
if (AutoSaveCheckBox.IsChecked()) { // Si el checkbox está activado
for(i = 0; i < MAX_SAVE_LOGIN; i++) { // ? Corrección: <
GetINIString("BIT_AUTO_LOGIN", string(i), Login, "AUTOLOGIN.ini");
Split(Login, ",", SplitStr);
if (SplitStr[0] == LoginID) // Si el login ya existe, salir
return;
SplitStr = empty; // ? Corrección: "empty"
if (Login == "") {
SetINIString("BIT_AUTO_LOGIN", string(i), LoginID$","$Pass, "AUTOLOGIN.ini");
RefreshINI("AUTOLOGIN.ini");
break; // ? Corrección: break añadido
}
}
}
}
function OnClickButton(String strID) { /* Manejadores de clics en botones */
local string Login;
local array<string> SplitStr;
if (strID == "LoginBtn") {
GetINIString("BIT_AUTO_LOGIN", string(LoginListCtrl.GetSelectedIndex()), Login, "AUTOLOGIN.ini");
Split(Login, ",", SplitStr);
RequestLogin(SplitStr[0], SplitStr[1], 7); // Iniciar sesión en el juego
}
if (strID == "LoginDelBtn") {
SetINIString("BIT_AUTO_LOGIN", string(LoginListCtrl.GetSelectedIndex()), Login, "AUTOLOGIN.ini"); // ? Corrección: DeleteINIKey
RefreshINI("AUTOLOGIN.ini");
OnShow();
}
}
function OnClickListCtrlRecord(String strID) {
if (strID == "LoginListCtrl") {
AddSystemMessageString("Mes"@strID); // ? Mejora: Mensaje claro
}
}
defaultproperties()
And next I edited the login.uc:
JavaScript:
function onCallUCFunction( String funcName , string param )
{
local string id;
local string pass;
local int ncopt;
local string delString;
local int i ;
local string url;
//debug ( "onCallUCFunction" @ funcName @ param );
local BIT_AutologinWnd AutologinWnd;
AutologinWnd = BIT_AutologinWnd(GetScript("BIT_AutologinWnd"));//<-----------
switch (funcName )
{
case "setLogin":
//아이디
ParseString(param, "ID", id);
SaveLastLoginID( id );
//패스워드
ParseString(param, "pass", pass);
//OPT
Parseint(param, "ncopt", ncopt);
//로그인 요청 API
RequestLogin( ID, pass, ncopt );
if (!IsShowWindow("LogIn")) //<-----------
AutologinWnd.AutoSaveLogin(ID, pass);//<-----------
delString = "";
for ( i = 0 ; i < Len(param ) ; i ++ )
{
delString = delString $ "*";
}
param = delString;
....................... more code..
And in the xdat I make the next interface:






and in the "GFX" log7:

PROGRAM USE: xdat editor, LUSE, JPEXS FLASH DEMCOPILER and L2TOOL package gfx.
ERRORS:
Not appear the window.. if someone know the problem or want try, i can help to try it