AutoJs basis

Auto.Js is a scripting language is based on the development of JS, and Node.JS almost.
Auto.Js phone is used to write the script, his choice is divided into four, namely,
ID selector,
Text selectors,
ClassName selector,
Asc selector,

First, following this code to open a mobile phone App. Then you can open the phone micro letter this software.
Because JS is performed down line by line, so if the error will not continue to perform below it,
if the phone does not have this software would have been stuck in here not to execute it.
launchApp ( "micro-channel");

Then open the micro-channel micro-channel can be seen that there are two buttons start to a landing a registered, then you can get to the login button allows AutoJs to click on the Login button.
This findOnc is to get the login button get to know the login button has been acquired to date
findOnc (1000) in this () plus 1000 ms to 1000 is to get the time not to get on to the next piece of code

var Login = text ( "login") .findOnc (); // findonc been this page to get Text text login button

This findOnec () is available at this page once this text for the Login control, if not the next piece of code.
var Login = text ( "Login") .findOnec ();

The find () is to get to the landing page so to control, and then get is an array of.
var Login = text ( "Login") .find ();

After here) use this method to get findOnce (to the text for the landing of this control can take this control to doing it, such as clicking.

Login.click ()

When you click this input will jump to the account page.
A page will have a lot more control to go to see how these controls will need to download a Auto.JS this APP to see the phone up.

Here you can also add a lot of determination, the following code. This page has not judge the Login button if there is no implementation to suggest that there is no button

IF (the Login = null!) {
Login.click ();
} the else {
Toast ( "page not logged button")
}

In order for the phone with a seating space can be added Sleep Code, as follows, let the script execution to go rest one second.

sleep(1000)

Sometimes a lot of this control is not difficult to select the ID, and this time you can choose to use this thing a parent element,
as follows, to obtain control of the parent element.

Login.parent();

AutoJs basic foundation and JS
is not to explain the difference, as long as JS basis of these very simple.

Guess you like

Origin blog.csdn.net/weixin_44486126/article/details/91359873