using RichCreator.Utility.CV; using RichCreator.Utility.Structs; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Emgu.CV; using Emgu.CV.Structure; using System.Threading; using RichCreator.Utility.Captures; using ZTImage.Configuration; using RichCreator.Utility.Utilitys; using System.Diagnostics; using ZTImage.Collections; namespace RichCreator.Utility.CV { /// /// DNF识别 /// public class DnfCVHelper { /// /// 选择角色界面中的“开始游戏”按钮 /// private static ColorArray startGameButton = ColorArray.FromThresholdString(130, "1055,813,255,255,255$1034,813,0,0,0$1035,813,0,0,0$1036,813,0,0,0$1037,813,0,0,0$1038,813,0,0,0$1040,813,255,255,255$1041,813,255,255,255$1044,813,0,0,0$1045,813,0,0,0$1047,813,255,255,255$1048,813,255,255,255$1049,813,255,255,255$1051,813,0,0,0$1052,813,0,0,0$1053,813,255,255,255$1054,813,255,255,255$1057,813,0,0,0$1058,813,0,0,0$1059,813,0,0,0$1062,813,255,255,255$1063,813,255,255,255$1064,813,255,255,255$1065,813,255,255,255$1066,813,255,255,255$1067,813,255,255,255$1068,813,255,255,255$1072,813,255,255,255$1073,813,255,255,255$1074,813,255,255,255$1075,813,0,0,0$1076,813,0,0,0$1078,813,255,255,255$1082,813,255,255,255$1083,813,255,255,255$1084,813,255,255,255$1085,813,255,255,255$1086,813,255,255,255$1087,813,255,255,255$1088,813,255,255,255$1089,813,255,255,255$1090,813,255,255,255$1091,813,255,255,255$1092,813,255,255,255$1093,813,255,255,255$1094,813,255,255,255$1095,813,255,255,255$1096,813,255,255,255$1097,813,255,255,255$1098,813,255,255,255$1099,813,255,255,255$1102,813,0,0,0$1104,813,255,255,255$1105,813,255,255,255$1109,813,255,255,255$1110,813,255,255,255$1112,813,0,0,0$1113,813,0,0,0$1115,813,255,255,255$1116,813,255,255,255$1117,813,255,255,255$1119,813,0,0,0$1120,813,0,0,0$1121,813,0,0,0$1122,813,0,0,0$1123,813,0,0,0$1124,813,0,0,0$1125,813,0,0,0$1126,813,0,0,0$1127,813,0,0,0$1128,813,0,0,0$1034,814,0,0,0$1035,814,0,0,0$1036,814,0,0,0$1037,814,0,0,0$1038,814,0,0,0$1040,814,255,255,255$1041,814,255,255,255$1047,814,255,255,255$1048,814,255,255,255$1049,814,255,255,255$1053,814,255,255,255$1054,814,255,255,255$1055,814,255,255,255$1056,814,255,255,255$1057,814,255,255,255$1058,814,255,255,255$1061,814,255,255,255$1062,814,255,255,255$1063,814,255,255,255$1064,814,255,255,255$1065,814,255,255,255$1066,814,255,255,255$1067,814,255,255,255$1068,814,255,255,255$1070,814,0,0,0$1072,814,255,255,255$1073,814,255,255,255$1074,814,255,255,255$1077,814,255,255,255$1078,814,255,255,255$1082,814,255,255,255$1083,814,255,255,255$1084,814,255,255,255$1085,814,255,255,255$1086,814,255,255,255$1087,814,255,255,255$1088,814,255,255,255$1089,814,255,255,255$1090,814,255,255,255$1091,814,255,255,255$1092,814,255,255,255$1093,814,255,255,255$1094,814,255,255,255$1095,814,255,255,255$1096,814,255,255,255$1097,814,255,255,255$1098,814,255,255,255$1099,814,255,255,255$1100,814,255,255,255$1104,814,255,255,255$1105,814,255,255,255$1108,814,255,255,255$1109,814,255,255,255$1110,814,255,255,255$1112,814,0,0,0$1115,814,255,255,255$1116,814,255,255,255$1119,814,0,0,0$1120,814,0,0,0$1121,814,0,0,0$1122,814,0,0,0$1123,814,0,0,0$1124,814,0,0,0$1125,814,0,0,0$1126,814,0,0,0$1127,814,0,0,0$1128,814,0,0,0$1034,815,0,0,0$1035,815,0,0,0$1036,815,0,0,0$1037,815,0,0,0$1038,815,0,0,0$1041,815,255,255,255$1042,815,255,255,255$1045,815,255,255,255$1046,815,255,255,255$1047,815,255,255,255$1048,815,255,255,255$1049,815,255,255,255$1050,815,255,255,255$1051,815,255,255,255$1052,815,255,255,255$1053,815,255,255,255$1054,815,255,255,255$1055,815,255,255,255$1056,815,255,255,255$1057,815,255,255,255$1058,815,255,255,255$1062,815,255,255,255$1063,815,255,255,255$1064,815,255,255,255$1065,815,255,255,255$1066,815,255,255,255$1067,815,255,255,255$1068,815,255,255,255$1070,815,0,0,0$1071,815,0,0,0$1073,815,255,255,255$1074,815,255,255,255$1076,815,255,255,255$1077,815,255,255,255$1080,815,0,0,0$1083,815,255,255,255$1084,815,255,255,255$1085,815,255,255,255$1086,815,255,255,255$1096,815,255,255,255$1097,815,255,255,255$1098,815,255,255,255$1099,815,255,255,255$1104,815,255,255,255$1105,815,255,255,255$1106,815,255,255,255$1107,815,255,255,255$1108,815,255,255,255$1109,815,255,255,255$1110,815,255,255,255$1111,815,255,255,255$1114,815,255,255,255$1115,815,255,255,255$1116,815,255,255,255$1122,815,0,0,0$1123,815,0,0,0$1124,815,0,0,0$1125,815,0,0,0$1126,815,0,0,0$1127,815,0,0,0$1128,815,0,0,0$1034,816,0,0,0$1035,816,0,0,0$1036,816,0,0,0$1037,816,0,0,0$1038,816,0,0,0$1039,816,0,0,0$1041,816,255,255,255$1042,816,255,255,255$1043,816,255,255,255$1045,816,255,255,255$1046,816,255,255,255$1047,816,255,255,255$1048,816,255,255,255$1049,816,255,255,255$1050,816,255,255,255$1051,816,255,255,255$1052,816,255,255,255$1066,816,255,255,255$1067,816,255,255,255$1068,816,255,255,255$1072,816,255,255,255$1073,816,255,255,255$1074,816,255,255,255$1076,816,255,255,255$1077,816,255,255,255$1080,816,0,0,0$1081,816,0,0,0$1084,816,255,255,255$1085,816,255,255,255$1097,816,255,255,255$1098,816,255,255,255$1099,816,255,255,255$1101,816,0,0,0$1103,816,255,255,255$1104,816,255,255,255$1105,816,255,255,255$1106,816,255,255,255$1107,816,255,255,255$1108,816,255,255,255$1109,816,255,255,255$1110,816,255,255,255$1111,816,255,255,255$1114,816,255,255,255$1115,816,255,255,255$1117,816,0,0,0$1119,816,255,255,255$1120,816,255,255,255$1122,816,0,0,0$1123,816,0,0,0$1124,816,0,0,0$1125,816,0,0,0$1126,816,0,0,0$1127,816,0,0,0$1128,816,0,0,0$1034,817,0,0,0$1035,817,0,0,0$1036,817,0,0,0$1037,817,0,0,0$1038,817,0,0,0$1039,817,0,0,0$1040,817,0,0,0$1042,817,255,255,255$1046,817,255,255,255$1047,817,255,255,255$1054,817,0,0,0$1055,817,0,0,0$1056,817,0,0,0$1057,817,0,0,0$1058,817,0,0,0$1059,817,0,0,0$1060,817,0,0,0$1067,817,255,255,255$1068,817,255,255,255$1071,817,255,255,255$1072,817,255,255,255$1073,817,255,255,255$1074,817,255,255,255$1075,817,255,255,255$1076,817,255,255,255$1077,817,255,255,255$1078,817,255,255,255$1080,817,0,0,0$1081,817,0,0,0$1082,817,0,0,0$1084,817,255,255,255$1085,817,255,255,255$1087,817,0,0,0$1088,817,0,0,0$1089,817,0,0,0$1090,817,0,0,0$1091,817,0,0,0$1092,817,0,0,0$1093,817,0,0,0$1094,817,0,0,0$1095,817,0,0,0$1097,817,255,255,255$1098,817,255,255,255$1099,817,255,255,255$1100,817,0,0,0$1101,817,0,0,0$1104,817,255,255,255$1105,817,255,255,255$1106,817,255,255,255$1108,817,255,255,255$1109,817,255,255,255$1110,817,255,255,255$1113,817,255,255,255$1114,817,255,255,255$1115,817,255,255,255$1117,817,0,0,0$1119,817,255,255,255$1120,817,255,255,255$1122,817,0,0,0$1123,817,0,0,0$1124,817,0,0,0$1125,817,0,0,0$1126,817,0,0,0$1127,817,0,0,0$1128,817,0,0,0$1034,818,0,0,0$1035,818,0,0,0$1036,818,0,0,0$1037,818,0,0,0$1038,818,0,0,0$1039,818,0,0,0$1040,818,0,0,0$1041,818,0,0,0$1042,818,0,0,0$1043,818,0,0,0$1044,818,0,0,0$1046,818,255,255,255$1047,818,255,255,255$1049,818,0,0,0$1050,818,0,0,0$1051,818,0,0,0$1053,818,255,255,255$1054,818,255,255,255$1055,818,255,255,255$1056,818,255,255,255$1057,818,255,255,255$1058,818,255,255,255$1060,818,0,0,0$1062,818,255,255,255$1063,818,255,255,255$1066,818,255,255,255$1067,818,255,255,255$1069,818,0,0,0$1071,818,255,255,255$1072,818,255,255,255$1073,818,255,255,255$1074,818,255,255,255$1075,818,255,255,255$1076,818,255,255,255$1077,818,255,255,255$1078,818,255,255,255$1080,818,0,0,0$1081,818,0,0,0$1082,818,0,0,0$1084,818,255,255,255$1085,818,255,255,255$1087,818,0,0,0$1088,818,0,0,0$1089,818,0,0,0$1090,818,0,0,0$1091,818,0,0,0$1092,818,0,0,0$1093,818,0,0,0$1094,818,0,0,0$1095,818,0,0,0$1097,818,255,255,255$1098,818,255,255,255$1100,818,0,0,0$1101,818,0,0,0$1102,818,0,0,0$1104,818,255,255,255$1105,818,255,255,255$1107,818,0,0,0$1109,818,255,255,255$1110,818,255,255,255$1113,818,255,255,255$1114,818,255,255,255$1116,818,0,0,0$1117,818,0,0,0$1119,818,255,255,255$1120,818,255,255,255$1122,818,0,0,0$1123,818,0,0,0$1124,818,0,0,0$1125,818,0,0,0$1126,818,0,0,0$1127,818,0,0,0$1128,818,0,0,0$1034,819,0,0,0$1035,819,0,0,0$1036,819,0,0,0$1037,819,0,0,0$1038,819,0,0,0$1040,819,255,255,255$1041,819,255,255,255$1043,819,0,0,0$1044,819,0,0,0$1046,819,255,255,255$1047,819,255,255,255$1048,819,255,255,255$1049,819,255,255,255$1050,819,255,255,255$1052,819,255,255,255$1053,819,255,255,255$1054,819,255,255,255$1055,819,255,255,255$1056,819,255,255,255$1057,819,255,255,255$1058,819,255,255,255$1060,819,0,0,0$1062,819,255,255,255$1063,819,255,255,255$1066,819,255,255,255$1067,819,255,255,255$1069,819,0,0,0$1070,819,0,0,0$1071,819,0,0,0$1073,819,255,255,255$1074,819,255,255,255$1076,819,0,0,0$1077,819,0,0,0$1078,819,0,0,0$1079,819,0,0,0$1080,819,0,0,0$1081,819,0,0,0$1082,819,0,0,0$1084,819,255,255,255$1085,819,255,255,255$1087,819,0,0,0$1088,819,0,0,0$1089,819,0,0,0$1090,819,0,0,0$1091,819,0,0,0$1092,819,0,0,0$1093,819,0,0,0$1094,819,0,0,0$1095,819,0,0,0$1097,819,255,255,255$1098,819,255,255,255$1100,819,0,0,0$1101,819,0,0,0$1102,819,0,0,0$1104,819,255,255,255$1105,819,255,255,255$1107,819,0,0,0$1109,819,255,255,255$1110,819,255,255,255$1112,819,255,255,255$1113,819,255,255,255$1114,819,255,255,255$1119,819,255,255,255$1120,819,255,255,255$1122,819,0,0,0$1123,819,0,0,0$1124,819,0,0,0$1125,819,0,0,0$1126,819,0,0,0$1127,819,0,0,0$1128,819,0,0,0$1034,820,0,0,0$1035,820,0,0,0$1036,820,0,0,0$1037,820,0,0,0$1038,820,0,0,0$1039,820,0,0,0$1040,820,255,255,255$1041,820,255,255,255$1046,820,255,255,255$1047,820,255,255,255$1048,820,255,255,255$1049,820,255,255,255$1050,820,255,255,255$1052,820,0,0,0$1053,820,0,0,0$1054,820,0,0,0$1056,820,255,255,255$1057,820,255,255,255$1060,820,0,0,0$1063,820,255,255,255$1064,820,255,255,255$1065,820,255,255,255$1066,820,255,255,255$1069,820,0,0,0$1070,820,0,0,0$1071,820,0,0,0$1073,820,255,255,255$1074,820,255,255,255$1076,820,0,0,0$1080,820,0,0,0$1081,820,0,0,0$1082,820,0,0,0$1084,820,255,255,255$1085,820,255,255,255$1087,820,0,0,0$1088,820,0,0,0$1089,820,0,0,0$1090,820,0,0,0$1091,820,0,0,0$1092,820,0,0,0$1093,820,0,0,0$1094,820,0,0,0$1095,820,0,0,0$1097,820,255,255,255$1098,820,255,255,255$1100,820,0,0,0$1101,820,0,0,0$1102,820,0,0,0$1104,820,255,255,255$1105,820,255,255,255$1107,820,0,0,0$1109,820,255,255,255$1110,820,255,255,255$1112,820,255,255,255$1113,820,255,255,255$1114,820,255,255,255$1115,820,255,255,255$1116,820,255,255,255$1117,820,255,255,255$1118,820,255,255,255$1119,820,255,255,255$1120,820,255,255,255$1122,820,0,0,0$1123,820,0,0,0$1124,820,0,0,0$1125,820,0,0,0$1126,820,0,0,0$1127,820,0,0,0$1128,820,0,0,0$1034,821,0,0,0$1035,821,0,0,0$1036,821,0,0,0$1037,821,0,0,0$1038,821,0,0,0$1039,821,0,0,0$1041,821,255,255,255$1042,821,255,255,255$1046,821,255,255,255$1047,821,255,255,255$1050,821,255,255,255$1052,821,0,0,0$1056,821,255,255,255$1057,821,255,255,255$1059,821,0,0,0$1060,821,0,0,0$1061,821,0,0,0$1063,821,255,255,255$1064,821,255,255,255$1065,821,255,255,255$1066,821,255,255,255$1068,821,0,0,0$1069,821,0,0,0$1070,821,0,0,0$1071,821,0,0,0$1074,821,255,255,255$1077,821,255,255,255$1080,821,0,0,0$1081,821,0,0,0$1083,821,255,255,255$1084,821,255,255,255$1085,821,255,255,255$1086,821,255,255,255$1096,821,255,255,255$1097,821,255,255,255$1098,821,255,255,255$1099,821,255,255,255$1101,821,0,0,0$1102,821,0,0,0$1104,821,255,255,255$1105,821,255,255,255$1107,821,0,0,0$1109,821,255,255,255$1110,821,255,255,255$1112,821,255,255,255$1113,821,255,255,255$1114,821,255,255,255$1115,821,255,255,255$1116,821,255,255,255$1117,821,255,255,255$1118,821,255,255,255$1119,821,255,255,255$1122,821,0,0,0$1123,821,0,0,0$1124,821,0,0,0$1125,821,0,0,0$1126,821,0,0,0$1127,821,0,0,0$1128,821,0,0,0$1034,822,0,0,0$1035,822,0,0,0$1036,822,0,0,0$1037,822,0,0,0$1038,822,0,0,0$1039,822,0,0,0$1040,822,0,0,0$1046,822,255,255,255$1050,822,255,255,255$1052,822,0,0,0$1054,822,255,255,255$1055,822,255,255,255$1056,822,255,255,255$1057,822,255,255,255$1058,822,0,0,0$1059,822,0,0,0$1060,822,0,0,0$1061,822,0,0,0$1063,822,255,255,255$1064,822,255,255,255$1065,822,255,255,255$1066,822,255,255,255$1068,822,0,0,0$1069,822,0,0,0$1070,822,0,0,0$1071,822,0,0,0$1074,822,255,255,255$1075,822,255,255,255$1077,822,255,255,255$1080,822,0,0,0$1081,822,0,0,0$1082,822,255,255,255$1083,822,255,255,255$1084,822,255,255,255$1085,822,255,255,255$1086,822,255,255,255$1087,822,255,255,255$1088,822,255,255,255$1089,822,255,255,255$1090,822,255,255,255$1091,822,255,255,255$1092,822,255,255,255$1093,822,255,255,255$1094,822,255,255,255$1095,822,255,255,255$1096,822,255,255,255$1097,822,255,255,255$1098,822,255,255,255$1099,822,255,255,255$1100,822,255,255,255$1102,822,0,0,0$1104,822,255,255,255$1105,822,255,255,255$1107,822,0,0,0$1109,822,255,255,255$1110,822,255,255,255$1122,822,0,0,0$1123,822,0,0,0$1124,822,0,0,0$1125,822,0,0,0$1126,822,0,0,0$1127,822,0,0,0$1128,822,0,0,0$1034,823,0,0,0$1035,823,0,0,0$1036,823,0,0,0$1037,823,0,0,0$1038,823,0,0,0$1039,823,0,0,0$1040,823,0,0,0$1046,823,255,255,255$1050,823,255,255,255$1052,823,0,0,0$1056,823,255,255,255$1057,823,255,255,255$1058,823,0,0,0$1059,823,0,0,0$1060,823,0,0,0$1061,823,0,0,0$1062,823,0,0,0$1064,823,255,255,255$1065,823,255,255,255$1068,823,0,0,0$1069,823,0,0,0$1070,823,0,0,0$1071,823,0,0,0$1072,823,0,0,0$1074,823,255,255,255$1075,823,255,255,255$1077,823,255,255,255$1079,823,0,0,0$1080,823,0,0,0$1081,823,0,0,0$1083,823,255,255,255$1084,823,255,255,255$1085,823,255,255,255$1086,823,255,255,255$1096,823,255,255,255$1097,823,255,255,255$1098,823,255,255,255$1099,823,255,255,255$1101,823,0,0,0$1102,823,0,0,0$1104,823,255,255,255$1105,823,255,255,255$1107,823,0,0,0$1109,823,255,255,255$1122,823,0,0,0$1123,823,0,0,0$1124,823,0,0,0$1125,823,0,0,0$1126,823,0,0,0$1127,823,0,0,0$1128,823,0,0,0$1034,824,0,0,0$1035,824,0,0,0$1036,824,0,0,0$1037,824,0,0,0$1038,824,0,0,0$1039,824,0,0,0$1040,824,0,0,0$1041,824,0,0,0$1046,824,255,255,255$1050,824,255,255,255$1052,824,0,0,0$1053,824,0,0,0$1054,824,0,0,0$1056,824,255,255,255$1057,824,255,255,255$1058,824,0,0,0$1059,824,0,0,0$1060,824,0,0,0$1061,824,0,0,0$1062,824,0,0,0$1064,824,255,255,255$1065,824,255,255,255$1067,824,0,0,0$1068,824,0,0,0$1069,824,0,0,0$1070,824,0,0,0$1071,824,0,0,0$1072,824,0,0,0$1074,824,255,255,255$1075,824,255,255,255$1077,824,255,255,255$1079,824,0,0,0$1080,824,0,0,0$1081,824,0,0,0$1082,824,0,0,0$1084,824,255,255,255$1085,824,255,255,255$1087,824,0,0,0$1088,824,0,0,0$1089,824,0,0,0$1090,824,0,0,0$1091,824,0,0,0$1092,824,0,0,0$1093,824,0,0,0$1094,824,0,0,0$1095,824,0,0,0$1097,824,255,255,255$1098,824,255,255,255$1100,824,0,0,0$1101,824,0,0,0$1102,824,0,0,0$1104,824,255,255,255$1105,824,255,255,255$1107,824,0,0,0$1109,824,255,255,255$1113,824,255,255,255$1114,824,255,255,255$1115,824,255,255,255$1116,824,255,255,255$1117,824,255,255,255$1118,824,255,255,255$1119,824,255,255,255$1120,824,255,255,255$1122,824,0,0,0$1123,824,0,0,0$1124,824,0,0,0$1125,824,0,0,0$1126,824,0,0,0$1127,824,0,0,0$1128,824,0,0,0$1034,825,0,0,0$1035,825,0,0,0$1036,825,0,0,0$1037,825,0,0,0$1038,825,0,0,0$1039,825,0,0,0$1040,825,0,0,0$1046,825,255,255,255$1050,825,255,255,255$1056,825,255,255,255$1057,825,255,255,255$1059,825,0,0,0$1060,825,0,0,0$1061,825,0,0,0$1062,825,0,0,0$1064,825,255,255,255$1065,825,255,255,255$1067,825,0,0,0$1068,825,0,0,0$1069,825,0,0,0$1070,825,0,0,0$1071,825,0,0,0$1072,825,0,0,0$1074,825,255,255,255$1075,825,255,255,255$1076,825,255,255,255$1079,825,0,0,0$1080,825,0,0,0$1081,825,0,0,0$1082,825,0,0,0$1084,825,255,255,255$1085,825,255,255,255$1087,825,0,0,0$1088,825,0,0,0$1089,825,0,0,0$1090,825,0,0,0$1091,825,0,0,0$1092,825,0,0,0$1093,825,0,0,0$1094,825,0,0,0$1095,825,0,0,0$1097,825,255,255,255$1098,825,255,255,255$1100,825,0,0,0$1101,825,0,0,0$1102,825,0,0,0$1104,825,255,255,255$1105,825,255,255,255$1109,825,255,255,255$1111,825,0,0,0$1113,825,255,255,255$1114,825,255,255,255$1119,825,255,255,255$1120,825,255,255,255$1122,825,0,0,0$1123,825,0,0,0$1124,825,0,0,0$1125,825,0,0,0$1126,825,0,0,0$1127,825,0,0,0$1128,825,0,0,0$1034,826,0,0,0$1035,826,0,0,0$1036,826,0,0,0$1037,826,0,0,0$1038,826,0,0,0$1039,826,0,0,0$1040,826,0,0,0$1042,826,255,255,255$1046,826,255,255,255$1050,826,255,255,255$1055,826,255,255,255$1056,826,255,255,255$1057,826,255,255,255$1059,826,0,0,0$1060,826,0,0,0$1061,826,0,0,0$1062,826,0,0,0$1064,826,255,255,255$1065,826,255,255,255$1067,826,0,0,0$1068,826,0,0,0$1069,826,0,0,0$1074,826,255,255,255$1075,826,255,255,255$1076,826,255,255,255$1078,826,0,0,0$1079,826,0,0,0$1080,826,0,0,0$1081,826,0,0,0$1082,826,0,0,0$1087,826,0,0,0$1088,826,0,0,0$1089,826,0,0,0$1090,826,0,0,0$1091,826,0,0,0$1092,826,0,0,0$1093,826,0,0,0$1094,826,0,0,0$1095,826,0,0,0$1097,826,255,255,255$1098,826,255,255,255$1100,826,0,0,0$1101,826,0,0,0$1102,826,0,0,0$1103,826,0,0,0$1105,826,255,255,255$1106,826,255,255,255$1108,826,255,255,255$1111,826,0,0,0$1116,826,0,0,0$1117,826,0,0,0$1118,826,0,0,0$1120,826,255,255,255$1122,826,0,0,0$1123,826,0,0,0$1124,826,0,0,0$1125,826,0,0,0$1126,826,0,0,0$1127,826,0,0,0$1128,826,0,0,0$1034,827,0,0,0$1035,827,0,0,0$1036,827,0,0,0$1037,827,0,0,0$1038,827,0,0,0$1039,827,0,0,0$1040,827,0,0,0$1042,827,255,255,255$1044,827,0,0,0$1046,827,255,255,255$1056,827,255,255,255$1057,827,255,255,255$1059,827,0,0,0$1060,827,0,0,0$1061,827,0,0,0$1062,827,0,0,0$1064,827,255,255,255$1065,827,255,255,255$1068,827,0,0,0$1069,827,0,0,0$1073,827,255,255,255$1074,827,255,255,255$1075,827,255,255,255$1076,827,255,255,255$1078,827,0,0,0$1079,827,0,0,0$1080,827,0,0,0$1081,827,0,0,0$1082,827,0,0,0$1087,827,0,0,0$1088,827,0,0,0$1089,827,0,0,0$1090,827,0,0,0$1091,827,0,0,0$1092,827,0,0,0$1093,827,0,0,0$1094,827,0,0,0$1095,827,0,0,0$1097,827,255,255,255$1098,827,255,255,255$1100,827,0,0,0$1101,827,0,0,0$1102,827,0,0,0$1103,827,0,0,0$1106,827,255,255,255$1107,827,255,255,255$1108,827,255,255,255$1110,827,0,0,0$1111,827,0,0,0$1116,827,0,0,0$1117,827,0,0,0$1118,827,0,0,0$1120,827,255,255,255$1122,827,0,0,0$1123,827,0,0,0$1124,827,0,0,0$1125,827,0,0,0$1126,827,0,0,0$1127,827,0,0,0$1128,827,0,0,0$1034,828,0,0,0$1035,828,0,0,0$1036,828,0,0,0$1037,828,0,0,0$1038,828,0,0,0$1039,828,0,0,0$1040,828,0,0,0$1044,828,0,0,0$1052,828,0,0,0$1053,828,0,0,0$1056,828,255,255,255$1059,828,0,0,0$1060,828,0,0,0$1061,828,0,0,0$1062,828,0,0,0$1063,828,255,255,255$1064,828,255,255,255$1065,828,255,255,255$1066,828,255,255,255$1068,828,0,0,0$1069,828,0,0,0$1075,828,255,255,255$1077,828,0,0,0$1078,828,0,0,0$1079,828,0,0,0$1080,828,0,0,0$1081,828,0,0,0$1082,828,0,0,0$1087,828,0,0,0$1088,828,0,0,0$1089,828,0,0,0$1090,828,0,0,0$1091,828,0,0,0$1092,828,0,0,0$1093,828,0,0,0$1094,828,0,0,0$1095,828,0,0,0$1097,828,255,255,255$1100,828,0,0,0$1101,828,0,0,0$1102,828,0,0,0$1103,828,0,0,0$1104,828,0,0,0$1106,828,255,255,255$1107,828,255,255,255$1108,828,255,255,255$1110,828,0,0,0$1111,828,0,0,0$1116,828,0,0,0$1117,828,0,0,0$1118,828,0,0,0$1120,828,255,255,255$1122,828,0,0,0$1123,828,0,0,0$1124,828,0,0,0$1125,828,0,0,0$1126,828,0,0,0$1127,828,0,0,0$1128,828,0,0,0$1034,829,0,0,0$1035,829,0,0,0$1036,829,0,0,0$1037,829,0,0,0$1038,829,0,0,0$1039,829,0,0,0$1044,829,0,0,0$1052,829,0,0,0$1053,829,0,0,0$1054,829,0,0,0$1056,829,255,255,255$1058,829,0,0,0$1059,829,0,0,0$1060,829,0,0,0$1061,829,0,0,0$1063,829,255,255,255$1064,829,255,255,255$1065,829,255,255,255$1066,829,255,255,255$1068,829,0,0,0$1069,829,0,0,0$1070,829,0,0,0$1071,829,0,0,0$1072,829,0,0,0$1075,829,255,255,255$1077,829,0,0,0$1078,829,0,0,0$1079,829,0,0,0$1080,829,0,0,0$1081,829,0,0,0$1082,829,0,0,0$1087,829,0,0,0$1088,829,0,0,0$1089,829,0,0,0$1090,829,0,0,0$1091,829,0,0,0$1092,829,0,0,0$1093,829,0,0,0$1094,829,0,0,0$1095,829,0,0,0$1097,829,255,255,255$1100,829,0,0,0$1101,829,0,0,0$1102,829,0,0,0$1103,829,0,0,0$1104,829,0,0,0$1106,829,255,255,255$1107,829,255,255,255$1108,829,255,255,255$1111,829,0,0,0$1116,829,0,0,0$1117,829,0,0,0$1118,829,0,0,0$1120,829,255,255,255$1122,829,0,0,0$1123,829,0,0,0$1124,829,0,0,0$1125,829,0,0,0$1126,829,0,0,0$1127,829,0,0,0$1128,829,0,0,0$1034,830,0,0,0$1035,830,0,0,0$1036,830,0,0,0$1037,830,0,0,0$1038,830,0,0,0$1039,830,0,0,0$1041,830,255,255,255$1044,830,0,0,0$1046,830,255,255,255$1052,830,0,0,0$1056,830,255,255,255$1058,830,0,0,0$1059,830,0,0,0$1060,830,0,0,0$1063,830,255,255,255$1069,830,0,0,0$1070,830,0,0,0$1071,830,0,0,0$1072,830,0,0,0$1073,830,0,0,0$1075,830,255,255,255$1079,830,0,0,0$1080,830,0,0,0$1081,830,0,0,0$1084,830,255,255,255$1087,830,0,0,0$1088,830,0,0,0$1089,830,0,0,0$1090,830,0,0,0$1091,830,0,0,0$1092,830,0,0,0$1093,830,0,0,0$1094,830,0,0,0$1095,830,0,0,0$1097,830,255,255,255$1100,830,0,0,0$1101,830,0,0,0$1102,830,0,0,0$1105,830,255,255,255$1109,830,255,255,255$1120,830,255,255,255$1122,830,0,0,0$1123,830,0,0,0$1124,830,0,0,0$1125,830,0,0,0$1126,830,0,0,0$1127,830,0,0,0$1128,830,0,0,0$1034,831,0,0,0$1035,831,0,0,0$1036,831,0,0,0$1037,831,0,0,0$1038,831,0,0,0$1043,831,0,0,0$1052,831,0,0,0$1058,831,0,0,0$1059,831,0,0,0$1060,831,0,0,0$1070,831,0,0,0$1071,831,0,0,0$1072,831,0,0,0$1073,831,0,0,0$1080,831,0,0,0$1087,831,0,0,0$1088,831,0,0,0$1089,831,0,0,0$1090,831,0,0,0$1091,831,0,0,0$1092,831,0,0,0$1093,831,0,0,0$1094,831,0,0,0$1095,831,0,0,0$1100,831,0,0,0$1101,831,0,0,0$1102,831,0,0,0$1107,831,0,0,0$1122,831,0,0,0$1123,831,0,0,0$1124,831,0,0,0$1125,831,0,0,0$1126,831,0,0,0$1127,831,0,0,0$1128,831,0,0,0$1034,832,0,0,0$1035,832,0,0,0$1036,832,0,0,0$1037,832,0,0,0$1038,832,0,0,0$1039,832,0,0,0$1041,832,0,0,0$1042,832,0,0,0$1043,832,0,0,0$1044,832,0,0,0$1046,832,0,0,0$1047,832,0,0,0$1048,832,0,0,0$1050,832,0,0,0$1051,832,0,0,0$1052,832,0,0,0$1057,832,0,0,0$1058,832,0,0,0$1059,832,0,0,0$1060,832,0,0,0$1064,832,0,0,0$1065,832,0,0,0$1066,832,0,0,0$1069,832,0,0,0$1070,832,0,0,0$1071,832,0,0,0$1072,832,0,0,0$1073,832,0,0,0$1074,832,0,0,0$1075,832,0,0,0$1079,832,0,0,0$1080,832,0,0,0$1081,832,0,0,0$1085,832,0,0,0$1086,832,0,0,0$1087,832,0,0,0$1088,832,0,0,0$1089,832,0,0,0$1090,832,0,0,0$1091,832,0,0,0$1092,832,0,0,0$1093,832,0,0,0$1094,832,0,0,0$1095,832,0,0,0$1096,832,0,0,0$1097,832,0,0,0$1098,832,0,0,0$1099,832,0,0,0$1100,832,0,0,0$1101,832,0,0,0$1102,832,0,0,0$1106,832,0,0,0$1107,832,0,0,0$1108,832,0,0,0$1109,832,0,0,0$1120,832,0,0,0$1121,832,0,0,0$1122,832,0,0,0$1123,832,0,0,0$1124,832,0,0,0$1125,832,0,0,0$1126,832,0,0,0$1127,832,0,0,0$1128,832,0,0,0$1034,833,0,0,0$1035,833,0,0,0$1036,833,0,0,0$1037,833,0,0,0$1038,833,0,0,0$1039,833,0,0,0$1040,833,0,0,0$1041,833,0,0,0$1042,833,0,0,0$1043,833,0,0,0$1044,833,0,0,0$1045,833,0,0,0$1046,833,0,0,0$1047,833,0,0,0$1048,833,0,0,0$1049,833,0,0,0$1050,833,0,0,0$1051,833,0,0,0$1052,833,0,0,0$1053,833,0,0,0$1054,833,0,0,0$1055,833,0,0,0$1056,833,0,0,0$1057,833,0,0,0$1058,833,0,0,0$1059,833,0,0,0$1060,833,0,0,0$1061,833,0,0,0$1062,833,0,0,0$1063,833,0,0,0$1064,833,0,0,0$1065,833,0,0,0$1066,833,0,0,0$1067,833,0,0,0$1068,833,0,0,0$1069,833,0,0,0$1070,833,0,0,0$1071,833,0,0,0$1072,833,0,0,0$1073,833,0,0,0$1074,833,0,0,0$1075,833,0,0,0$1076,833,0,0,0$1077,833,0,0,0$1078,833,0,0,0$1079,833,0,0,0$1080,833,0,0,0$1081,833,0,0,0$1082,833,0,0,0$1083,833,0,0,0$1084,833,0,0,0$1085,833,0,0,0$1086,833,0,0,0$1087,833,0,0,0$1088,833,0,0,0$1089,833,0,0,0$1090,833,0,0,0$1091,833,0,0,0$1092,833,0,0,0$1093,833,0,0,0$1094,833,0,0,0$1095,833,0,0,0$1096,833,0,0,0$1097,833,0,0,0$1098,833,0,0,0$1099,833,0,0,0$1100,833,0,0,0$1101,833,0,0,0$1102,833,0,0,0$1103,833,0,0,0$1104,833,0,0,0$1105,833,0,0,0$1106,833,0,0,0$1107,833,0,0,0$1108,833,0,0,0$1109,833,0,0,0$1110,833,0,0,0$1111,833,0,0,0$1112,833,0,0,0$1113,833,0,0,0$1114,833,0,0,0$1115,833,0,0,0$1116,833,0,0,0$1117,833,0,0,0$1118,833,0,0,0$1119,833,0,0,0$1120,833,0,0,0$1121,833,0,0,0$1122,833,0,0,0$1123,833,0,0,0$1124,833,0,0,0$1125,833,0,0,0$1126,833,0,0,0$1127,833,0,0,0$1128,833,0,0,0"); /// /// 查找DNF窗口 /// /// /// /// /// /// /// public static bool IsSelectRoleWindow(out ZTRectangle startGameButtonRect) { startGameButtonRect = ZTRectangle.Empty; System.Drawing.Bitmap bitmap = ScreenCapture.Instance.CaptureScreen(); Image image = new Image(bitmap); ZTRectangle limit = new ZTRectangle(0, 0, image.Width, image.Height); //查找开始游戏按钮 if (CVHelper.FindColorArrayForThreshold(out startGameButtonRect, image, startGameButton, limit)) { return true; } return false; } /// /// 赛丽亚的房间邮件箱文字 /// private static ColorArray MailText = ColorArray.FromThresholdString(94, "1568,530,0,0,0$1543,530,255,255,255$1546,530,0,0,0$1549,530,0,0,0$1554,530,0,0,0$1555,530,0,0,0$1556,530,0,0,0$1557,530,0,0,0$1558,530,0,0,0$1559,530,0,0,0$1560,530,0,0,0$1564,530,255,255,255$1566,530,0,0,0$1567,530,0,0,0$1569,530,0,0,0$1570,530,0,0,0$1572,530,255,255,255$1573,530,0,0,0$1574,530,0,0,0$1576,530,0,0,0$1579,530,0,0,0$1581,530,255,255,255$1583,530,0,0,0$1584,530,0,0,0$1585,530,0,0,0$1586,530,0,0,0$1587,530,0,0,0$1588,530,255,255,255$1590,530,0,0,0$1591,530,0,0,0$1592,530,0,0,0$1593,530,0,0,0$1594,530,0,0,0$1595,530,0,0,0$1596,530,0,0,0$1598,530,255,255,255$1599,530,255,255,255$1600,530,255,255,255$1601,530,255,255,255$1602,530,255,255,255$1546,531,0,0,0$1549,531,0,0,0$1554,531,0,0,0$1556,531,255,255,255$1557,531,255,255,255$1558,531,255,255,255$1560,531,0,0,0$1561,531,0,0,0$1562,531,0,0,0$1564,531,255,255,255$1566,531,0,0,0$1569,531,0,0,0$1570,531,0,0,0$1572,531,255,255,255$1573,531,0,0,0$1574,531,0,0,0$1575,531,0,0,0$1576,531,0,0,0$1577,531,0,0,0$1578,531,0,0,0$1579,531,0,0,0$1581,531,255,255,255$1582,531,255,255,255$1583,531,255,255,255$1584,531,255,255,255$1585,531,255,255,255$1587,531,0,0,0$1588,531,255,255,255$1589,531,255,255,255$1590,531,255,255,255$1591,531,255,255,255$1592,531,255,255,255$1593,531,255,255,255$1594,531,255,255,255$1596,531,0,0,0$1598,531,255,255,255$1599,531,255,255,255$1600,531,255,255,255$1601,531,255,255,255$1602,531,255,255,255$1546,532,0,0,0$1549,532,0,0,0$1550,532,0,0,0$1553,532,0,0,0$1555,532,255,255,255$1556,532,255,255,255$1558,532,255,255,255$1560,532,0,0,0$1561,532,0,0,0$1567,532,255,255,255$1569,532,0,0,0$1570,532,0,0,0$1572,532,255,255,255$1573,532,0,0,0$1574,532,0,0,0$1575,532,0,0,0$1576,532,0,0,0$1577,532,0,0,0$1578,532,0,0,0$1583,532,255,255,255$1584,532,255,255,255$1591,532,255,255,255$1592,532,255,255,255$1596,532,0,0,0$1598,532,255,255,255$1599,532,255,255,255$1600,532,255,255,255$1601,532,255,255,255$1602,532,255,255,255$1541,533,0,0,0$1542,533,0,0,0$1543,533,0,0,0$1544,533,0,0,0$1545,533,0,0,0$1546,533,0,0,0$1548,533,255,255,255$1549,533,0,0,0$1550,533,0,0,0$1551,533,0,0,0$1552,533,0,0,0$1553,533,0,0,0$1555,533,255,255,255$1558,533,255,255,255$1560,533,0,0,0$1561,533,0,0,0$1563,533,255,255,255$1564,533,0,0,0$1565,533,0,0,0$1567,533,255,255,255$1569,533,0,0,0$1570,533,0,0,0$1572,533,255,255,255$1574,533,0,0,0$1575,533,0,0,0$1576,533,0,0,0$1577,533,0,0,0$1578,533,0,0,0$1579,533,255,255,255$1581,533,0,0,0$1582,533,0,0,0$1585,533,0,0,0$1588,533,0,0,0$1589,533,0,0,0$1590,533,0,0,0$1591,533,255,255,255$1593,533,0,0,0$1594,533,0,0,0$1595,533,0,0,0$1596,533,0,0,0$1598,533,255,255,255$1599,533,255,255,255$1600,533,255,255,255$1601,533,255,255,255$1602,533,255,255,255$1541,534,0,0,0$1544,534,255,255,255$1545,534,255,255,255$1546,534,255,255,255$1547,534,255,255,255$1548,534,255,255,255$1549,534,255,255,255$1550,534,255,255,255$1551,534,255,255,255$1552,534,255,255,255$1555,534,255,255,255$1558,534,255,255,255$1560,534,0,0,0$1561,534,0,0,0$1563,534,255,255,255$1564,534,0,0,0$1565,534,0,0,0$1567,534,255,255,255$1568,534,255,255,255$1569,534,255,255,255$1570,534,255,255,255$1571,534,255,255,255$1572,534,255,255,255$1573,534,255,255,255$1574,534,255,255,255$1575,534,255,255,255$1576,534,255,255,255$1578,534,0,0,0$1580,534,0,0,0$1581,534,0,0,0$1584,534,0,0,0$1585,534,0,0,0$1586,534,0,0,0$1587,534,0,0,0$1588,534,0,0,0$1589,534,0,0,0$1590,534,0,0,0$1591,534,0,0,0$1592,534,0,0,0$1593,534,0,0,0$1594,534,0,0,0$1595,534,0,0,0$1596,534,0,0,0$1598,534,255,255,255$1599,534,255,255,255$1600,534,255,255,255$1601,534,255,255,255$1602,534,255,255,255$1541,535,0,0,0$1543,535,255,255,255$1547,535,255,255,255$1548,535,255,255,255$1552,535,255,255,255$1555,535,255,255,255$1560,535,0,0,0$1562,535,255,255,255$1563,535,255,255,255$1564,535,0,0,0$1571,535,255,255,255$1572,535,255,255,255$1578,535,0,0,0$1579,535,0,0,0$1580,535,0,0,0$1581,535,0,0,0$1582,535,255,255,255$1584,535,0,0,0$1585,535,0,0,0$1596,535,0,0,0$1598,535,255,255,255$1599,535,255,255,255$1600,535,255,255,255$1601,535,255,255,255$1541,536,0,0,0$1543,536,255,255,255$1545,536,0,0,0$1546,536,0,0,0$1549,536,0,0,0$1550,536,0,0,0$1552,536,255,255,255$1555,536,255,255,255$1556,536,255,255,255$1557,536,255,255,255$1558,536,0,0,0$1559,536,0,0,0$1561,536,255,255,255$1562,536,255,255,255$1563,536,255,255,255$1564,536,0,0,0$1567,536,0,0,0$1568,536,0,0,0$1569,536,0,0,0$1570,536,0,0,0$1572,536,255,255,255$1573,536,0,0,0$1574,536,0,0,0$1575,536,0,0,0$1576,536,0,0,0$1577,536,0,0,0$1578,536,0,0,0$1579,536,0,0,0$1580,536,0,0,0$1582,536,255,255,255$1584,536,0,0,0$1585,536,0,0,0$1587,536,255,255,255$1588,536,255,255,255$1589,536,255,255,255$1590,536,255,255,255$1591,536,255,255,255$1592,536,255,255,255$1593,536,255,255,255$1594,536,255,255,255$1596,536,0,0,0$1598,536,255,255,255$1599,536,255,255,255$1600,536,255,255,255$1601,536,255,255,255$1541,537,0,0,0$1543,537,255,255,255$1545,537,0,0,0$1546,537,0,0,0$1549,537,0,0,0$1550,537,0,0,0$1552,537,255,255,255$1555,537,255,255,255$1556,537,255,255,255$1557,537,255,255,255$1558,537,0,0,0$1559,537,0,0,0$1560,537,0,0,0$1563,537,255,255,255$1564,537,0,0,0$1565,537,0,0,0$1566,537,0,0,0$1567,537,0,0,0$1568,537,0,0,0$1569,537,0,0,0$1570,537,0,0,0$1572,537,255,255,255$1573,537,0,0,0$1578,537,0,0,0$1580,537,255,255,255$1581,537,255,255,255$1582,537,255,255,255$1583,537,255,255,255$1584,537,255,255,255$1585,537,255,255,255$1586,537,255,255,255$1587,537,255,255,255$1594,537,255,255,255$1596,537,0,0,0$1598,537,255,255,255$1599,537,255,255,255$1600,537,255,255,255$1601,537,255,255,255$1541,538,0,0,0$1543,538,255,255,255$1547,538,255,255,255$1548,538,255,255,255$1552,538,255,255,255$1555,538,255,255,255$1556,538,255,255,255$1559,538,0,0,0$1560,538,0,0,0$1561,538,0,0,0$1563,538,255,255,255$1564,538,0,0,0$1565,538,0,0,0$1566,538,0,0,0$1567,538,0,0,0$1568,538,0,0,0$1569,538,0,0,0$1570,538,0,0,0$1572,538,255,255,255$1573,538,0,0,0$1578,538,0,0,0$1582,538,255,255,255$1583,538,255,255,255$1586,538,255,255,255$1587,538,255,255,255$1594,538,255,255,255$1596,538,0,0,0$1598,538,255,255,255$1599,538,255,255,255$1600,538,255,255,255$1601,538,255,255,255$1603,538,255,255,255$1541,539,0,0,0$1543,539,255,255,255$1544,539,255,255,255$1545,539,255,255,255$1546,539,255,255,255$1547,539,255,255,255$1548,539,255,255,255$1549,539,255,255,255$1550,539,255,255,255$1551,539,255,255,255$1552,539,255,255,255$1555,539,255,255,255$1558,539,255,255,255$1560,539,0,0,0$1561,539,0,0,0$1563,539,255,255,255$1564,539,0,0,0$1565,539,0,0,0$1566,539,0,0,0$1567,539,0,0,0$1568,539,0,0,0$1569,539,0,0,0$1570,539,0,0,0$1572,539,255,255,255$1573,539,0,0,0$1574,539,0,0,0$1575,539,0,0,0$1576,539,0,0,0$1577,539,0,0,0$1578,539,0,0,0$1579,539,0,0,0$1580,539,0,0,0$1582,539,255,255,255$1584,539,0,0,0$1585,539,0,0,0$1587,539,255,255,255$1588,539,255,255,255$1589,539,255,255,255$1590,539,255,255,255$1591,539,255,255,255$1592,539,255,255,255$1593,539,255,255,255$1594,539,255,255,255$1596,539,0,0,0$1598,539,255,255,255$1599,539,255,255,255$1600,539,255,255,255$1601,539,255,255,255$1603,539,255,255,255$1541,540,0,0,0$1543,540,255,255,255$1548,540,255,255,255$1552,540,255,255,255$1555,540,255,255,255$1558,540,255,255,255$1560,540,0,0,0$1561,540,0,0,0$1563,540,255,255,255$1564,540,0,0,0$1566,540,255,255,255$1567,540,255,255,255$1568,540,255,255,255$1569,540,255,255,255$1570,540,255,255,255$1571,540,255,255,255$1572,540,255,255,255$1573,540,255,255,255$1574,540,255,255,255$1575,540,255,255,255$1576,540,255,255,255$1578,540,0,0,0$1579,540,0,0,0$1581,540,255,255,255$1582,540,255,255,255$1583,540,255,255,255$1585,540,0,0,0$1587,540,255,255,255$1594,540,255,255,255$1596,540,0,0,0$1598,540,255,255,255$1599,540,255,255,255$1600,540,255,255,255$1601,540,255,255,255$1603,540,255,255,255$1541,541,0,0,0$1543,541,255,255,255$1545,541,0,0,0$1546,541,0,0,0$1549,541,0,0,0$1550,541,0,0,0$1552,541,255,255,255$1555,541,255,255,255$1558,541,255,255,255$1560,541,0,0,0$1561,541,0,0,0$1563,541,255,255,255$1564,541,0,0,0$1571,541,255,255,255$1572,541,255,255,255$1578,541,0,0,0$1582,541,255,255,255$1583,541,255,255,255$1587,541,255,255,255$1594,541,255,255,255$1596,541,0,0,0$1598,541,255,255,255$1599,541,255,255,255$1600,541,255,255,255$1601,541,255,255,255$1603,541,255,255,255$1543,542,255,255,255$1545,542,0,0,0$1546,542,0,0,0$1549,542,0,0,0$1550,542,0,0,0$1552,542,255,255,255$1555,542,255,255,255$1558,542,255,255,255$1560,542,0,0,0$1561,542,0,0,0$1563,542,255,255,255$1564,542,0,0,0$1565,542,0,0,0$1566,542,0,0,0$1567,542,0,0,0$1568,542,0,0,0$1569,542,0,0,0$1570,542,0,0,0$1572,542,255,255,255$1573,542,0,0,0$1574,542,0,0,0$1575,542,0,0,0$1576,542,0,0,0$1577,542,0,0,0$1578,542,0,0,0$1579,542,255,255,255$1581,542,0,0,0$1582,542,255,255,255$1584,542,0,0,0$1585,542,255,255,255$1586,542,255,255,255$1587,542,255,255,255$1588,542,255,255,255$1589,542,255,255,255$1590,542,255,255,255$1591,542,255,255,255$1592,542,255,255,255$1593,542,255,255,255$1594,542,255,255,255$1596,542,0,0,0$1598,542,255,255,255$1599,542,255,255,255$1600,542,255,255,255$1601,542,255,255,255$1543,543,255,255,255$1545,543,0,0,0$1546,543,0,0,0$1549,543,0,0,0$1550,543,0,0,0$1552,543,255,255,255$1555,543,255,255,255$1556,543,255,255,255$1559,543,0,0,0$1560,543,0,0,0$1561,543,0,0,0$1563,543,255,255,255$1564,543,0,0,0$1565,543,0,0,0$1570,543,0,0,0$1572,543,255,255,255$1573,543,0,0,0$1578,543,0,0,0$1580,543,0,0,0$1581,543,0,0,0$1582,543,255,255,255$1584,543,0,0,0$1587,543,255,255,255$1594,543,255,255,255$1596,543,0,0,0$1598,543,255,255,255$1599,543,255,255,255$1600,543,255,255,255$1601,543,255,255,255$1543,544,255,255,255$1547,544,255,255,255$1548,544,255,255,255$1552,544,255,255,255$1555,544,255,255,255$1556,544,255,255,255$1558,544,0,0,0$1559,544,0,0,0$1560,544,0,0,0$1561,544,0,0,0$1563,544,255,255,255$1564,544,0,0,0$1570,544,0,0,0$1572,544,255,255,255$1573,544,0,0,0$1575,544,255,255,255$1576,544,255,255,255$1580,544,0,0,0$1581,544,0,0,0$1582,544,255,255,255$1584,544,0,0,0$1585,544,0,0,0$1587,544,255,255,255$1594,544,255,255,255$1596,544,0,0,0$1597,544,255,255,255$1598,544,255,255,255$1599,544,255,255,255$1600,544,255,255,255$1601,544,255,255,255$1603,544,255,255,255$1539,545,255,255,255$1543,545,255,255,255$1544,545,255,255,255$1545,545,255,255,255$1546,545,255,255,255$1547,545,255,255,255$1548,545,255,255,255$1549,545,255,255,255$1550,545,255,255,255$1551,545,255,255,255$1552,545,255,255,255$1555,545,255,255,255$1557,545,0,0,0$1558,545,0,0,0$1559,545,0,0,0$1560,545,0,0,0$1561,545,0,0,0$1563,545,255,255,255$1564,545,0,0,0$1570,545,0,0,0$1572,545,255,255,255$1573,545,0,0,0$1575,545,255,255,255$1576,545,255,255,255$1577,545,255,255,255$1578,545,255,255,255$1579,545,255,255,255$1581,545,0,0,0$1582,545,255,255,255$1584,545,0,0,0$1585,545,0,0,0$1587,545,255,255,255$1588,545,255,255,255$1589,545,255,255,255$1590,545,255,255,255$1591,545,255,255,255$1592,545,255,255,255$1593,545,255,255,255$1594,545,255,255,255$1596,545,0,0,0$1597,545,255,255,255$1598,545,255,255,255$1599,545,255,255,255$1600,545,255,255,255$1601,545,255,255,255$1602,545,255,255,255$1603,545,255,255,255$1539,546,255,255,255$1540,546,255,255,255$1543,546,255,255,255$1552,546,255,255,255$1555,546,255,255,255$1557,546,0,0,0$1558,546,0,0,0$1559,546,0,0,0$1560,546,0,0,0$1561,546,0,0,0$1563,546,255,255,255$1564,546,0,0,0$1570,546,0,0,0$1572,546,255,255,255$1573,546,0,0,0$1575,546,255,255,255$1576,546,255,255,255$1577,546,255,255,255$1578,546,255,255,255$1581,546,0,0,0$1582,546,255,255,255$1584,546,0,0,0$1585,546,0,0,0$1587,546,255,255,255$1594,546,255,255,255$1596,546,0,0,0$1597,546,255,255,255$1598,546,255,255,255$1599,546,255,255,255$1600,546,255,255,255$1601,546,255,255,255$1602,546,255,255,255$1603,546,255,255,255$1539,547,255,255,255$1540,547,255,255,255$1542,547,0,0,0$1545,547,0,0,0$1546,547,0,0,0$1549,547,0,0,0$1550,547,0,0,0$1551,547,0,0,0$1554,547,0,0,0$1557,547,0,0,0$1558,547,0,0,0$1560,547,0,0,0$1561,547,0,0,0$1564,547,0,0,0$1570,547,0,0,0$1573,547,0,0,0$1575,547,255,255,255$1576,547,255,255,255$1577,547,255,255,255$1581,547,0,0,0$1584,547,0,0,0$1585,547,0,0,0$1588,547,0,0,0$1589,547,0,0,0$1590,547,0,0,0$1593,547,0,0,0$1596,547,0,0,0$1598,547,255,255,255$1599,547,255,255,255$1600,547,255,255,255$1601,547,255,255,255$1602,547,255,255,255$1603,547,255,255,255$1539,548,255,255,255$1540,548,255,255,255$1542,548,0,0,0$1543,548,0,0,0$1544,548,0,0,0$1545,548,0,0,0$1550,548,0,0,0$1551,548,0,0,0$1552,548,0,0,0$1553,548,0,0,0$1554,548,0,0,0$1555,548,0,0,0$1556,548,0,0,0$1557,548,0,0,0$1558,548,0,0,0$1561,548,0,0,0$1562,548,0,0,0$1563,548,0,0,0$1564,548,0,0,0$1570,548,0,0,0$1571,548,0,0,0$1572,548,0,0,0$1573,548,0,0,0$1575,548,255,255,255$1576,548,255,255,255$1577,548,255,255,255$1581,548,0,0,0$1582,548,0,0,0$1583,548,0,0,0$1584,548,0,0,0$1585,548,0,0,0$1586,548,0,0,0$1587,548,0,0,0$1588,548,0,0,0$1589,548,0,0,0$1591,548,255,255,255$1593,548,0,0,0$1594,548,0,0,0$1595,548,0,0,0$1596,548,0,0,0$1597,548,255,255,255$1598,548,255,255,255$1599,548,255,255,255$1600,548,255,255,255$1601,548,255,255,255$1602,548,255,255,255$1603,548,255,255,255$1539,549,255,255,255$1540,549,255,255,255$1541,549,255,255,255$1555,549,0,0,0$1556,549,0,0,0$1557,549,0,0,0$1558,549,0,0,0$1567,549,255,255,255$1568,549,255,255,255$1569,549,255,255,255$1575,549,255,255,255$1576,549,255,255,255$1591,549,255,255,255$1592,549,255,255,255$1597,549,255,255,255$1598,549,255,255,255$1599,549,255,255,255$1600,549,255,255,255$1601,549,255,255,255$1602,549,255,255,255$1603,549,255,255,255"); //艾尔文防线文字 private static ColorArray AierwenText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1199,47,230,200,155$1177,47,230,200,155$1180,47,230,200,155$1180,45,230,200,155$1184,45,230,200,155$1184,47,230,200,155$1187,47,230,200,155$1187,56,230,200,155$1177,56,230,200,155$1194,56,230,200,155$1194,49,230,200,155$1191,47,230,200,155$1191,45,230,200,155$1199,54,230,200,155$1201,56,230,200,155$1211,56,230,200,155$1206,53,230,200,155$1206,47,230,200,155$1201,47,230,200,155$1211,47,230,200,155$1205,45,230,200,155$1213,46,230,200,155$1213,56,230,200,155$1217,56,230,200,155$1221,56,230,200,155$1222,56,230,200,155$1223,55,230,200,155$1225,55,230,200,155$1231,55,230,200,155$1229,56,230,200,155$1235,56,230,200,155$1235,54,230,200,155$1235,50,230,200,155$1235,47,230,200,155$1235,46,230,200,155$1234,45,230,200,155$1232,45,230,200,155$1227,45,230,200,155$1219,45,230,200,155"); /// /// 是否在赛丽亚的房间 /// /// public static bool IsInSaiLiYaHouse(ZTRectangle gameRect) { ZTRectangle mailText = ZTRectangle.Empty; ZTPoint limitPoint = gameRect.GetRatioPoint(0.667f); ZTRectangle limit = new ZTRectangle(limitPoint.X, gameRect.Start.Y, gameRect.End.X, gameRect.End.Y); //截图 System.Drawing.Bitmap bitmap = ScreenCapture.Instance.CaptureScreen(); Image image = new Image(bitmap); //查找地图右上边的艾尔文防线文字 if (CVHelper.FindColorArray(out mailText, image, AierwenText, gameRect)) { return true; } ////查找邮件箱 //if (CVHelper.FindColorArrayForThreshold(out mailText, image, MailText,limit)) //{ // return true; //} return false; } /// /// 弹出窗关闭按钮 /// private static ColorArray AlterWindowCloseButton = ColorArray.FromThresholdString(107, "1153,291,255,255,255$1151,289,255,255,255$1152,289,255,255,255$1161,289,255,255,255$1162,289,255,255,255$1151,290,0,0,0$1152,290,255,255,255$1153,290,255,255,255$1160,290,255,255,255$1161,290,255,255,255$1152,291,0,0,0$1154,291,255,255,255$1159,291,255,255,255$1160,291,255,255,255$1161,291,0,0,0$1153,292,0,0,0$1154,292,255,255,255$1155,292,255,255,255$1158,292,255,255,255$1159,292,255,255,255$1160,292,0,0,0$1154,293,0,0,0$1155,293,255,255,255$1156,293,255,255,255$1157,293,255,255,255$1158,293,255,255,255$1159,293,0,0,0$1155,294,0,0,0$1156,294,255,255,255$1157,294,255,255,255$1158,294,0,0,0$1148,295,0,0,0$1149,295,0,0,0$1150,295,0,0,0$1151,295,0,0,0$1152,295,0,0,0$1153,295,0,0,0$1155,295,255,255,255$1156,295,255,255,255$1157,295,255,255,255$1158,295,255,255,255$1159,295,0,0,0$1160,295,0,0,0$1161,295,0,0,0$1162,295,0,0,0$1148,296,0,0,0$1149,296,0,0,0$1150,296,0,0,0$1151,296,0,0,0$1152,296,0,0,0$1154,296,255,255,255$1155,296,255,255,255$1156,296,0,0,0$1157,296,0,0,0$1158,296,255,255,255$1159,296,255,255,255$1161,296,0,0,0$1162,296,0,0,0$1148,297,0,0,0$1149,297,0,0,0$1150,297,0,0,0$1151,297,0,0,0$1153,297,255,255,255$1154,297,255,255,255$1155,297,0,0,0$1156,297,0,0,0$1157,297,0,0,0$1158,297,0,0,0$1159,297,255,255,255$1160,297,255,255,255$1162,297,0,0,0$1152,298,255,255,255$1153,298,255,255,255$1154,298,0,0,0$1159,298,0,0,0$1160,298,255,255,255$1161,298,255,255,255$1151,299,255,255,255$1152,299,255,255,255$1153,299,0,0,0$1160,299,0,0,0$1161,299,255,255,255$1162,299,255,255,255$1151,300,0,0,0$1152,300,0,0,0$1161,300,0,0,0$1162,300,0,0,0"); /// /// 弹出公告的关闭按钮,比弹出窗的关闭按钮小一点 /// private static ColorArray AlterNoticeWindowCloseButton = ColorArray.FromThresholdString(107, "1272,203,0,0,0$1263,203,0,0,0$1264,203,0,0,0$1265,203,0,0,0$1266,203,0,0,0$1267,203,0,0,0$1268,203,0,0,0$1269,203,0,0,0$1270,203,0,0,0$1271,203,0,0,0$1263,204,0,0,0$1264,204,0,0,0$1265,204,255,255,255$1266,204,255,255,255$1267,204,0,0,0$1268,204,0,0,0$1269,204,0,0,0$1270,204,0,0,0$1271,204,255,255,255$1272,204,255,255,255$1263,205,0,0,0$1264,205,0,0,0$1265,205,0,0,0$1266,205,255,255,255$1267,205,255,255,255$1268,205,0,0,0$1269,205,0,0,0$1270,205,255,255,255$1271,205,255,255,255$1272,205,0,0,0$1263,206,0,0,0$1264,206,0,0,0$1265,206,0,0,0$1266,206,0,0,0$1267,206,255,255,255$1268,206,255,255,255$1269,206,255,255,255$1270,206,255,255,255$1271,206,0,0,0$1272,206,0,0,0$1263,207,0,0,0$1264,207,0,0,0$1265,207,0,0,0$1266,207,0,0,0$1267,207,0,0,0$1268,207,255,255,255$1269,207,255,255,255$1270,207,0,0,0$1271,207,0,0,0$1272,207,0,0,0$1263,208,0,0,0$1264,208,0,0,0$1265,208,0,0,0$1266,208,0,0,0$1267,208,255,255,255$1268,208,255,255,255$1269,208,255,255,255$1270,208,255,255,255$1271,208,0,0,0$1272,208,0,0,0$1263,209,0,0,0$1264,209,0,0,0$1265,209,0,0,0$1266,209,255,255,255$1267,209,255,255,255$1268,209,0,0,0$1269,209,0,0,0$1270,209,255,255,255$1271,209,255,255,255$1272,209,0,0,0$1263,210,0,0,0$1264,210,0,0,0$1265,210,255,255,255$1266,210,255,255,255$1267,210,0,0,0$1268,210,0,0,0$1269,210,0,0,0$1270,210,0,0,0$1271,210,255,255,255$1272,210,255,255,255$1263,211,0,0,0$1264,211,0,0,0$1265,211,0,0,0$1266,211,0,0,0$1267,211,0,0,0$1268,211,0,0,0$1269,211,0,0,0$1270,211,0,0,0$1271,211,0,0,0$1272,211,0,0,0$1263,212,0,0,0$1264,212,0,0,0$1265,212,0,0,0$1266,212,0,0,0$1267,212,0,0,0$1268,212,0,0,0$1269,212,0,0,0$1270,212,0,0,0$1271,212,0,0,0$1272,212,0,0,0"); /// /// 查找弹出窗 /// /// /// /// public static bool GetAlertWindow(out ZTRectangle closeButtonRect, Image image, ZTRectangle gameRect) { closeButtonRect = ZTRectangle.Empty; if (!CVHelper.FindColorArrayForThreshold(out closeButtonRect, image, AlterWindowCloseButton, gameRect)) { if (!CVHelper.FindColorArrayForThreshold(out closeButtonRect, image, AlterNoticeWindowCloseButton, gameRect)) { return false; } } ZTLine upLine = ZTLine.Empty; ZTRectangle limit = new ZTRectangle(closeButtonRect.Start.X, closeButtonRect.Start.Y - 14, closeButtonRect.Start.X + 25, closeButtonRect.Start.Y); //找上线 if (!CVHelper.FindLine(out upLine, image, 10, limit, Orientation.Horizontal, new ZTColor(0, 0, 0))) { return false; } ZTLine rightLine = ZTLine.Empty; limit = new ZTRectangle(upLine.X + upLine.Length, upLine.Y, upLine.X + upLine.Length + 8, upLine.Y + 30); //找右线 if (!CVHelper.FindLine(out rightLine, image, 10, limit, Orientation.Vertical, new ZTColor(0, 0, 0))) { return false; } ZTLine downLine = ZTLine.Empty; limit = new ZTRectangle(upLine.X, rightLine.Y + rightLine.Length, rightLine.X, rightLine.Y + rightLine.Length + 14); //找下线 if (!CVHelper.FindLine(out downLine, image, 10, limit, Orientation.Horizontal, new ZTColor(0, 0, 0))) { return false; } return true; } private static ZTHsvFloatColor minPilaozhi = new ZTHsvFloatColor(0.566f, 0.998f, 0.943f); private static ZTHsvFloatColor maxPilaozhi = new ZTHsvFloatColor(0.570f, 1.0f, 0.947f); private static ZTHsvFloatColor minPilaozhi_last = new ZTHsvFloatColor(0.963f, 0.998f, 0.700f); private static ZTHsvFloatColor maxPilaozhi_last = new ZTHsvFloatColor(0.967f, 1.0f, 0.704f); /// /// 得到疲劳值 /// /// public static Int32 GetPiLaoZhi(ZTRectangle gameRect) { //疲劳值范围 ZTRectangle findLimitRect = new ZTRectangle(gameRect.Start.X + 550, gameRect.End.Y - 55, gameRect.Start.X + 750, gameRect.End.Y - 35); //截图 System.Drawing.Bitmap bitmap = ScreenCapture.Instance.CaptureScreen(); Image image = new Image(bitmap); ZTLine line = ZTLine.Empty; bool findResult = CVHelper.FindLine(out line, image, 0, findLimitRect, Orientation.Horizontal, minPilaozhi, maxPilaozhi); if (findResult) { return line.Length; } findResult = CVHelper.FindLine(out line, image, 0, findLimitRect, Orientation.Horizontal, minPilaozhi_last, maxPilaozhi_last); if (findResult) { return line.Length; } return 0; } private static ZTHsvFloatColor rightMiniMapMin = new ZTHsvFloatColor(0.100, 0.312, 0.547); private static ZTHsvFloatColor rightMiniMapMax = new ZTHsvFloatColor(0.104, 0.316, 0.551); private static ZTHsvFloatColor bottomMiniMapMin = new ZTHsvFloatColor(0.109, 0.309, 0.414); private static ZTHsvFloatColor bottomMiniMapMax = new ZTHsvFloatColor(0.113, 0.313, 0.418); /// /// 查找小地图区域 /// /// /// public static bool FindMiniMap(out ZTRectangle minimapRect, Image image, ZTRectangle gameRect) { Int32 rightBorderLen = 104;//右边框最小长度 Int32 bottomBorderLen = 70;//下边框最小长度 ZTLine right = ZTLine.Empty; ZTLine bottom = ZTLine.Empty; ZTRectangle limit = new ZTRectangle(gameRect.Start.X + 640, gameRect.Start.Y, gameRect.End.X, gameRect.Start.Y + 360); if (CVHelper.FindLine(out bottom, image, bottomBorderLen, limit, Orientation.Horizontal, bottomMiniMapMin, bottomMiniMapMax)) { if (CVHelper.FindLine(out right, image, rightBorderLen, limit, Orientation.Vertical, rightMiniMapMin, rightMiniMapMax)) { //匹配成功 minimapRect = new ZTRectangle(bottom.X, right.Y, right.X, bottom.Y); return true; } } minimapRect = ZTRectangle.Empty; return false; } /// /// 所有房间刷完之后奖励文字 /// public static ColorArray Jiangli = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "649,65,255,255,255$672,66,255,255,255$600,62,255,255,255$608,67,255,255,255$630,67,255,255,255$669,94,255,255,255$645,90,255,255,255$620,92,255,255,255$654,79,255,255,255"); public static bool IsJiangli(Image image, ZTRectangle gameRect) { ZTRectangle limit = new ZTRectangle(gameRect.Start.X + 575, gameRect.Start.Y + 35, gameRect.Start.X + 700, gameRect.Start.Y + 110); ZTRectangle position = ZTRectangle.Empty; return CVHelper.FindColorArray(out position, image, Jiangli, limit); } /// /// 凛冬所有房间刷完之后的那个加号 /// public static ColorArray LindongPlus = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1149,178,213,156,48$1148,174,255,201,99$1149,174,255,211,127$1148,178,217,159,50$1144,178,255,201,95$1144,177,255,201,99$1152,177,214,169,83$1152,178,191,139,37$1149,181,192,153,74$1148,181,189,137,36$1147,181,109,8,6$1147,174,115,9,5"); public static bool IsCompleteRoom(Image image, ZTRectangle gameRect) { ZTRectangle limit = new ZTRectangle(gameRect.End.X - 185, gameRect.Start.Y + 150, gameRect.End.X - 85, gameRect.Start.Y + 205); ZTRectangle position = ZTRectangle.Empty; return CVHelper.FindColorArray(out position, image, LindongPlus, limit); } /// /// 加百利关闭按钮 /// public static ColorArray shopCloseButton = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "521,541,255,255,204$532,541,255,255,204$531,541,255,255,204$531,542,255,255,187$530,542,255,255,187$530,543,255,255,187$529,543,255,255,187$529,544,255,238,187$528,544,255,238,187$527,546,238,221,170$526,546,238,221,170$522,541,255,255,204$522,542,255,255,187$523,542,255,255,187$523,543,255,255,187$524,543,255,255,187$521,551,204,187,119$522,551,204,187,119$522,550,221,187,136$523,550,221,187,136$523,549,221,204,136$524,549,221,204,136$532,551,204,187,119$531,551,204,187,119$531,550,221,187,136$530,550,221,187,136$530,549,221,204,136$529,549,221,204,136"); /// /// 出售按钮 /// public static ColorArray shopSaleButton = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "204,516,221,197,147$184,508,221,197,147$184,511,221,197,147$188,511,221,197,147$188,507,221,197,147$192,508,221,197,147$192,511,221,197,147$193,514,221,197,147$193,518,221,197,147$188,517,221,197,147$183,517,221,197,147$183,514,221,197,147$196,516,221,197,147$204,518,221,197,147$196,518,221,197,147$196,514,221,197,147$198,508,221,197,147$201,508,221,197,147$201,507,221,197,147$205,508,221,197,147$204,512,221,197,147$205,514,221,197,147"); public static bool HasSaleButton(out ZTRectangle saleButtonPosition, out ZTRectangle closeButtonPosition, ZTRectangle gameRect) { Image image = ScreenCapture.Instance.CaptureScreenReturnImage(); saleButtonPosition = ZTRectangle.Empty; closeButtonPosition = ZTRectangle.Empty; if (CVHelper.FindColorArray(out closeButtonPosition, image, shopCloseButton, gameRect)) { if (CVHelper.FindColorArray(out saleButtonPosition, image, shopSaleButton, gameRect)) { return true; } } return false; } /// /// 加百利对话框的出售按钮 /// public static bool HasJiabailiSaleButton(out ZTRectangle buttonPosition, Image image, ZTRectangle gameRect) { return CVHelper.FindColorArray(out buttonPosition, image, shopSaleButton, gameRect); } /// /// 魔王的契约黄金牌 /// public static ColorArray glodMowangdeqiyueText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "373,624,254,252,88$355,612,246,238,83$363,612,243,238,83$369,624,250,242,85$377,624,250,242,84$371,612,242,236,83$378,612,242,237,83$430,619,253,251,88"); /// /// 是否有魔王契约卡牌 /// /// /// /// public static bool HasMowangqiyueCard(ZTRectangle gameRect) { using (Image image = ScreenCapture.Instance.CaptureScreenReturnImage()) { ZTRectangle o = ZTRectangle.Empty; return CVHelper.FindColorArray(out o, image, glodMowangdeqiyueText, new ZTRectangle(gameRect.Start.X, gameRect.Start.Y + (gameRect.End.Y - gameRect.Start.Y) / 2, gameRect.End.X, gameRect.End.Y)); } } /// /// 系统菜单面板 /// public static ColorArray SystemPanelTitle = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "876,195,221,221,153$485,558,207,173,82$518,558,207,173,82$586,558,207,173,82$632,558,207,173,82$716,558,139,119,54$789,558,139,119,54$867,558,139,119,54$832,211,136,119,68$746,211,136,119,68$636,211,221,187,102$568,211,221,187,102$492,211,221,187,102$871,195,221,221,153$889,195,221,221,153$879,204,153,119,68$870,204,153,119,68"); public static bool IsOpenSystemPanel(ZTRectangle gameRect) { Image image = ScreenCapture.Instance.CaptureScreenReturnImage(); ZTRectangle position = ZTRectangle.Empty; return CVHelper.FindColorArray(out position, image, SystemPanelTitle, gameRect); } public static ColorArray ExitPanelOkButtonText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "647,448,221,197,147$637,443,221,197,147$640,443,221,197,147$640,447,221,197,147$638,447,221,197,147$638,451,221,197,147$640,451,221,197,147$642,450,221,197,147$642,452,221,197,147$644,452,221,197,147$647,452,221,197,147$647,450,221,197,147$644,450,221,197,147$644,448,221,197,147$647,446,221,197,147$642,446,221,197,147$643,443,221,197,147$646,443,221,197,147$651,443,221,197,147$651,446,221,197,147$651,452,221,197,147$653,453,221,197,147$659,453,221,197,147$656,442,221,197,147"); /// /// 查找退出时的确认按钮 /// /// /// /// public static bool FindExitPanelOkButton(out ZTRectangle okButtonRect, ZTRectangle gameRect) { okButtonRect = ZTRectangle.Empty; Image image = ScreenCapture.Instance.CaptureScreenReturnImage(); return CVHelper.FindColorArray(out okButtonRect, image, ExitPanelOkButtonText, gameRect); } /// /// 个人面板右下角的金币文字 /// public static ColorArray GoldText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "957,616,230,200,155$957,609,230,200,155$967,609,230,200,155$962,605,230,200,155$962,609,230,200,155$962,612,230,200,155$966,612,230,200,155$958,612,230,200,155$967,616,230,200,155$970,615,230,200,155$974,616,230,200,155$977,615,230,200,155$978,615,230,200,155$978,609,230,200,155$974,609,230,200,155$974,606,230,200,155$969,606,230,200,155$979,605,230,200,155"); public static bool GetGoldTextPosition(out ZTRectangle goldTextRect, ZTRectangle gameRect) { Image image = ScreenCapture.Instance.CaptureScreenReturnImage(); return CVHelper.FindColorArray(out goldTextRect, image, GoldText, gameRect); } /// /// 已选中的武器文字 /// public static ColorArray SelectedEquipmentText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "711,333,255,255,184$722,336,255,255,184$722,334,255,255,184$722,332,255,255,184$722,329,255,255,184$722,327,255,255,184$721,327,255,255,184$720,327,255,255,184$719,327,255,255,184$708,327,255,255,184$708,331,255,255,184$708,333,255,255,184$712,333,255,255,184$713,333,255,255,184$715,333,255,255,184$715,337,255,255,184$714,337,255,255,184$709,337,255,255,184$708,337,255,255,184$708,336,255,255,184$708,335,255,255,184$707,335,255,255,184$710,328,255,255,184$712,328,255,255,184$714,328,255,255,184$712,327,255,255,184$712,330,255,255,184$712,331,255,255,184$713,331,255,255,184$711,331,255,255,184"); /// /// 未选中的武器文字 /// public static ColorArray UnSelectedEquipmentText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "710,331,221,197,147$708,326,221,197,147$708,328,221,197,147$708,331,221,197,147$710,328,221,197,147$712,328,221,197,147$715,328,221,197,147$712,326,221,197,147$712,331,221,197,147$714,331,221,197,147$710,332,221,197,147$710,333,221,197,147$712,333,221,197,147$715,333,221,197,147$705,333,221,197,147$709,334,221,197,147$709,337,221,197,147$708,337,221,197,147$714,337,221,197,147$715,337,221,197,147$719,336,221,197,147$722,336,221,197,147$725,336,221,197,147$725,334,221,197,147$722,334,221,197,147$719,334,221,197,147$719,332,221,197,147$722,332,221,197,147$725,332,221,197,147$725,330,221,197,147$724,330,221,197,147$723,329,221,197,147$721,329,221,197,147$722,329,221,197,147$725,327,221,197,147$723,327,221,197,147$721,327,221,197,147$720,327,221,197,147"); /// /// 获取装备的选择状态 /// /// /// 0:未选中,1:已选中 /// /// true:获取成功,false:获取失败 public static bool GetEquipmentSelectStatus(out ZTRectangle rect, out Int32 selectStatus, ZTRectangle gameRect) { selectStatus = 0; Image image = ScreenCapture.Instance.CaptureScreenReturnImage(); //已选中 if (CVHelper.FindColorArray(out rect, image, SelectedEquipmentText, gameRect)) { selectStatus = 1; return true; } //未选中 if (CVHelper.FindColorArray(out rect, image, UnSelectedEquipmentText, gameRect)) { selectStatus = 0; return true; } return false; } //min:(0,0.,0.0352941192686558),max:(0.,0.,0.0980392172932625) private static ZTHsvFloatColor equipmentColorMin = new ZTHsvFloatColor(0,0, 0); private static ZTHsvFloatColor equipmentColorMax = new ZTHsvFloatColor(1, 0.7827f, 0.1099f); private static ZTPoint[] equipmentComparePositionss; /// /// 获取有装备的所有点,只便利前两行 /// /// /// public static List GetEquipmentIndexs(ZTPoint startPoint) { Image image = ScreenCapture.Instance.CaptureScreenReturnImage(); return GetEquipmentIndexs(image, startPoint); } public static List GetEquipmentIndexs(Image image,ZTPoint startPoint) { if (equipmentComparePositionss == null) { equipmentComparePositionss = new ZTPoint[15 * 15]; for (int y = 0; y < 15; y++) { for (int x = 0; x < 15; x++) { equipmentComparePositionss[y * 15 + x] = new ZTPoint(x, y); } } } List points = new List(); byte[,,] datas = image.Data; //每格步进30 for (int i = 0; i < 16; i++) { int row = i / 8; int col = i % 8; int x = col * 30 + 7; int y = row * 30 + 7; if (!CVHelper.InRange(datas, startPoint.X + x, startPoint.Y + y, equipmentColorMin, equipmentColorMax, equipmentComparePositionss)) { points.Add(i); } } return points; } //灰 //private static Hsv minRoleHsv = new Hsv(0, 0, 178); //private static Hsv maxRoleHsv = new Hsv(180, 0, 229); //蓝 private static Hsv minRoleHsv = new Hsv(118, 250, 250); private static Hsv maxRoleHsv = new Hsv(122, 255, 255); //private static ZTSize roleBlockSize = new ZTSize(60, 22); private static ZTSize roleBlockSize = new ZTSize(40, 20); private static ZTSize rolePositionOffset = new ZTSize(60, 145);//查找到角色色块后,角色的水平和垂直偏移 /// /// 查找主角 /// /// /// public static ZTPoint FindRole(Image image, ZTRectangle gameRect) { List rects = CVHelper.FindBlocks(image, minRoleHsv, maxRoleHsv, roleBlockSize); if (rects.Count <= 0) { return ZTPoint.Empty; } //主角位置 ZTPoint rolePosition = gameRect.Start + new ZTPoint(rects[0].Start.X + rolePositionOffset.Width, rects[0].Start.Y + rolePositionOffset.Height); return rolePosition; } private const Int32 radisXMaxRange = 8;//x容差范围 private const Int32 radisYMaxRange = 45;//y容差范围 private const Int32 xLineMin = 46;//横向最小宽度 private const Int32 yLineMin = 26;//纵向最小高度 private const Int32 thingItemYOffset = 50;//查找的横线与物体垂直偏移 //other remove:min:(0.0166666675359011,0.0584795325994492,0.564705908298492),max:(0.115740731358528,0.543589770793915,0.764705896377563) //min:(0.0454545430839062,0.148148149251938,0.454901963472366),max:(0.146666660904884,0.53804349899292,0.952941179275513) //边框颜色 static ZTHsvFloatColor min = new ZTHsvFloatColor(0.0166f, 0.0584f, 0.5647f); static ZTHsvFloatColor max = new ZTHsvFloatColor(0.1467f, 0.5436f, 0.9530f); //other remove:min:(0,0.111111111938953,0.0666666701436043),max:(0.958333313465118,0.65625,0.129411771893501) //min:(0,0,0.0392156876623631),max:(0.833333313465118,1,0.219607844948769) //内部颜色 static ZTHsvFloatColor innerMin = new ZTHsvFloatColor(0, 0f, 0.0392f); static ZTHsvFloatColor innerMax = new ZTHsvFloatColor(1, 1f, 0.2197f); /// /// 获取物品项点位 /// /// /// /// public static List GetThingItemPoints(Image image, ZTRectangle gameRect) { List lines = CVHelper.FindLines(image, xLineMin,gameRect, Orientation.Horizontal, min, max); List filterLines = new List(); List points = new List(); Func existsLines = (line) => { for (int i = 0; i < filterLines.Count; i++) { //离得太近 if (Math.Abs(filterLines[i].Y - line.Y) <= 3) { //横坐标是否重合 if ((line.X + line.Length) < filterLines[i].X || line.X > (filterLines[i].X + filterLines[i].Length)) { //未重合 continue; } return true; } } return false; }; ZTRectangle limit = ZTRectangle.Empty; ZTLine vline = ZTLine.Empty; //bool isLeft = true; for (int i = 0; i < lines.Count; i++) { ZTLine line = lines[i]; //是否存在距离比较近的线 if (existsLines(line)) { continue; } //查找左边 //isLeft = true; limit = new ZTRectangle(line.X - radisXMaxRange, line.Y, line.X, line.Y + radisYMaxRange); if (!CVHelper.FindLine(out vline, image, yLineMin, limit, RichCreator.Utility.Structs.Orientation.Vertical, min, max)) { limit = new ZTRectangle(line.X + line.Length, line.Y, line.X + line.Length + radisXMaxRange, line.Y + radisYMaxRange); if (!CVHelper.FindLine(out vline, image, yLineMin, limit, Orientation.Vertical, min, max)) { continue; } //isLeft = false; } //内部是否黑色 if (!CVHelper.InRange(image.Data, line.X + 3, line.Y + 3, innerMin, innerMax)) { continue; } filterLines.Add(line); points.Add(new ZTPoint(line.X + line.Length / 2, line.Y + thingItemYOffset)); } return points; } private static readonly Hsv LocationPointMinHsv = new Hsv(0, 0, 0); private static readonly Hsv LocationPointMaxHsv = new Hsv(0, 0, 5); private static readonly ZTSize LocationPointMinLimitSize = new ZTSize(33, 33); private static readonly ZTSize LocationPointMaxLimitSize = new ZTSize(55, 55); /// /// 获取定位点 /// public static bool GetLocationPoint(out MultiList list,Image imageHsv,ZTRectangle gameRect) { list = new MultiList(); Image rangeImage = imageHsv.InRange(LocationPointMinHsv, LocationPointMaxHsv); //rangeImage.Save("gray.png"); //查找边框 Emgu.CV.Util.VectorOfVectorOfPoint contours = new Emgu.CV.Util.VectorOfVectorOfPoint(); Image hierarchy = new Image(rangeImage.Size); CvInvoke.FindContours(rangeImage, contours, hierarchy, Emgu.CV.CvEnum.RetrType.External, Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple); for (int i = 0; i < contours.Size; i++) { System.Drawing.Rectangle rect = CvInvoke.BoundingRectangle(contours[i]); if (rect.Width < LocationPointMinLimitSize.Width ||//比下限小 rect.Height < LocationPointMinLimitSize.Height|| rect.Width>LocationPointMaxLimitSize.Width||//比上限大 rect.Height>LocationPointMaxLimitSize.Height) { continue; } ZTRectangle locationPointRect = new ZTRectangle(rect.X, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1); Int32 number = 0; if (ParseLocationPoint(out number, locationPointRect, rangeImage)) { list.Add(locationPointRect,number); } } if (list.Count > 0) { return true; } return false; } //0xff:黑,0x00:白 private const byte black = 0xff; private const byte white = 0x00; /// /// 解析定位点 /// /// /// /// /// private static bool ParseLocationPoint(out Int32 number, ZTRectangle locationPointRect ,Image rangeImage) { number = 0; byte[,,] datas = rangeImage.Data; bool one = false, two = false, four = false, eight = false; ZTPoint center = locationPointRect.GetCenterPoint(); //格1 ZTPoint lefttop = center.Add(-11); if (!BlockOf6x6IsColor(datas, lefttop, black)) { if (!BlockOf6x6IsColor(datas, lefttop, white)) { return false; } else { one = false; } } else { one = true; } //格2 ZTPoint righttop = center.Add(new ZTPoint(5,-11)); if (!BlockOf6x6IsColor(datas, righttop, black)) { if (!BlockOf6x6IsColor(datas, righttop, white)) { return false; } else { two = false; } } else { two = true; } //格4 ZTPoint leftbottom = center.Add(new ZTPoint(-11, 5)); if (!BlockOf6x6IsColor(datas, leftbottom, black)) { if (!BlockOf6x6IsColor(datas, leftbottom, white)) { return false; } } else { four = true; } //格8 ZTPoint rightbottom = center.Add(5); if (!BlockOf6x6IsColor(datas, rightbottom, black)) { if (!BlockOf6x6IsColor(datas, rightbottom, white)) { return false; } } else { eight = true; } number += (one ? 1 : 0); number += (two ? 2 : 0); number += (four ? 4 : 0); number += (eight ? 8 : 0); return true; } /// /// 是否整个6*6的方块是某种颜色 /// /// /// /// /// /// private static bool BlockOf6x6IsColor(byte[,,] datas,ZTPoint start, byte color) { for (int y = start.Y; y < start.Y + 6; y++) { for (int x = start.X; x < start.X + 6; x++) { if (datas[y, x, 0] != color) { return false; } } } return true; } } }