Files
MaaAssistantArknights/tools/TestCaller/main.cpp
2022-03-04 23:51:08 +08:00

66 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include "AsstCaller.h"
#include <filesystem>
#include <iostream>
#include <stdio.h>
#include <string>
std::string get_cur_dir()
{
return std::filesystem::current_path().u8string();
}
int main(int argc, char** argv)
{
// 若使用 VS请先设置 TestCaller 属性-调试-工作目录为 $(TargetDir)
AsstLoadResource(get_cur_dir().c_str());
auto ptr = AsstCreate();
if (ptr == nullptr) {
return -1;
}
//auto ret = AsstCatchCustom(ptr, "127.0.0.1:5555");
auto ret = AsstConnect(ptr, "adb", "127.0.0.1:5555", nullptr);
if (!ret) {
std::cout << "connect failed" << std::endl;
if (ptr) {
AsstDestroy(ptr);
ptr = nullptr;
}
return -1;
}
char ch = 0;
while (ch != 'q') {
//AsstAppendRoguelike(ptr, 0);
//AsstAppendDebug(ptr);
AsstAppendStartUp(ptr);
//AsstAppendFight(ptr, "CE-5", 0, 0, 99999);
// AsstAppendVisit(ptr, true);
//{
// const int required[] = { 3, 4, 5, 6 };
// AsstStartRecruitCalc(ptr, required, sizeof(required) / sizeof(int), true);
// }
//{
// const char* order[] = { "Trade", "Dorm" };
// AsstAppendInfrast(ptr, 1, order, 2, "Money", 0.3);
//}
// AsstAppendProcessTask(ptr, "AwardBegin");
//{
// const int required[] = { 4 };
// const int confirm[] = { 3, 4 };
// AsstAppendRecruit(ptr, 3, required, sizeof(required) / sizeof(int), confirm, sizeof(confirm) / sizeof(int), true, true);
//}
AsstStart(ptr);
ch = static_cast<char>(getchar());
}
if (ptr) {
AsstDestroy(ptr);
ptr = nullptr;
}
return 0;
}