コード例 #1
0
def ToSelectCharacter(ws, ith, next=False):
    selectmap = [(90, 190), (200, 190), (330, 190), (450, 190), (580, 190),
                 (700, 190), (90, 400), (200, 400), (330, 400), (450, 400),
                 (580, 400), (700, 400)]
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    time.sleep(0.5)
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    print "exit to select character"
    # time.sleep(5)
    # cl.nomal_press_keyboard("esc", slp=1)
    time.sleep(2)
    cl.click(506, 578)
    time.sleep(2)
    cl.click(467, 448)
    if next:
        time.sleep(2)
        ScrollToNextLine(ws)
    else:
        time.sleep(2)
        ScrollToTop(ws)
    time.sleep(2)
    cl.click(selectmap[ith][0], selectmap[ith][1])
    time.sleep(0.2)
    cl.click(selectmap[ith][0], selectmap[ith][1])
コード例 #2
0
def stepintomap(ws):
    InTown = True
    count = 0
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    cl.nomal_press_keyboard("down", slp=1)
    cl.nomal_press_keyboard("right", slp=4)
    while (InTown == True and count < 10):
        I_common.capture(ws)
        time.sleep(0.1)
        capimg = misc.imread("c:\\temp\\bla.bmp")
        itemempty = capimg[575, 181]
        if itemempty[0] > 15 and itemempty[0] < 25 and itemempty[
                1] > 15 and itemempty[1] < 25 and itemempty[
                    2] > 15 and itemempty[2] < 25:
            print "MoveDown MoveRight"
            cl = ControlWindow.windowcl()
            cl.move_window(ws._handle, 0, 0)
            cl.nomal_press_keyboard("down", slp=1)
            cl.nomal_press_keyboard("right", slp=4)
        else:
            InTown = False
            print "In pick dungon screen"
        time.sleep(0.3)
        count = count + 1
    if count == 10 and InTown == True:
        print "Have tried 10 times, Failed to the Map:"
        print "We need redo again"
        return False
    else:
        return True
コード例 #3
0
def pickup(ws, key):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    cl.nomal_press_keyboard(key, slp=0.3)
    atknum = 5
    for i in range(atknum):
        cl.nomal_press_keyboard("x", slp=0.3)
    print "PickupFinished"
コード例 #4
0
def BuyTickets(ws, num, remove_pos):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    time.sleep(3)
    cl.click(202, 396)
    time.sleep(2)
    cl.click(378, 127)
    time.sleep(2)
    cl.click(500, remove_pos)
    time.sleep(2)
    cl.click(286, 152)
    time.sleep(2)

    lnum = len(str(num))
    for i in range(lnum):
        cl.nomal_press_keyboard(str(num)[i], slp=0.5)
        time.sleep(0.5)

    cl.nomal_press_keyboard("enter", slp=1)
    time.sleep(2)
    cl.nomal_press_keyboard("esc", slp=0.5)
    time.sleep(3)
    cl.nomal_press_keyboard("right", slp=3)
    time.sleep(1)
    cl.click(475, 285)
    time.sleep(0.2)
    cl.click(475, 285)
    cl.two_key_together("right", "up", slp=3)
    time.sleep(1)
    cl.nomal_press_keyboard("up", slp=0.5)
    time.sleep(1)
    cl.nomal_press_keyboard("space", slp=0.5)
    time.sleep(3)
    cl.nomal_press_keyboard("right", slp=5)
    time.sleep(1)
    cl.click(580, 341)
    time.sleep(1)
    cl.click(630, 391)
    time.sleep(1)
    cl.nomal_press_down("shift", slp=1)
    cl.click(439, 172)
    cl.nomal_press_down("shift", slp=1)
    time.sleep(1)

    number = str(int(int(num) / 5))
    lnumber = len(number)
    for i in range(lnumber):
        cl.nomal_press_keyboard(str(number)[i], slp=0.5)
        time.sleep(0.5)

    cl.nomal_press_keyboard("enter", slp=1)
    time.sleep(0.5)
    cl.nomal_press_keyboard("enter", slp=1)
    time.sleep(2)
    cl.nomal_press_keyboard("esc", slp=0.5)
    time.sleep(3)
コード例 #5
0
def MovetoPre(ws):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    print "Start Moving"
    time.sleep(3)
    cl.nomal_press_keyboard("numpad_2", slp=4)
    time.sleep(1)
    cl.two_key_together("numpad_4", "numpad_8", slp=5)
    time.sleep(1)
    cl.nomal_press_keyboard("numpad_6", slp=2)
コード例 #6
0
def ScrollToTop2():
    cl = ControlWindow.windowcl()
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
コード例 #7
0
def MovetoPre(ws):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    print "Start Moving"
    time.sleep(3)
    cl.nomal_press_keyboard("down", slp=4)
    time.sleep(1)
    cl.two_key_together("left", "up", slp=5)
    time.sleep(1)
    cl.nomal_press_keyboard("right arrow", slp=2)
