update:优化脚本执行
This commit is contained in:
parent
21dd8033d1
commit
5209843e86
@ -22,5 +22,6 @@ public class JianRScriptV2Data {
|
||||
public static final String formationType = "formationType";
|
||||
public static final String dialog_go = "dialog_go";
|
||||
public static final String dialog_back = "dialog_back";
|
||||
public static final String dialog_assets = "dialog_assets";
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,9 @@ public class JianRTaskManager {
|
||||
case JianRScriptV2Data.ScriptModel.dialog_back:
|
||||
vector2D = getDialogCoords(device, gameDisplay, true);
|
||||
break;
|
||||
case JianRScriptV2Data.ScriptModel.dialog_assets:
|
||||
vector2D = getDialogAssetsCoords(device, gameDisplay);
|
||||
break;
|
||||
default:
|
||||
if (script.getActivity().startsWith(JianRScriptV2Data.ScriptModel.formationType)) {
|
||||
vector2D = getNextFormationCoords(device, gameDisplay, Integer.parseInt(script.getActivity().split("#")[1]));
|
||||
@ -233,6 +236,18 @@ public class JianRTaskManager {
|
||||
return v2d;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源对抗确定坐标
|
||||
*
|
||||
* @return 坐标
|
||||
*/
|
||||
private Vector2D getDialogAssetsCoords(AndroidDevice device, AndroidDevice.GameDisplay gameDisplay) {
|
||||
Vector2D v2d = new Vector2D();
|
||||
v2d.setX(gameDisplay.getWidth() * 0.5 + gameDisplay.getStart().getX());
|
||||
v2d.setY(gameDisplay.getHeight() * 0.5433 + gameDisplay.getStart().getY());
|
||||
return v2d;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
AndroidDevice device = new AndroidDevice();
|
||||
AndroidDevice.DeviceDisplay deviceDisplay = new AndroidDevice.DeviceDisplay();
|
||||
@ -274,7 +289,6 @@ public class JianRTaskManager {
|
||||
device.getDeviceId(),
|
||||
v2d.getX(),
|
||||
v2d.getY());
|
||||
System.out.println(exec);
|
||||
AppTools.exec(exec
|
||||
, null, false, false);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@
|
||||
' "script":[\n' +
|
||||
' {\n' +
|
||||
' "title":"",\n' +
|
||||
' "activity":"map|attack|formationType#{0-4}|dialog_go|dialog_back",\n' +
|
||||
' "activity":"map|attack|formationType#{0-4}|dialog_go|dialog_back|dialog_assets",\n' +
|
||||
' "nextWaitTime": 0,\n' +
|
||||
' "randomNextWaitTime": 0\n' +
|
||||
' }\n' +
|
||||
|
Loading…
Reference in New Issue
Block a user