From beb28c4351f3ef622c45f3603df0ba9c5e162793 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Jun 2024 22:01:40 -0400 Subject: Add login.lua module with login() function. The nullary login() call (login with saved credentials) has been tested, but the binary login(username, password) call is known not to work yet. --- indra/newview/scripts/lua/login.lua | 19 +++++++++++++++++++ indra/newview/scripts/lua/test_login.lua | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 indra/newview/scripts/lua/login.lua create mode 100644 indra/newview/scripts/lua/test_login.lua (limited to 'indra/newview') diff --git a/indra/newview/scripts/lua/login.lua b/indra/newview/scripts/lua/login.lua new file mode 100644 index 0000000000..0d8591cace --- /dev/null +++ b/indra/newview/scripts/lua/login.lua @@ -0,0 +1,19 @@ +local UI = require 'UI' +local leap = require 'leap' + +local function login(username, password) + if username and password then + local userpath = '//username_combo/Combo Text Entry' + local passpath = '//password_edit' + -- first clear anything presently in those text fields + for _, path in pairs({userpath, passpath}) do + UI.click(path) + UI.keypress{keysym='Backsp', path=path} + end + UI.type{path=userpath, text=username} + UI.type{path=passpath, text=password} + end + leap.send('LLPanelLogin', {op='onClickConnect'}) +end + +return login diff --git a/indra/newview/scripts/lua/test_login.lua b/indra/newview/scripts/lua/test_login.lua new file mode 100644 index 0000000000..6df52b08c2 --- /dev/null +++ b/indra/newview/scripts/lua/test_login.lua @@ -0,0 +1,7 @@ +startup = require 'startup' +login = require 'login' + +startup.wait('STATE_LOGIN_WAIT') +login() +-- WIP: not working as of 2024-06-11 +-- login('My Username', 'password') -- cgit v1.2.3