This is a very basic script to show how one might automate the login process. I'm sure there is a better way to write/design the script; this is just a quick/dirty version to show the various TLOs and datatype members/methods.
This example code logs in using "Amadeus@example.com" as the account name, and "MyPassword" for the password. It then selects the character "Amadeus" and uses the PIN code 123456.
(NOTE: I am generous with the "waits" (wait 5 = .5 seconds) throughout the script because I like to look as 'human' as possible.)
This example code logs in using "Amadeus@example.com" as the account name, and "MyPassword" for the password. It then selects the character "Amadeus" and uses the PIN code 123456.
(NOTE: I am generous with the "waits" (wait 5 = .5 seconds) throughout the script because I like to look as 'human' as possible.)
Code:
function main()
{
variable string Account
variable string Password
variable string Character
variable int Pin1
variable int Pin2
variable int Pin3
variable int Pin4
variable int Pin5
variable int Pin6
if (!${isxAion(exists)})
return
Account:Set["amadeus@example.com"]
Password:Set["MyPassword"]
Character:Set["Amadeus"]
Pin1:Set[1]
Pin2:Set[2]
Pin3:Set[3]
Pin4:Set[4]
Pin5:Set[5]
Pin6:Set[6]
echo "AutoLoginSample:: Initialized"
do
{
waitframe
}
while (!${isxAion.IsReady} || !${LoginWindow(exists)})
LoginWindow.Account:SetText[${Account}]
wait 10
LoginWindow.Password:SetText[${Password}]
wait 10
LoginWindow.OK:LeftClick
wait 5
do
{
waitframe
}
while (!${EULAWindow(exists)} && !${CharSelectWindow(exists)})
if (${EULAWindow(exists)})
{
wait 5
EULAWindow.Accept:LeftClick
wait 5
do
{
if ${QuestionWindow(exists)}
{
QuestionWindow.Button1:LeftClick
wait 5
}
waitframe
}
while (!${CharSelectWindow(exists)})
}
wait 5
if (!${CharSelectWindow.Character[${Character}](exists)})
{
echo "AutoLoginSample::Debug:: Character '${Character}' does not exist on this account."
return
}
CharSelectWindow.Character[${Character}]:LeftClick
wait 5
do
{
waitframe
}
while (!${CharSelectWindow.Start.IsEnabled})
CharSelectWindow.Start:LeftClick
wait 60 ${PINWindow(exists)}
if (${PINWindow(exists)})
{
wait 5
PINWindow.Number[${Pin1}]:LeftClick
wait 5
PINWindow.Number[${Pin2}]:LeftClick
wait 5
PINWindow.Number[${Pin3}]:LeftClick
wait 5
PINWindow.Number[${Pin4}]:LeftClick
wait 5
PINWindow.Number[${Pin5}]:LeftClick
wait 5
PINWindow.Number[${Pin6}]:LeftClick
wait 5
if (${PINWindow.OK.IsEnabled})
PINWindow.OK:LeftClick
wait 5
}
echo "AutoLoginSample:: Ended"
}