summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')