Get it on Google Play


Wm뮤 :: 셋째 -아유-

블로그 이미지
가끔 그림그리거나 3D모델링하거나
취미로 로봇만드는
퇴직한 전자과 게임프로그래머
2020.3.48f1 , 2022.3.6f1 주로 사용
모카쨩
@Ahzkwid

Recent Comment

Archive


2023. 3. 16. 01:47 끄적끄적/AI

 

2016-03-13 제조 추정

 

외형과 이름은 Kanon의 그것

 

 

알바할때 쓰려고 만든녀석이다

구분 키워드와 이미지는 수동으로 잘라서 넣어주어야만 했다

데이터를 수동으로 넣어야 하는 녀석이지만 그만큼 구조가 단순해서 여러가지 변형을 가할수 있었다

NPC마냥 혼잣말을 자꾸 중얼거리는녀석

화면인식, 키보드제어, 마우스제어를 탑재하고 홈페이지 데이터를 읽어서 분석후 처리한뒤 엑셀에 데이터를 입력해주는 녀석이였다

메인시스템 4천줄, 제어엔진 1천줄로 구조가 단순

 

기존에 데이터가 없는 녀석을 처리할땐 세미오토로

기존에 데이터가 있는건 풀오토로 처리함

 

현재는 윈폼 비호환 코드가 많아서 작동불가상태

 

 

대사집

speech = "우그으~ 아유등장~";
cmd = "중지";
cmd = "서포트";
cmd = "오토";

switch (ran.Next(0, 10))
{
    case 0:
        Outospeech = "우그으...붕어빵먹고 싶어";
        sleep(3000);
        Outospeech = "붕어빠아아아아앙!!!!!!";
        sleep(3000);
        Outospeech = "붕어빵사조 붕어빵!붕어빵!붕어빵!";
        sleep(3000);
        Outospeech = "붕어빠아아앙!!!! 빼애앵애애액!!!!!!";
        break;
    case 1:
        Outospeech = "나도 선량한 일반시민이야!";
        break;
    case 2:
        Outospeech = "역시 붕어빵은 방금구운게 제일이라니깐";
        break;
    case 3:
        Outospeech = "이렇게 만난것도 분명 운명이야!";
        break;
    case 4:
        Outospeech = "난 어릴적부터 유령이랑 도깨비한테 약한걸";
        break;
    case 5:
        Outospeech = "이거?";
        sleep(3000);
        Outospeech = "소중한 사람에게 받은거야";
        break;
    case 6:
        Outospeech = "돈 있으면 붕어빵 잔뜩 살 수 있잖아?";
        break;
    case 7:
        Outospeech = "그때 유이치가 위로해 주지않았다면";
        sleep(2000);
        Outospeech = "평생 웃을수 없었을지도 몰라";
        break;
    case 8:
        Outospeech = "이 머리띠도 유이치가 준거야";
        break;
    case 9:
        Outospeech = "내일은 맑았으면 좋겠네";
        break;
    case 10:
        Outospeech = "나 유이치군이나 키타가와군이랑 같은 나이인데...";
        break;
}


if (cmd.IndexOf("레포데모드") != -1)
{
    speech = "레포데모드 작동시작";
    mode = 2000;
}
if (cmd.IndexOf("레포데모드해제") != -1)
{
    speech = "레포데모드 작동해제";
    mode = 0;
}


if (cmd.IndexOf ("네이버모드")!=-1)
{
    speech = "네이버모드 작동시작";
    mode = 1000;
}
if (cmd.IndexOf("네이버모드해제") != -1)
{
    speech = "네이버모드 작동해제";
    mode = 0;
}


if ((cmd == "서포트") || (cmd == "support"))
{
    if (SupportStart)
    {
        speech = "이미 서포트모드 작동중이야";
    }
    else
    {
        speech = "우그으~ 도와줄게. 그만하려면 ESC눌러";
    }
    SupportStart = true;

    Start = false;
    mode = 3;

}
if (cmd == "오토")
{
    if (Start)
    {
        speech = "이미 스스로 하고 있어";
    }
    else
    {
        speech = "우그으~ 내가 알아서 할게. 그만하려면 ESC눌러";
    }
    SupportStart = false;
    Start = true;
    mode = 4;
}