コード例 #8
0
def ToSelectCharacter2(ith, next=False):
    selectmap = [(90, 190), (200, 190), (330, 190), (450, 190), (580, 190),
                 (700, 190), (90, 400), (200, 400), (330, 400), (450, 400),
                 (580, 400), (700, 400)]
    cl = ControlWindow.windowcl()
    time.sleep(0.5)
    cl = ControlWindow.windowcl()
    time.sleep(1)
    cl.nomal_press_keyboard("esc", slp=0.5)
    time.sleep(2)
    cl.click(464, 392)
    if next:
        time.sleep(2)
        ScrollToNextLine2()
    else:
        time.sleep(2)
        ScrollToTop2()
    time.sleep(2)
    cl.click(selectmap[ith][0], selectmap[ith][1])
    time.sleep(0.2)
    cl.click(selectmap[ith][0], selectmap[ith][1])
コード例 #9
0
def ScrollToNextLine2():
    cl = ControlWindow.windowcl()
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_down(200, 200)
    time.sleep(0.5)
    cl.mouse_scroll_down(200, 200)
コード例 #10
0
def ScrollToTop(ws):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    time.sleep(0.5)
    cl.move_window(ws._handle, 0, 0)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.move_window(ws._handle, 0, 0)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.move_window(ws._handle, 0, 0)
    cl.mouse_scroll_up(200, 200)
    time.sleep(0.5)
    cl.move_window(ws._handle, 0, 0)
    cl.mouse_scroll_up(200, 200)
コード例 #11
0
def startgame(ws, first):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    if first == True:
        cl.nomal_press_keyboard("space", slp=0.5)
    inselectscreen = False
    selected = False
    maxcount = 0
    while inselectscreen == False and maxcount < 100:
        maxcount = maxcount + 1
        I_common.capture(ws)
        time.sleep(0.1)
        capimg = misc.imread("c:\\temp\\bla.bmp")
        selectpixel1 = capimg[300, 473]
        selectpixel2 = capimg[300, 393]
        selectpixel3 = capimg[585, 429]
        inselectscreen1 = selectpixel1[0] > 200 and selectpixel1[
            1] > 200 and selectpixel1[2] > 200
        inselectscreen2 = selectpixel2[0] > 200 and selectpixel2[
            1] > 200 and selectpixel2[2] > 200
        inselectscreen3 = selectpixel3[0] > 200 and selectpixel3[
            0] < 210 and selectpixel3[1] > 180 and selectpixel3[
                1] < 190 and selectpixel3[2] > 130 and selectpixel3[2] < 140
        inselectscreen = inselectscreen1 and inselectscreen2 and inselectscreen3
        # inselectscreen = inselectscreen2
        if inselectscreen and selected == False:
            print "In select screen, press spacebar"
            cl.move_window(ws._handle, 0, 0)
            cl.nomal_press_keyboard("space", slp=0.5)
            time.sleep(2)
            selected = True
        elif inselectscreen == False and selected == True:
            print "In game now, start fight!"
            break
    if maxcount == 100:
        print "Did not find select Screen in 10s, But Let it go."
コード例 #12
0
def GameBegin():
    time.sleep(5)
    #Indicate DFO path
    GamePath = "D:\Neople\DFO\NeopleLauncher.exe"
    subprocess.Popen(GamePath)
    print "1"
    time.sleep(15)
    print 2
    ws = windowsht()
    ws.active_window(".*Dungeon Fighter Online.*")
    print 3
    time.sleep(5)
    print 4

    AccountPos = (1300,300)
    PasswordPos = (1300,333)
    LoginPos = (1300,366)
    StartPos = (1300,250)

    cl = ControlWindow.windowcl()
    cl.click(AccountPos[0],AccountPos[1])
    time.sleep(0.1)
    cl.click(AccountPos[0],AccountPos[1])
    time.sleep(0.1)
    cl.click(AccountPos[0],AccountPos[1])

    time.sleep(3)
    Account = "*****@*****.**"
    AccountA = "5fugitive8"
    AccountB = "gmail.com"
    # cl.nomal_input(AccountA)
    # cl.nomal_press_down("shift",slp=1)
    # cl.nomal_press_keyboard("2")
    # cl.nomal_press_down("shift",slp=1)
    # cl.nomal_input(AccountB)
    keyboard.write(Account)

    time.sleep(3)
    cl = ControlWindow.windowcl()
    cl.click(PasswordPos[0],PasswordPos[1])
    time.sleep(0.1)
    cl.click(PasswordPos[0],PasswordPos[1])
    time.sleep(0.1)
    cl.click(PasswordPos[0],PasswordPos[1])
    time.sleep(3)
    Password = "******"
    keyboard.write(Password)

    time.sleep(3)


    cl = ControlWindow.windowcl()
    cl.click(LoginPos[0],LoginPos[1])
    time.sleep(0.1)
    cl.click(LoginPos[0],LoginPos[1])

    time.sleep(3)


    cl = ControlWindow.windowcl()
    cl.click(StartPos[0],StartPos[1])
    time.sleep(0.1)
    cl.click(StartPos[0],StartPos[1])

    print "started"
