채팅0

    찰리중사 코드

    조회수 1010

    1번 - 코드에 맞게 화면 사이즈 조정

    2번 - 실행. 

     

    1번 ------------------------

    import pygetwindow as gw

    import pyautogui

    my_program = gw.getWindowsWithTitle('MapleStory Worlds-Mapleland')[0]

    my_program.resizeTo(1400, 800)  

    my_program.moveTo(0, 0)


    -----------------------------------

    2번 ------------------------------

    import pygetwindow as gw

    import pyautogui

    import tkinter as tk

    import random

    import time

    import keyboard


     

    my_program = gw.getWindowsWithTitle('MapleStory Worlds-Mapleland')[0]


     

    coords_A = (500, 397)

    coords_B = (994, 459)

    coords_C = (952, 531)

    coords_D = (980, 413)


     

    coords1 = [(634, 314), (634, 340), (634, 390), (634, 443),

              (634, 470), (634, 495), (634, 544), (634, 462), (634, 487), (634,513), (634, 250),

              (634, 299), (634, 328), (634, 352), (634, 375),

              (634, 402), (634, 425), (634, 478), (634, 507)]



     

    def A(): #찰리

        click_x, click_y = coords_A

        absolute_x = my_program.left + click_x

        absolute_y = my_program.top + click_y

        pyautogui.moveTo(absolute_x, absolute_y, duration=random.uniform(0.1, 0.3))

        pyautogui.click()


     

    def B(): #다음

        click_x, click_y = coords_B

        absolute_x = my_program.left + click_x

        absolute_y = my_program.top + click_y

        pyautogui.moveTo(absolute_x, absolute_y, duration=random.uniform(0.1, 0.3))

        pyautogui.click()


     

    def C(): #예

        click_x, click_y = coords_C

        absolute_x = my_program.left + click_x

        absolute_y = my_program.top + click_y

        pyautogui.moveTo(absolute_x, absolute_y, duration=random.uniform(0.1, 0.3))

        pyautogui.click()


     

    def D(): #빈칸

        click_x, click_y = coords_D

        absolute_x = my_program.left + click_x

        absolute_y = my_program.top + click_y

        pyautogui.moveTo(absolute_x, absolute_y, duration=random.uniform(0.1, 0.3))

        pyautogui.click()
     

    def click(number):

        click_x, click_y = coords1[number - 1]

        absolute_x = my_program.left + click_x

        absolute_y = my_program.top + click_y

        pyautogui.moveTo(absolute_x, absolute_y, duration=random.uniform(0.1, 0.3))

        pyautogui.click()
     

    def click2(number):

            click_x, click_y = coords1[number - 1]

            absolute_x = my_program.left + click_x

            absolute_y = my_program.top + click_y

            pyautogui.moveTo(absolute_x, absolute_y, duration=random.uniform(0.1, 0.3))

            pyautogui.click()


     

    def click(number, times):

      if number <=7:

        for _ in range(times):

            A()

            time.sleep(0.2)

            B()

            time.sleep(0.2)

            C()

            time.sleep(0.2)

            D()

            time.sleep(0.2)

            click2(number)

            time.sleep(0.3)

            C()

            time.sleep(0.1)            

            keyboard.press('esc')

            time.sleep(0.2)

            keyboard.release('esc')
     

            time.sleep(random.uniform(0.4, 0.7))

      if 8<= number <=10:

         for _ in range(times):

            A()

            time.sleep(0.2)

            B()

            time.sleep(0.2)

            C()

            time.sleep(0.3)

            D()

            time.sleep(0.7)

            pyautogui.scroll(1)

            time.sleep(0.3)

            pyautogui.mouseDown(1030, 250)

            pyautogui.moveTo(1030, random.uniform(337, 343), duration=random.uniform(0.3, 0.4))

            pyautogui.mouseUp()

            time.sleep(0.1)

            click2(number)

            time.sleep(0.3)

            C()

            time.sleep(0.1)

            keyboard.press('esc')

            time.sleep(0.2)

            keyboard.release('esc')

            time.sleep(random.uniform(0.4, 0.6))


     

      if 11 <= number :    

        for _ in range(times):

            A()

            time.sleep(0.2)

            B()

            time.sleep(0.2)

            C()

            time.sleep(0.3)

            D()

            time.sleep(0.7)

            pyautogui.scroll(1)

            time.sleep(0.3)

            pyautogui.mouseDown(1030, 250)

            pyautogui.moveTo(1030,random.uniform(596, 608), duration=random.uniform(0.4, 0.5))

            pyautogui.mouseUp()

            time.sleep(0.1)

            click2(number)

            time.sleep(0.3)

            C()

            time.sleep(0.1)

            keyboard.press('esc')

            time.sleep(0.2)

            keyboard.release('esc')

            time.sleep(random.uniform(0.4, 0.7))
     

    window = tk.Tk()
     

    tk.Label(window, text="번호를 입력하세요: ").grid(row=0)

    tk.Label(window, text="실행 횟수를 입력하세요: ").grid(row=1)
     

    entry_number = tk.Entry(window)

    entry_number.grid(row=0, column=1)

    entry_times = tk.Entry(window)

    entry_times.grid(row=1, column=1)


     

    button = tk.Button(window, text="실행", command=lambda: click(int(entry_number.get()), int(entry_times.get())))

    button.grid(row=2, column=1)
     

    window.mainloop()

    댓글6

    회원프로필


    파이썬임
    (몬스터번호)
    1 단단한뿔  2 별조각  3 네펜데스  4 달조각  5 다크네펜데스
    6 주니어 예티  7 태양조각  8 셀리온  9 라이오너  10 그류핀  11 헥터
    12 어금니  13 화이트팽  14 페페  15 다크페페  16 예티  17 다크 예티  18 웨어울프
    19 라이칸스로프

    2024.03.18 14:56
    회원프로필

    맞다 캐릭터 위치도  고정시켜야됨

    찰리중사
              ㅣ
              ㅣ
              ㅣ                    <------------ 오른쪽에서 왼쪽방향으로 가서 사다리 끝까지 올라간 곳에서'만' 해야됨 그래야
                                                                좌표맞음

    2024.03.18 14:59
    회원프로필

    캬 ㅋㅋㅋ

    2024.03.18 14:57
    회원프로필

    줍줍 잘쓰겟습니다

    2024.03.18 14:58
    회원프로필

    뭐이리 어려워

    2024.03.18 15:03
    회원프로필

    이거 정지 안먹는거임?

    2024.04.23 16:26

      게시글 리스트
      제목작성자작성일조회
      공지10-2016661
      5814816:59115
      5814714:46130
      5814611:53179
      5814501:42298
      5814400:26286
      5814300:17305
      5814210-23408
      5814110-23412
      5814010-23551
      5813910-23421
      5813810-22720
      5813710-22618
      5813610-22642
      5813510-22671
      5813410-22838
      5813310-22932
      5813210-21972
      5813110-211079
      5813010-211000
      안내 배너 이미지