if (cmd == "카테고리수정")
{
    if (mode == 0)
    {
        speech = "수정시작";
        mode = 1;
    }
    else
    {
        speech = "종료";

        mode = 0;
    }
}

if (cmd == "마감모드")
{
    if (mode == 0)
    {
        speech = "마감시작";
        mode = 2;
    }
    else
    {
        speech = "마감취소";

        mode = 0;
    }
}
if (((cmd == "중지") || (cmd == "초기화")) && (SupportStart || Start || (mode != 0)) && (mode != 2000))
{
    speech = "우그~ 그만할게";
    SupportStart = false;
    Start = false;
    mode = 0;
}
if (cmd == "종료")
{
    switch (ran.Next(0, 1))
    {
        case 0:
            speech = "그럼 또 만나자. 약속이야~";
            break;
        case 1:
            speech = "그럼 바이바이";
            break;
    }
    SupportStart = false;
    Start = false;
    sleep(3000);
    Application.Exit();
}
if (cmd == "분할모드")
{
    if (SliceMode)
    {
        speech = "이미 분할모드야";
    }
    else
    {
        speech = "화면을 상하로 분할해서할게";
        SliceMode = true;
    }
}
if ((cmd == "통합모드") || (cmd == "분할모드 종료"))
{
    if (!SliceMode)
    {
        speech = "분할모드는 꺼져있는상태야";
    }
    else
    {
        speech = "분할모드를 종료할게";
        SliceMode = false;
    }
}
if (Regex.Replace(cmd, @"[^가-힣]", "") == "배속")
{
    delay_per = (Convert.ToDouble(Regex.Replace(cmd, @"[^0-9]", "")));
    speech = "" + delay_per + "배 빠르게 할게";
    delay_per = 1 / Math.Max(0.0001, delay_per);
}
if (Regex.Replace(cmd, @"[^가-힣]", "") == "배지연")
{
    delay_per = (Convert.ToDouble(Regex.Replace(cmd, @"[^0-9]", "")));
    speech = "" + delay_per + "배 느리게 할게";
}
if (Regex.Replace(cmd, @"[^가-힣]", "") == "저속배속")
{
    low_delay_per = (Convert.ToDouble(Regex.Replace(cmd, @"[^0-9]", "")));
    speech = "느린걸" + low_delay_per + "배 빠르게 할게";
    low_delay_per = 1 / Math.Max(0.0001, low_delay_per);
}
if (Regex.Replace(cmd, @"[^가-힣]", "") == "저속배지연")
{
    low_delay_per = (Convert.ToDouble(Regex.Replace(cmd, @"[^0-9]", "")));
    speech = "느린걸" + low_delay_per + "배 느리게 할게";
}

