--[[
飺
    ˫v3.9d Eagel-14EΤ𳵡è޷ɣĬϰZʼ
űָ
ʹ˵
    ĬϿݼΪZ޸λüűġϷָ̽ĵͼʹZɣ

£
[2010628]
è޷ɵģģʽЬָλãҲʱʹø㡣
[2009822]
µűʱʱ䣬1.2+汾ֵʹ½ű齫ȫ¸ı䣬ȫгٶۡ
ԿƲ⡣
[2009828]
Ϸڽɫ״ʾ֧1.2+汾֡
[2010412]
ɾһ룬Ĳ
[2010510]
¶Ӧ°汾ֵĹܺ
                                       ߣҹ
                                                              ]]
--űģ
--û޸Ĵ
unitClickKey=90    --ĬϲZԼɸı
--û޸Ĵ
promptState1=0
promptState2=0
message1='ѡӢ۵ΤWܺ԰Z겻ƶÿοWķΧڣƶ'
message2='ѡӢèˣרͷЬ󣬽ЬƷλ1ָ\nҰĿ괦ZɵָλãZƵôڰ'
idm=0
ridm=0
idp=0
ridp=0

setkeywatch('keyhookfunc')
if getwshscriptversion() < 8 then
    msgbox('ʹø߰汾')
end

function keyhookfunc(keycode, controlkeycode, downorup)
    if 0==iswar3front() then return 0 end
    if 1==ischat() then return 0 end
    strCurrSelUnit = getcurrentunit()
    war3w = getwar3window()
    win3wl,win3wr,win3wt,win3wb = getclientrect(war3w)
    x=(win3wr-win3wl)*0.0018
    y=(win3wb-win3wt)*0.66
    if strCurrSelUnit=='600H' and promptState1==0 then
        idp,ridp=d3dsettext(idp,ridp,'֡', 20000, x,y, "", 0x0000ff, 255, 8, 16, 0, 0, 0, 0,1000, 2000)
        idm,ridm=d3dsettext(idm,ridm,message1, 20000, 16*4+x,y, "", 0xffffff, 255, 8, 16, 0, 0, 0, 0,1000, 2000)
        promptState1=1
    end
    if strCurrSelUnit=='P00N' and promptState2==0 then 
        idp,ridp=d3dsettext(idp,ridp,'֡', 20000, x,y, "", 0x0000ff, 255, 8, 16, 500, 0, 0, 0,1000, 2000)
        idm,ridm=d3dsettext(idm,ridm,message2, 20000, 16*4+x,y, "", 0xffffff, 255, 8, 16, 500, 0, 0, 0,1000, 2000)
        promptState2=1
    end
--[[
ΪѡеΤĲűZ(90)ƶWķΧڣ𳵾һ߰
ZһֱĿ귽ƶƶλúϸƶλñǿWľ룬
ͣ¡עYİƶ]]
    if strCurrSelUnit=='600H' and keycode==unitClickKey and downorup==0 then    --600HΪΤID
        keypress(87)
        sleep(50)
        mouseclick(0)
        sleep(50)
        keypress(83)
        return 1
    end 
--[[
Ϊѡè˵ĲűָҰĿ괦Z(90)ɣZƵ
ڰ룬ʵҪԼ״ҪעȱרͷЬ]]
    if strCurrSelUnit=='P00N'and keycode==unitClickKey and downorup==0 then    --P00NΪèID
        runkeys('E ʱ1ms S ʱ1ms ʹƷcsed ʱ1ms ')
        return 1
    end
end 