コード例 #13
0
def Click_Return_ByESC(ws):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    cl.click(395, 570)
コード例 #14
0
def Click_Return_InMap(ws):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    cl.click(806, 149)
コード例 #15
0
def Click_Retry(ws):
    cl = ControlWindow.windowcl()
    cl.move_window(ws._handle, 0, 0)
    cl.click(806, 87)
コード例 #16
0
def characterfight(ws, character):
    if character == "indra":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.5)
        cl.avaliable_press_keyboard(ws, "s", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.5)
    elif character == "fnen":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=1)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        time.sleep(1)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
    elif character == "guanyu":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "r", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"right_arrow", slp=1)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        # time.sleep(1)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "fsm":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "msm":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "w", slp=0.2)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
    elif character == "xukong":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "modao":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "yingwu":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "h", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.5)
        # cl.avaliable_press_keyboard(ws,"a", slp=0.5)
        # cl.avaliable_press_keyboard(ws,"s", slp=0.5)
    elif character == "zhaohuan":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "r", slp=0.3)
        cl.avaliable_press_keyboard(ws, "t", slp=0.3)
        cl.avaliable_press_keyboard(ws, "y", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
    elif character == "saint":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "r", slp=0.3)
        cl.avaliable_press_keyboard(ws, "t", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "g", slp=0.3)
    elif character == "seraph":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "g", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
    elif character == "monk":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "h", slp=0.3)
        cl.avaliable_press_keyboard(ws, "y", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.5)
        cl.avaliable_press_keyboard(ws, "s", slp=0.5)
        cl.avaliable_press_keyboard(ws, "d", slp=0.5)
        cl.avaliable_press_keyboard(ws, "f", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.5)
    elif character == "nvdaqiang":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
    elif character == "wunv":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "r", slp=1.0)
    elif character == "palading":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.5)
        # cl.avaliable_press_keyboard(ws,"q", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
    elif character == "jirou":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        # cl.avaliable_press_keyboard(ws,"numpad_6", slp=0.5)
        cl.avaliable_press_keyboard(ws, "q", slp=0.2)
        cl.avaliable_press_keyboard(ws, "a", slp=0.2)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "g", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "r", slp=0.3)
    elif character == "fff":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.2)
        cl.avaliable_press_keyboard(ws, "s", slp=0.2)
        cl.avaliable_press_keyboard(ws, "d", slp=0.2)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
    elif character == "andi":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.2)
        cl.avaliable_press_keyboard(ws, "s", slp=0.2)
        cl.avaliable_press_keyboard(ws, "d", slp=0.2)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "hundun":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.2)
        cl.avaliable_press_keyboard(ws, "s", slp=0.2)
        cl.avaliable_press_keyboard(ws, "d", slp=0.2)
        cl.avaliable_press_keyboard(ws, "q", slp=0.2)
        cl.avaliable_press_keyboard(ws, "w", slp=0.2)
        cl.avaliable_press_keyboard(ws, "e", slp=0.2)
        cl.avaliable_press_keyboard(ws, "f", slp=0.2)
    elif character == "hongyan":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.nomal_press_keyboard("z", slp=0.5)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "mudan":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "heiqiang":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "y", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
    elif character == "siyi":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
    elif character == "renzhe":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "fengfa":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "jixie":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "t", slp=0.3)
    elif character == "mnen":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
        cl.avaliable_press_keyboard(ws, "f", slp=0.3)
    elif character == "guiqi":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "d", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
        cl.avaliable_press_keyboard(ws, "e", slp=0.3)
    elif character == "tegong":
        cl = ControlWindow.windowcl()
        cl.move_window(ws._handle, 0, 0)
        cl.nomal_press_keyboard("0", slp=0.3)
        cl.avaliable_press_keyboard(ws, "a", slp=0.3)
        cl.avaliable_press_keyboard(ws, "s", slp=0.3)
        cl.avaliable_press_keyboard(ws, "q", slp=0.3)
        cl.avaliable_press_keyboard(ws, "w", slp=0.3)
コード例 #17
0
from Basis import ControlWindow
from Basis.CaptureWindow import windowsht
import time
'''Here we start the Script'''

print "OKay. Start Then--------------------------------------------------------------------------------"

# print "Move Window to left upper corner, window size is constant"
ws = windowsht()
ws.active_window(".*Dungeon Fighter Online.*")
cl = ControlWindow.windowcl()
cl.move_window(ws._handle,0,0)


cl.move_window(ws._handle, 0, 0)
# cl.nomal_press_keyboard("numpad_1", slp=0.5)
time.sleep(0.5)
cl.move_window(ws._handle, 0, 0)

cl.mouse_scroll_up(200,200)
time.sleep(0.5)
cl.move_window(ws._handle, 0, 0)

cl.mouse_scroll_down(200,200)