string str_t = "";
StringReader str_reader = new StringReader(cmd);
while(true)
{

    str_t = str_reader.ReadLine();

    if(str_t == null)
    {
        break;
    }

    if ((str_t != null)&& (str_t != ""))
    {

        if (str_t.IndexOf("포함키워드:") != -1)
        {
            str_include_buffer[str_include_size] = str_convert_array(str_t.Substring("포함키워드:".Length, str_t.Length - "포함키워드:".Length), ";;");
            str_include_size++;
            str_include = new string[str_include_size][];
            for (int i = 0; i < str_include_size; i++)
            {
                str_include[i] = str_include_buffer[i];
            }
            speech = str_t;
        }
        if (str_t.IndexOf("제외키워드:") != -1)
        {
            str_incept_buffer[str_incept_size] = str_convert_array(str_t.Substring("제외키워드:".Length, str_t.Length - "제외키워드:".Length), ";;");
            str_incept_size++;
            str_incept = new string[str_incept_size][];
            for (int i = 0; i < str_incept_size; i++)
            {
                str_incept[i] = str_incept_buffer[i];
            }
            speech = str_t;
        }
    }
    else
    {

    }
}
if (cmd == "키워드초기화")
{
    str_include = null;
    str_incept = null;
    str_include_size = 0;
    str_incept_size = 0;
    speech = "키워드 초기화했어";
}
if (cmd == "명령어")
{
    speech = "서포트,오토,중지,종료,분할모드,통합모드,분할모드 종료,단축키";
    sleep(3000);
    speech = "현재속도,X배속,X배지연,저속X배지연,저속X배지연,카테고리수정";
    sleep(3000);
    speech = "초고속모드,일반속도모드,초저속모드,마감모드";
    sleep(3000);
    speech = "키워드초기화,포함키워드:,제외키워드:";
    sleep(3000);
    speech = "네이버모드,네이버모드해제";
}
if (cmd == "단축키")
{
    speech = "147왼쪽기준복사, 0258검색,369 오른쪽기준복사";
}
if (cmd == "현재속도")
{
    lock(speech)
    {

        if (delay_per == 1)
        {
            speech = "기본속도";
        }
        else if (delay_per < 1)
        {
            speech = "기본속도" + 1 / delay_per + "배속";
        }
        else
        {
            speech = "기본속도" + delay_per + "배지연";
        }


        if (low_delay_per == 1)
        {
            if (delay_per == 1)
            {
                speech += "이";
            }
            speech += "야";
        }
        else if (low_delay_per < 1)
        {
            speech += "이고 저속은" + 1 / low_delay_per + "배속이야";
        }
        else
        {
            speech += "이고 저속은" + low_delay_per + "배지연이야";
        }
    }
}
if (cmd == "초고속모드")
{
    speed_mode = 2;
    speech ="초고속모드 작동시작할게";
}
if (cmd == "초저속모드")
{
    speed_mode = -2;
    speech = "초저속모드 작동시작할게";
}
if ((cmd == "일반속도모드")|| (cmd == "일반모드"))
{
    speed_mode = 0;
    speech = "모드해제";
}
cmd = "";

