- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog.java
More file actions
Latest commit
48 lines (36 loc) · 1.16 KB
/
Copy pathLog.java
File metadata and controls
48 lines (36 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
importjava.awt.Point;
importorg.parabot.environment.api.utils.Time;
importorg.parabot.environment.input.Mouse;
importorg.parabot.environment.scripts.framework.SleepCondition;
importorg.parabot.environment.scripts.framework.Strategy;
importorg.rev317.min.api.methods.SceneObjects;
publicclassLogimplementsStrategy {
publicbooleanactivate() {
if (isLoggedIn()) {
System.out.println("Log check passed...");
returnfalse;
}
System.out.println("Logging In....");
returntrue;
}
/***************************************************************************************************************************************/
publicvoidexecute() {
Pointlogin = newPoint(452,280);
Mouse.getInstance().click(login);
Time.sleep(newSleepCondition() {
@Override
publicbooleanisValid() {
returnisLoggedIn();
}
}, 2000);
}
/***************************************************************************************************************************************/
publicstaticbooleanisLoggedIn() {
try {
returnSceneObjects.getNearest().length > 0;
} catch(IllegalArgumentExceptione) {
// catch
}
returnfalse;
}
}