Пример #1
0
    cfg=config.current_info
    wx,wy=get_wnd_offset(wnd)
    x=wx+c*cfg.w+cfg.x0+cfg.w//2
    y=wy+r*cfg.h+cfg.y0+cfg.h//2
   # print("click",r,c,"   ",x,y)
    click(x,y)


def work_once():
    cfg=config.current_info
    _wnd=wnd()
    global li_linkable,last_tick
    if len(li_linkable)==0 or _wnd==0:
        tic=windll.kernel32.GetTickCount()
        if tic-last_tick<3000:
            return
        last_tick=tic
        li_linkable=get_linkable_set(_wnd)
        print("%d pairs found!"% len(li_linkable))
    
    if len(li_linkable)!=0:
        (r1,c1,r2,c2),s=li_linkable.pop(0)
        click_grid(_wnd,r1,c1)
        click_grid(_wnd,r2,c2)
       # print(r1,c1,r2,c2,"            ",s)

config.current_info=config.llk_qq
hotkey.reg(0,hotkey.VK_F10,work_once)

#hk.reg(hk.MOD_CONTROL,50,reset)
Пример #2
0
    ds=get_dif_set(*para)
    for x in ds:
        a=dll.set_pixel(x[0],x[1],0x0000ff)

def fill100(x,y,clr):
    for r in range(y-10,y+10):
        for c in range(x-10,x+10):
            dll.set_pixel(c,r,clr)

def test(para):
    dll.snap(wnd())
    dl=get_dif_pt(para)
    if len(dl)==0:
        return
    dx,dy=get_wnd_offset(wnd())
    for t in dl:
        move(t[0]+dx,t[1]+dy)
        ld()
        lu()


            
import hotkey

hotkey.reg(2,49,lambda :test(para1))
hotkey.reg(2,50,lambda :test(para2))
hotkey.reg(2,51,lambda :manual(para1))
hotkey.reg(2,52,lambda :manual(para2))

#dif=get_dif_set(10,403,186,380,285)