if (Keyboard.CheckToggle(Keyboard.VK_CAPITAL))
{
    if((mode>0)&& (mode <1000))
        {
        if (Keyboard.Check(Keyboard.VK_RIGHT))
        {
            Keyboard.Wait(Keyboard.VK_RIGHT, false);
            Mouse.Wait(0, false);
            speech = "오른쪽~";
            //ImageSystem.ImageClick(right, rect[rect_y]);
            ImageSystem.ImageClickHS(right, new Rectangle(rect[rect_y].X, Mouse.y, rect[rect_y].Width, rect[rect_y].Height - (Mouse.y - rect[rect_y].Y)));

        }
        if (Keyboard.Check(Keyboard.VK_LEFT))
        {
            Keyboard.Wait(Keyboard.VK_LEFT, false);
            Mouse.Wait(0, false);
            speech = "왼쪽~";
            //ImageSystem.ImageClick(left, rect[rect_y]);
            ImageSystem.ImageClickHS(left, new Rectangle(rect[rect_y].X, Mouse.y, rect[rect_y].Width, rect[rect_y].Height - (Mouse.y - rect[rect_y].Y)));

        }
    }

    switch (mode)
    {
        case 1000:
            if (Keyboard.Check(Keyboard.VK_NUMPAD1))
            {
                speech = "검색";
                Keyboard.Wait(Keyboard.VK_NUMPAD1, false);
                Mouse.Wait(0, false);
                naver_outo();
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD2))
            {
                speech = "상품상태";
                Keyboard.Wait(Keyboard.VK_NUMPAD2, false);
                Mouse.Wait(0, false);
                naver_outo_V2();
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD3))
            {
                speech = "서비스 여부";
                Keyboard.Wait(Keyboard.VK_NUMPAD3, false);
                Mouse.Wait(0, false);
                naver_outo_V3();
            }
            break;
        case 2:
            if (Keyboard.Check(Keyboard.VK_NUMPAD1))
            {
                speech = "왼쪽엑셀카피";
                Keyboard.Wait(Keyboard.VK_NUMPAD1, false);
                Mouse.Wait(0, false);
                OutoCopySimpleVa1();
            }
            break;
        default:
            if (Keyboard.Check(Keyboard.VK_DIVIDE))
            {
                Keyboard.Wait(Keyboard.VK_DIVIDE, false);
                Mouse.Wait(0, false);
                speech = "선택한 옵션 매칭할게~";
                ImageSystem.ImageClickHS(selectedOptionMaching, rect[rect_y]);
                ImageSystem.ImageClickHS(TpinSelectMatching, rect[rect_y]);
            }
            if (Keyboard.Check(Keyboard.VK_MULTIPLY))
            {
                Keyboard.Wait(Keyboard.VK_MULTIPLY, false);
                Mouse.Wait(0, false);
                speech = "마우스 반전~";
                if(Mouse.y >(hei/2))
                {
                    Mouse.y -= hei / 2;
                }
                else
                {
                    Mouse.y += hei / 2;
                }
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD9))
            {
                MousePosPrevious = Mouse.pos;
                //Thread.Sleep(1000);
                Keyboard.Wait(Keyboard.VK_NUMPAD9, false);
                Mouse.Wait(0, false);



                if (mode == 4)
                {
                    speech = "풀오토 왼쪽복사시스템 테스트할게~";




                    fulloutocopytest3(4);
                }
                else
                {
                    speech = "왼쪽복사시스템 테스트할게~";
                    outocopytest10(4);
                }


                Mouse.pos = MousePosPrevious;
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD8))
            {
                speech = "자동검색 4번째 시스템이야~";
                MousePosPrevious = Mouse.pos;
                Thread.Sleep(1000);
                Keyboard.Wait(Keyboard.VK_NUMPAD8, false);
                Mouse.Wait(0, false);

                OutoSearchTest4();

                Mouse.pos = MousePosPrevious;
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD7))
            {
                Keyboard.Wait(Keyboard.VK_NUMPAD7, false);
                Mouse.Wait(0, false);
                if (mode == 4)
                {
                    speech = "풀오토 복사시스템 테스트할게~";




                    fulloutocopytest3(6);
                }
                else
                { 
                    speech = "복사시스템 테스트할게~";
                    MousePosPrevious = Mouse.pos;
                    outocopytest10(6);
                    Mouse.pos = MousePosPrevious;
                }
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD6))
            {
                speech = "왼쪽 자동복사야~";
                Keyboard.Wait(Keyboard.VK_NUMPAD6, false);
                Mouse.Wait(0, false);

                MousePosPrevious = Mouse.pos;
                outocopytest8(4);
                Mouse.pos = MousePosPrevious;
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD5))
            {
                speech = "자동검색 2번째 시스템";
                Thread.Sleep(0x7d0);
                Keyboard.Wait(Keyboard.VK_NUMPAD5, false);
                Mouse.Wait(0, false);
                OutoSearch();
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD4))
            {
                speech = "자동복사 시스템이야~";
                Keyboard.Wait(Keyboard.VK_NUMPAD4, false);
                Mouse.Wait(0, false);

                if (mode == 4)
                {
                    speech = "풀오토 복사시스템 테스트할게~";

                    fulloutocopytest2(6);
                }
                else
                {
                    speech = "반자동 복사야~";
                    MousePosPrevious = Mouse.pos;
                    if(speed_mode>0)
                    {
                        outocopytest8(6);
                    }
                    else
                    {
                        outocopytest8(6);
                    }
                    Mouse.pos = MousePosPrevious;
                }
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD1))
            {
                speech = "수동복사야~";
                Keyboard.Wait(Keyboard.VK_NUMPAD1, false);
                Mouse.Wait(0, false);
                OutoCopySimple();
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD3))
            {
                Keyboard.Wait(Keyboard.VK_NUMPAD3, false);
                Mouse.Wait(0, false);
                if (mode == 1)
                {

                    speech = "카테복원시스템이야~";

                    caterepair();

                }
                else
                {

                    speech = "왼쪽수동복사 시스템이야~";
                    MousePosPrevious = Mouse.pos;
                    OutoCopyV2();
                    Mouse.pos = MousePosPrevious;
                    Mouse.y += 19 + 9;
                    Mouse.Click(0);
                }
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD2))
            {
                //speech = "자동서치 3번째 시스템이야";
                //Thread.Sleep(1000);
                //Keyboard.Wait(Keyboard.VK_NUMPAD2, false);
                Mouse.Wait(0, false);
                //OutoSearchTest3();

                MousePosPrevious = Mouse.pos;
                if (Keyboard.Check(Keyboard.VK_SHIFT))
                {
                    Keyboard.Wait(Keyboard.VK_SHIFT, false);
                    Keyboard.Wait(Keyboard.VK_NUMPAD2, false);
                    speech = "자동검색이야~";
                    OutoSearchFirst();
                }
                else
                {
                    Keyboard.Wait(Keyboard.VK_NUMPAD2, false);
                    speech = "단순검색이야~ 시작할게";
                    OutoSearchSimple();
                }
                Mouse.pos = MousePosPrevious;
            }
            if (Keyboard.Check(Keyboard.VK_NUMPAD0))
            {
                Keyboard.Wait(Keyboard.VK_NUMPAD0, false);
                speech = "카테고리수동복사";
                Mouse.Wait(0, false);
                OutoCopySimpleV3();
            }
            break;
    }
}
speech = "우그으... 그만할게";

