MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / MaaTaskerPostAction

Function MaaTaskerPostAction

source/Common/MaaTasker.cpp:187–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187MaaTaskId
188 MaaTaskerPostAction(MaaTasker* tasker, const char* action_type, const char* action_param, const MaaRect* box, const char* reco_detail)
189{
190 LogFunc << VAR_VOIDP(tasker) << VAR(action_type) << VAR(action_param) << VAR(reco_detail);
191
192 if (!tasker) {
193 LogError << "handle is null";
194 return MaaInvalidId;
195 }
196
197 if (!action_type) {
198 LogError << "action_type is null";
199 return MaaInvalidId;
200 }
201
202 if (!action_param) {
203 LogError << "action_param is null";
204 return MaaInvalidId;
205 }
206
207 if (!box) {
208 LogError << "box is null";
209 return MaaInvalidId;
210 }
211
212 if (!reco_detail) {
213 LogError << "reco_detail is null";
214 return MaaInvalidId;
215 }
216
217 auto param_opt = json::parse(action_param);
218 if (!param_opt) {
219 LogError << "failed to parse" << VAR(action_param);
220 return MaaInvalidId;
221 }
222
223 cv::Rect cv_box { box->x, box->y, box->width, box->height };
224 return tasker->post_action(action_type, *param_opt, cv_box, reco_detail);
225}
226
227MaaStatus MaaTaskerStatus(const MaaTasker* tasker, MaaTaskId id)
228{

Callers 1

post_actionMethod · 0.85

Calls 1

post_actionMethod · 0.45

Tested by

no test coverage detected