summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-06-11 22:01:40 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-06-11 22:01:40 -0400
commitbeb28c4351f3ef622c45f3603df0ba9c5e162793 (patch)
tree89e3951dcb66534c2a98e665d999d0379eaaf0d4 /indra/newview/scripts/lua
parent44182d0719c209aabe0d80aea291a9e3e45b1e59 (diff)
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.
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r--indra/newview/scripts/lua/login.lua19
-rw-r--r--indra/newview/scripts/lua/test_login.lua7
2 files changed, 26 insertions, 0 deletions
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')