speech = "우그으... 어디를 복사해야할지 모르겠어";
speech = "우그으... 옵션명 서치 실패";

speech = "우그으... 그만할게";
speech = "다했어";

public static void OutoSearch()
{
    //듀얼서치
    speech = "듀얼서치 작동";
    int[] y_i = { 0, 0 };
    int[] sleep = { 0, 0 };
    int _break = 0;
    Point[] ClickPos = { Mouse.pos, Mouse.pos };

    speech = "위치파악하고 있어";

    Point[] pointArray;
    for (int i = 0; i < 2; i++)
    {

        pointArray = ImageSystem.ImageSearch(matching_z, rect[rect_y]);
        if (pointArray[0].X != -1)
        {
            ClickPos[i].X = pointArray[0].X + (matching_z.Width / 2);
        }
        else
        {
            for (int j = 0; j < 2; j++)
            {
                pointArray = ImageSystem.ImageSearch(option_matching[j], rect[i]);
                if (pointArray[0].X != -1)
                {
                    ClickPos[i].X = pointArray[0].X + (option_matching[j].Width / 2);
                }
            }
        }
        pointArray = ImageSystem.ImageSearch(right, rect[i]);
        if (pointArray[0].Y != -1)
        {
            ClickPos[i].Y = pointArray[0].Y + ((right.Height / 2) - 20);
        }
        pointArray = ImageSystem.ImageSearch(left, rect[i]);
        if (pointArray[0].Y != -1)
        {
            ClickPos[i].Y = pointArray[0].Y + ((left.Height / 2) - 20);
        }
    }
    speech = "검색중~";
    while (_break < 1)
    {
        if (!Keyboard.CheckToggle(Keyboard.VK_CAPITAL))
        {
            speech = "우그으... 그만할게";
            return;
        }
        else
        {
            _break = 0;
            for (int i = 0; i < 1; i++)
            {
                if (sleep[i] > 0)
                {
                    speech = "대기중이야";
                    sleep[i]--;
                }
                else if (sleep[i] == 0)
                {
                    speech = "확인하고있어";
                    sleep[i] = OutoSearchTest4_part(ref y_i[i], ClickPos[i], rect[i]);
                }
                else
                {
                    _break++;
                }
            }
            Thread.Sleep(10);
        }
    }
    speech = "찾았어";
}

 

'끄적끄적 > AI' 카테고리의 다른 글

넷째 - 이름없음 -  (0) 2023.03.16
유전알고리즘의 구성요소  (0) 2017.03.21
둘째 -이온-  (0) 2016.01.07
posted by 모카쨩

  • total
  • today
  • yesterday

Recent Post

저사양 유저용 블로그 진입