This is almost out of the box macro, you just need to have some pictures saved through navigation.
***
Modified (09/24/2013) *** Thanks to
stairbuilder for his advice.
I have modified this macro so user can give input at the first when macro started; macro will store those input globally and then this macro will run on those choices. It will work for any pin numbers and characters.
AutoLogin
Code:
begin
Macro.Execute new("Aika", "UserInput", "yes")
Macro.Execute new("Aika", "LogIn", "yes")
end
UserInput
Code:
begin
// User Name
begin loop()
Window.Request user text input("What is your User Name?", "userName")
if Variable.Is empty("userName")
begin
Function.Execute setting 1 variable("checkEmpty", "userInput", "User Name")
end
if Variable.Is not empty("userName")
begin
Variable.Set global("globalUserName", "{userName}")
Macro.Break from loop("no")
end
end
// Password
begin loop()
Window.Request user text input("What is your Password?", "passWord")
if Variable.Is empty("passWord")
begin
Function.Execute setting 1 variable("checkEmpty", "userInput", "Password")
end
if Variable.Is not empty("passWord")
begin
Variable.Set global("globalPassWord", "{passWord}")
Macro.Break from loop("no")
end
end
// Channel (By Default PvP)
Window.Request user single choice input("Which Channel would you like to join?", "PvP;PvE", "channel")
Variable.Set global("globalChannel", "{channel}")
// Which Character (By Default Left Slot)
Window.Request user multiple buttons choice("Which character slot would you like to play?", "Left;Middle;Right", "charToPlay")
Variable.Set global("globalCharToPlay", "{charToPlay}")
// Pin Number
begin loop()
Window.Request user text input("What is your Pin Number?", "pinNumber")
if Variable.Is empty("pinNumber")
or
Variable.Is non numeric("pinNumber")
or
Variable.Is not between (Math)("pinNumber", "1000", "9999")
begin
Window.Display message box("Pin Number can not be empty and It has to be 4 digits Numeric.", "yes")
end
if Macro.Previous criteria was not met()
begin
Variable.Set global("globalPinNumber", "{pinNumber}")
Macro.Break from loop("no")
end
end
//
// End of first Begin
end
function("checkEmpty")
begin
// Text Example
Variable.Evaluate (Text) ("{userInput} can not be empty, Please re-enter.","input")
Window.Display message box("{input}", "yes")
end
function
LogIn
Code:
begin
// Bring Aika Client to the front
Window.Bring to front("AikaClient", "No")
// Check if user is loged out
if Image.Can be located on screen near coordinate("C:\BlueEyeMacro\Login\login.jpg", "99", "960", "635", "100")
// If sometimes user can't log in (server problem, lag), it repeats the same process again and again to login
begin loop()
// This is just to be on a safe side, this will click the cancel button if there is "Would you like to exit the game windows (if ESC button was pressed while on login in mode)" if not then it just click on a blank space.
Mouse.Click at coordinate("1026", "342", "left")
Macro.Pause("1000")
// Click on the right most side of the User Name text box
Mouse.Click at coordinate("1036", "672", "left")
// Delete everything that is already there (when some micro running, it does not know user is loged out so there will be some garbage text)
Keyboard.Hold keys("{<backspace>}")
Macro.Pause("1000")
Keyboard.Release keys("{<backspace>}")
// Get global user Name from UserInput Macro
Variable.Get global("globalUserName", "userName")
Keyboard.Press keys("{userName}")
Macro.Pause("2000")
// Click on the right most side of the Password text box
Mouse.Click at coordinate("1030", "704", "left")
Keyboard.Hold keys("{<backspace>}")
Macro.Pause("1000")
Keyboard.Release keys("{<backspace>}")
// Get global Password from UserInput Macro
Variable.Get global("globalPassWord", "passWord")
Keyboard.Press keys("{passWord}")
Macro.Pause("2000")
Keyboard.Press key("{<enter>}")
Macro.Pause("5000")
// Choose world
Mouse.Click at coordinate("955", "660", "left")
Macro.Pause("10000")
// Choose Channel
// You can choose here either pvp or pve channel to go
// Get global Channel from UserInput Macro
Variable.Get global("globalChannel", "channel")
if Variable.Is equal to("channel", "PvP")
begin
// Choose PvP Channel
Mouse.Double click at coordinate("935", "617", "left")
end
if Variable.Is equal to("channel", "PvE")
begin
// Choose PvE channel
Mouse.Double click at coordinate("935", "642", "left")
end
Macro.Pause("5000")
// You can choose here which char to choose, left middle or right
// Get global CharToPlay from UserInput Macro
Variable.Get global("globalCharToPlay", "charToPlay")
// this is for the left char
if Variable.Is equal to("charToPlay", "Left")
begin
Mouse.Double click at coordinate("620", "615", "left")
end
// this is for the middle char
if Variable.Is equal to("charToPlay", "Middle")
begin
Mouse.Double click at coordinate("994", "663", "left")
end
// this is for the all the way right char
if Variable.Is equal to("charToPlay", "Right")
begin
Mouse.Double click at coordinate("1367", "602", "left")
end
Macro.Pause("2000")
// Get global Pin Number from UserInput Macro
Variable.Get global("globalPinNumber", "pinNumber")
Variable.Set("count", "0")
//It extract each number from the pin number
while Variable.Is less than (Math)("count", "4")
begin
Variable.Get character at index("pinNumber", "{count}", "image")
Variable.Evaluate (Text) ("C:\BlueEyeMacro\Login\{image}.jpg","input")
Mouse.Click at image("{input}", "100", "left")
Macro.Pause("1000")
Variable.Increment (Math)("count")
end
// Wait for 1 minute
Macro.Pause("60000")
// You have to save this picture too to make sure you are already in the game
if Image.Can be located on screen near coordinate("C\BlueEyeMacro\loginsuccessful.jpg", "99", "1770", "113", "50")
begin
// This is the part where you write other micro or link other micro after successfull login. I usually port my char to save point and start grinding ;)
end
end
end
You need these .jpg files.
0.jpg, 1.jpg, ......, 9.jpg
Login.jpg
LoginSuccessful.jpg (It is a picture of World Map Opener(it is on the left side of the mini map)