-- =갴      Ϊ0    0֮ⲻظ֣

--ļ
--akmءѹgrozaѹmini14ѹsks
akm_key = 7

--m16ءѹp1911ѹs686
m16_key = 0

--m4ءѹscar   11g502g900󰴴İ 10Ϊ
m4_key = 4

--ump9ءѹp92
ump9_key = 6

--uzi
uzi_key = 0

--scar-l
scar_key = 5

--mini14
mini_key = 0

--ȫѹǹرհ
close_key = 3

--
bigjump_key = 0

--װ
grenade_key = 0

--һᳵ
transverseparking_key = 0

--סɡ:
flutter_key = 0

--Զ㿪:
rightdeviation_key = 0
--ļ







--

--trueΪ򿪣                        falseΪرգ
--رչ뽫trueΪfalse        򿪹뽫falseΪtrue

--עԶϢֻпٰһҼٰסҼʱŻ
--2,4ҼסʱԶϢ
shift = false

--2 
twoon = false
--4
fouron = false

--Զ
auto_reloading = false


--׸ļ Ķ׸ĳctrl 
bigjumpkey_ctrl = false
--


--صӰѹǹЧ
--ϷȵĬ1ϷĬ50ѹСѹס
l=1
--ıѹ
akmx4=50
m16x4=50
m4x4=50
scarx4=50
ump9x4=50
minix4=50


--ѹǹݣһѭ

--m16 ԭ
--1
m16of1=        {6,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7}
--1Ϣ
m16of15=        {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,16,16,16,16,16,16,16,16,16,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,10}
--2
m16of2=        {12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,18,18,18,18,18,18,18,18,18,18,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12}
--4
m16of4=        {48,42,22,15,14,18,20,24,26,27,32,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35}

stop_key_m16 = 0








--akm ԭ
--1
akmof1=        {12,12,10,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7}
--33
--1Ϣ
akmof15=        {8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,11}
--2
akmof2=        {10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13}
--4
akmof4=        {20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,37,37,37,37,37,37,37,37,37,37,37,37,37,28}

stop_key_akm = 0








--m4 ԭ
--1
m4of1=        {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,}
--1Ϣ
m4of15=        {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,12,12,12,12,12,12,12,12,12,12,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,12}
--2
m4of2=        {10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,13,13,13,13,13,13,13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13}
--4
m4of4=        {24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,31,31,31,31,31,31,31,31,31,31,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,31}

stop_key_m4 = 0




--scar ԭ
--1
scarof1=        {9,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,8,8,7}
--1Ϣ
scarof15=        {10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,14,14,14,14,14,14,14,14,14,14,11}
--2
scarof2=        {11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,15,15,15,15,15,15,15,15,15,15,12}
--4
scarof4=        {21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,35,35,35,35,35,35,35,35,35,35,28}

stop_key_scar = 0




--ump9 ԭ
--1
ump9of1=        {6,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,7,7}
--1Ϣ
ump9of15=        {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8}
--2
ump9of2=        {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,9}
--4
ump9of4=        {17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,21}

stop_key_ump9 = 0







--uzi ԭ
--1
uziof1=        {4,4,4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8}
--1Ϣ
uziof15=        {5,5,5,5,5,5,5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,11}

stop_key_uzi = 0




--mini14 ԭ
--1
miniof1=        {6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8}
--1Ϣ
miniof15=        {8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11}
--2
miniof2=        {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12}
--4
miniof4=        {48,42,22,15,14,18,20,24,26,27,32,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35}

stop_key_mini = 0





function OnEvent(event, arg)
        --OutputLogMessage("event = %s, arg = %d\n", event, arg)
        if (event == "PROFILE_ACTIVATED") then--ļ
                if IsKeyLockOn("capslock")then
                        PressAndReleaseKey("capslock")
                end
                if IsKeyLockOn("numlock")then
                        PressAndReleaseKey("numlock")
                end
                if IsKeyLockOn("scrolllock")then
                        PressAndReleaseKey("scrolllock")
                end
                EnablePrimaryMouseButtonEvents(true)
                i = 1
                click = 0
                shotTime = 0
                Holdbreathmode = 0
                Holdbreathkey = 0
                sightkey = 0
                targetingkey = 0
                rightkeytime1 = 0
                rightkeytime2 = 0
                sightmode = 0
                macro = false
                rightdeviation = false
        elseif event == "PROFILE_DEACTIVATED" then--ļ
                ReleaseMouseButton(1)
                ReleaseKey("lshift")
        end

        if(event == "MOUSE_BUTTON_PRESSED" and arg == bigjump_key)then--ģ
                PressKey("spacebar")        
                Sleep(1)        
                if bigjumpkey_ctrl then
                        PressKey("lctrl")
                else
                        PressKey("c")
                end
                Sleep(50)
                if bigjumpkey_ctrl then
                        ReleaseKey("lctrl")
                else
                        ReleaseKey("c")
                end
                Sleep(1)
                ReleaseKey("spacebar")
        end

        if(event == "MOUSE_BUTTON_PRESSED" and arg == transverseparking_key)then--ᳵģ
                PressKey("lshift")
                Sleep(1)
                PressKey("w")
                Sleep(1)
                ReleaseKey("lshift")
                Sleep(1)
                PressKey("a")
                Sleep(1)
                PressKey("spacebar")
                Sleep(1100)
                ReleaseKey("a")
                Sleep(1)
                ReleaseKey("w")
                Sleep(1)
                PressKey("s")
                Sleep(800)
                ReleaseKey("spacebar")
                Sleep(1)
                ReleaseKey("s")
        end

        if(event == "MOUSE_BUTTON_PRESSED" and arg == flutter_key)then--ɡģ Mkey2
                click=1
                ReleaseKey("w")
                fluttering()
        end 
        if (event == "M_RELEASED" and arg == 2) then
                fluttering()
        end
        if(event == "MOUSE_BUTTON_RELEASED" and arg == flutter_key)then
                ReleaseKey("w")
                Stopclick()
        end 

        if(event == "MOUSE_BUTTON_PRESSED" and arg == grenade_key)then--ģ
                PressKey("5")
                ReleaseKey("5")
                Sleep(1000)
                PressMouseButton(1)
        end
        if(event == "MOUSE_BUTTON_RELEASED" and arg == grenade_key)then 
                ReleaseMouseButton(1)
                Sleep(1000)
                PressKey("1")
                ReleaseKey("1")
        end

        if(event == "MOUSE_BUTTON_PRESSED" and arg == 2)then--жҼ׼״̬ģ&Զģ
                rightkeytime1 = GetRunningTime()
                targetingkey = 1
                if rightkeytime1 - rightkeytime2 < 200 then
                        --OutputLogMessage("%d %d\n",rightkeytime2,rightkeytime1)
                        targetingkey = 0
                end
                Holdbreathkey = 1
                sightkey = 1
                Holdbreathstart()
                if(rightdeviation and macro)then
                        PressKey("e")
                end
        end
        if(event == "MOUSE_BUTTON_RELEASED" and arg == 2)then 
                rightkeytime2 = GetRunningTime()
                targetingkey = 0
                Holdbreathkey = 0
                sightkey = 0
                Holdbreathstop()
                if(rightdeviation and macro)then
                        ReleaseKey("e")
                end
        end

        if(event == "MOUSE_BUTTON_PRESSED" and arg == rightdeviation_key)then--Զģ鿪
                rightdeviation = not rightdeviation
        end

        if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsModifierPressed("lshift") and IsModifierPressed("lalt")) then--һקģ
                Sleep (10)
                PressMouseButton(1)
                Sleep (10)
                MoveMouseRelative(120,0)
                Sleep (2)
                MoveMouseRelative(120,0)
                Sleep (2)
                MoveMouseRelative(120,0)
                Sleep (2)
                MoveMouseRelative(120,0)
                Sleep (2)
                MoveMouseRelative(120,0)
                Sleep (10)
                ReleaseMouseButton(1)
                Sleep (10)
         MoveMouseRelative(-120,0)
         Sleep (2)
         MoveMouseRelative(-120,0)
         Sleep (2)
         MoveMouseRelative(-120,0)
         Sleep (2)
         MoveMouseRelative(-120,0)
         Sleep (2)
         MoveMouseRelative(-120,0)
        end

        if (event == "MOUSE_BUTTON_PRESSED" and arg == akm_key) then--ѹǹģakm
                Release()
                IsAK = not IsAK
                IsM16 = false
                IsM4 = false
                IsUZI = false
                IsUMP9 = false
                IsSCAR = false
                IsMINI = false
                if IsAK then
                        macro = true
                        OutputLogMessage("akm on\n")
                        OutputLCDMessage("akm on",500000)
                else
                        macro = false
                        OutputLogMessage("akm off\n")
                        OutputLCDMessage("akm off",500000)
                end
                scr()
        end
        if (event == "MOUSE_BUTTON_PRESSED" and arg == m16_key) then--ѹǹģm16
                Release()
                IsM16 = not IsM16
                IsAK = false
                IsM4 = false
                IsUZI = false
                IsUMP9 = false
                IsSCAR = false
                IsMINI = false
                if IsM16 then
                        macro = true
                        OutputLogMessage("m16 on\n")
                        OutputLCDMessage("m16 on",500000)
                else
                        macro = false
                        OutputLogMessage("m16 off\n")
                        OutputLCDMessage("m16 off",500000)
                end
                scr()
    end
    if (event == "MOUSE_BUTTON_PRESSED" and arg == m4_key) then--ѹǹģm4
                Release()
                IsM16 = false
                IsAK = false
                IsUZI = false
                IsM4 = not IsM4
                IsUMP9 = false
                IsSCAR = false
                IsMINI = false
                if IsM4 then
                        macro = true
                        OutputLogMessage("m4 on\n")
                        OutputLCDMessage("m4 on",500000)
                else
                        macro = false
                        OutputLogMessage("m4 off\n")
                        OutputLCDMessage("m4 off",500000)
                end
                scr()
    end
    if (event == "MOUSE_BUTTON_PRESSED" and arg == uzi_key) then--ѹǹģuzi
                Release()
                IsM16 = false
                IsAK = false
                IsM4 = false
                IsUZI = not IsUZI
                IsUMP9 = false
                IsSCAR = false
                IsMINI = false
                if IsUZI then
                        macro = true
                        OutputLogMessage("uzi on\n")
                        OutputLCDMessage("uzi on",500000)
                else
                        macro = false
                        OutputLogMessage("uzi off\n")
                        OutputLCDMessage("uzi off",500000)
                end
                scr()
        end
    if (event == "MOUSE_BUTTON_PRESSED" and arg == ump9_key) then--ѹǹģump9
                Release()
                IsM16 = false
                IsAK = false
                IsM4 = false
                IsUZI = false
                IsUMP9 = not IsUMP9
                IsSCAR = false
                IsMINI = false
                if IsUMP9 then
                        macro = true
                        OutputLogMessage("ump9 on\n")
                        OutputLCDMessage("ump9 on",500000)
                else
                        macro = false
                        OutputLogMessage("ump9 off\n")
                        OutputLCDMessage("ump9 off",500000)
                end
                scr()
        end
        if (event == "MOUSE_BUTTON_PRESSED" and arg == scar_key) then--ѹǹģscar
                Release()
                IsAK = false
                IsM16 = false
                IsM4 = false
                IsUZI = false
                IsUMP9 = false
                IsSCAR = not IsSCAR
                IsMINI = false
                if IsSCAR then
                        macro = true
                        OutputLogMessage("scar on\n")
                        OutputLCDMessage("scar off",500000)
                else
                        macro = false
                        OutputLogMessage("scar off\n")
                        OutputLCDMessage("scar off",500000)
                end
                scr()
        end
        if (event == "MOUSE_BUTTON_PRESSED" and arg == mini_key) then--ѹǹģmini14
                Release()
                IsAK = false
                IsM16 = false
                IsM4 = false
                IsUZI = false
                IsUMP9 = false
                IsSCAR = false
                IsMINI = not IsMINI
                if IsMINI then
                        macro = true
                        OutputLogMessage("mini on\n")
                        OutputLCDMessage("mini off",500000)
                else
                        macro = false
                        OutputLogMessage("mini off\n")
                        OutputLCDMessage("mini off",500000)
                end
                scr()
        end
        if (event == "MOUSE_BUTTON_PRESSED" and arg == close_key) then--ѹǹģȫرѹǹ
                Release()
                IsM4 = false
                IsM16 = false
                 IsAK = false
                IsUZI = false
                IsUMP9 = false
                IsSCAR = false
                IsMINI = false
                macro = false
                OutputLogMessage("all gun off\n")
                OutputLCDMessage("all gun off",500000)
                scr()
    end

           if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and macro and not IsModifierPressed("lalt") and targetingkey==0) then--ʼѹǹģ
                if (IsModifierPressed("lctrl") and IsKeyLockOn("capslock") and fouron) then--4ctrlģ
                        if IsAK then
                                ax4(akmx4)
                        elseif IsM16 then
                                ax4(m16x4)
                        elseif IsM4 then
                                ax4(m4x4)
                        elseif IsUMP9 then
                                ax4(ump9x4)
                        elseif IsMINI then
                                ax4(minix4)
                        elseif IsSCAR then
                                ax4(scarx4)
                        end
                else--ģ
                        click = 1
                        Holdbreathstop()
                        if IsAK then
                                akm()
                        elseif IsM16 then
                                m16()
                        elseif IsM4 then
                                m4()
                        elseif IsUMP9 then
                                ump9()
                        elseif IsUZI then
                                uzi() 
                        elseif IsMINI then
                                mini()
                        elseif IsSCAR then
                                scar()
                        end
                end
        elseif (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and not IsModifierPressed("lalt") and targetingkey==1 and macro) then
                click = 1
                OutputLogMessage("targetingtart\n")
                targeting()
        end

        if(event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsModifierPressed("lctrl") and IsKeyLockOn("capslock") and fouron)then

        end

        if (event == "M_RELEASED" and arg == 3) then--ѹǹģ
                if IsAK then
                        akm()
                elseif IsM16 then
                        m16()
                elseif IsM4 then
                        m4()
                elseif IsUMP9 then
                        ump9()
                elseif IsUZI then
                        uzi() 
                elseif IsMINI then
                        mini()
                elseif IsSCAR then
                        scar()
                end
        end
        if (event == "M_RELEASED" and arg == 1) then
        targeting()
        end

        if (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then--ͷѹǹģ
                if (Holdbreathkey == 1 and macro) then
                        Holdbreathstart()
                end
                Stopclick()
        end
end

function Holdbreathstart()--Ϣʼģ
        --OutputLogMessage("Holdbreathstart\n")
        if(shift and macro and targetingkey == 0)then
                if(IsKeyLockOn("capslock") and fouron)then 
                        PressKey("lshift")
                        Holdbreathmode = 1
                        OutputLogMessage("Holdbreath=%d\n",Holdbreathmode)
                elseif(IsKeyLockOn("numlock") and twoon)then 
                        PressKey("lshift")
                        Holdbreathmode = 1
                        OutputLogMessage("Holdbreath=%d\n",Holdbreathmode)
                end
        end
end

function Holdbreathstop()--Ϣֹͣģ
        if(shift and macro and targetingkey == 0 and Holdbreathmode == 1)then
                if(IsKeyLockOn("capslock") and fouron)then 
                        ReleaseKey("lshift")
                        Holdbreathmode = 0
                        OutputLogMessage("Holdbreath=%d\n",Holdbreathmode)
                elseif(IsKeyLockOn("numlock") and twoon)then 
                        ReleaseKey("lshift")
                        Holdbreathmode = 0
                        OutputLogMessage("Holdbreath=%d\n",Holdbreathmode)
                end
        end
end

function fluttering()--ɡģ
        --OutputLogMessage("%d\n",shotTime)
        if shotTime%39 == 0 then
        PressKey("w")
        elseif shotTime%39 == 23 then
        ReleaseKey("w")
        elseif shotTime%39 == 25 then
        ReleaseKey("w")
        end
        shotTime = shotTime + 1
        Sleep(100)
        if click == 0 then
                ReleaseKey("w")
                Stopclick()
        elseif click == 1 then SetMKeyState(2)
        end
end

function ax4(x)--4ģ
MoveMouseRelative(0, x/4)
Sleep(10)
MoveMouseRelative(0, x/4)
Sleep(10)
MoveMouseRelative(0, x/4)
Sleep(10)
MoveMouseRelative(0, x/4)
Sleep(10)
MoveMouseRelative(0, x%4)
click = 0
end


function reloading(x)--Զģ
        if auto_reloading then
                --OutputLogMessage("%d\n",x)
                if IsM16 then
                        needreloadingtime = 3000
                end
                if IsAK then
                        needreloadingtime = 4000
                end
                if IsM4 then
                        needreloadingtime = 4000
                end
                if IsSCAR then
                        needreloadingtime = 3840
                end
                if IsMINI then
                        needreloadingtime = 3000
                end
                if IsUMP9 then
                        needreloadingtime = 3680
                end
                if IsUZI then
                        needreloadingtime = 1680
                end
                if x > needreloadingtime then
                        PressAndReleaseKey("r")
                        OutputLogMessage("reloading\n")
                        Sleep(100)
                        Stopclick()
                end
        end
end

function m16()
        PressAndReleaseMouseButton(1)
        if (IsKeyLockOn("capslock") and fouron) then
                MoveMouseRelative(0,m16of4[i]*l)
                i=i+1
                if (i>#m16of4) then
                        i=#m16of4
                end
        elseif (IsKeyLockOn("numlock") and twoon) then
                MoveMouseRelative(0,m16of2[i]*l)
                i=i+1
                if (i>#m16of2) then
                        i=#m16of2
                end
        else
                if(IsModifierPressed("lshift"))then
                        MoveMouseRelative(0,m16of15[i]*l)
                        i=i+1
                        if (i>#m16of15) then
                                i=#m16of15
                        end
                else
                        MoveMouseRelative(0,m16of1[i]*l)
                        i=i+1
                        if (i>#m16of1) then
                                i=#m16of1
                        end
                end
        end
        if (i-1) == stop_key_m16 then
                Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)

        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end


function akm()
        PressAndReleaseMouseButton(1)
        if (IsKeyLockOn("capslock") and fouron) then
                MoveMouseRelative(0,akmof4[i]*l)
                i=i+1
                if (i>#akmof4) then
                        i=#akmof4
                end
        elseif (IsKeyLockOn("numlock") and twoon) then
                MoveMouseRelative(0,akmof2[i]*l)
                i=i+1
                if (i>#akmof2) then
                        i=#akmof2
                end
        else
                if(IsModifierPressed("lshift"))then
                        MoveMouseRelative(0,akmof15[i]*l)
                        i=i+1
                        if (i>#akmof15) then
                                i=#akmof15
                        end
                else
                        MoveMouseRelative(0,akmof1[i]*l)
                        i=i+1
                        if (i>#akmof1) then
                                i=#akmof1
                        end
                end
        end  
        if (i-1) == stop_key_akm then
                Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)

        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end


function m4()
        PressAndReleaseMouseButton(1)
        if (IsKeyLockOn("capslock") and fouron) then
                MoveMouseRelative(0,m4of4[i]*l)
                i=i+1
                if (i>#m4of4) then
                        i=#m4of4
                end
        elseif (IsKeyLockOn("numlock") and twoon) then
                MoveMouseRelative(0,m4of2[i]*l)
                i=i+1
                if (i>#m4of2) then
                        i=#m4of2
                end
        else
                if(IsModifierPressed("lshift"))then
                        MoveMouseRelative(0,m4of15[i]*l)
                        i=i+1
                        if (i>#m4of15) then
                                i=#m4of15
                        end
                else
                        MoveMouseRelative(0,m4of1[i]*l)
                        i=i+1
                        if (i>#m4of1) then
                                i=#m4of1
                        end
                end
        end  
        if (i-1) == stop_key_m4 then
                Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)

        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end



function uzi()
        PressAndReleaseMouseButton(1)
        if(IsModifierPressed("lshift"))then
                MoveMouseRelative(0,uziof15[i]*l)
                i=i+1
                if (i>#uziof15) then
                        i=#uziof15
                end
        else
                MoveMouseRelative(0,uziof1[i]*l)
                i=i+1
                if (i>#uziof1) then
                        i=#uziof1
                end
        end
        if (i-1) == stop_key_uzi then
                Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)
        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end


function ump9()
        PressAndReleaseMouseButton(1)
        if (IsKeyLockOn("capslock") and fouron) then
                MoveMouseRelative(0,ump9of4[i]*l)
                i=i+1
                if (i>#ump9of4) then
                        i=#ump9of4
                end
        elseif (IsKeyLockOn("numlock") and twoon) then
                MoveMouseRelative(0,ump9of2[i]*l)
                i=i+1
                if (i>#ump9of2) then
                        i=#ump9of2
                end
        else
                if(IsModifierPressed("lshift"))then
                        MoveMouseRelative(0,ump9of15[i]*l)
                        i=i+1
                        if (i>#ump9of15) then
                                i=#ump9of15
                end
                else
                        MoveMouseRelative(0,ump9of1[i]*l)
                        i=i+1
                        if (i>#ump9of1) then
                                i=#ump9of1
                        end
                end
        end  
        if (i-1) == stop_key_ump9 then
                Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)

        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end


function scar()
        PressAndReleaseMouseButton(1)
        if (IsKeyLockOn("capslock") and fouron) then
                MoveMouseRelative(0,scarof4[i]*l)
                i=i+1
                if (i>#scarof4) then
                        i=#scarof4
                end
        elseif (IsKeyLockOn("numlock") and twoon) then
                MoveMouseRelative(0,scarof2[i]*l)
                i=i+1
                if (i>#scarof2) then
                        i=#scarof2
                end
        else
                if(IsModifierPressed("lshift"))then
                        MoveMouseRelative(0,scarof15[i]*l)
                        i=i+1
                        if (i>#scarof15) then
                                i=#scarof15
                        end
                else
                        MoveMouseRelative(0,scarof1[i]*l)
                        i=i+1
                        if (i>#scarof1) then
                                i=#scarof1
                        end
                end
        end  
        if (i-1) == stop_key_scar then
        Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)

        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end



function mini()
        PressAndReleaseMouseButton(1)
        if (IsKeyLockOn("capslock") and fouron) then
                MoveMouseRelative(0,miniof4[i]*l)
                i=i+1
                if (i>#miniof4) then
                        i=#miniof4
                end
        elseif (IsKeyLockOn("numlock") and twoon) then
                MoveMouseRelative(0,miniof2[i]*l)
                i=i+1
                if (i>#miniof2) then
                        i=#miniof2
                end
        else
                if(IsModifierPressed("lshift"))then
                        MoveMouseRelative(0,miniof15[i]*l)
                        i=i+1
                        if (i>#miniof15) then
                                i=#miniof15
                        end
                else
                        MoveMouseRelative(0,miniof1[i]*l)
                        i=i+1
                        if (i>#miniof1) then
                        i=#miniof1
                        end
                end
        end  
        if (i-1) == stop_key_mini then
                Stopclick()
        end
        PressMouseButton(1)
        Sleep(30)
        shotTime=shotTime+30
        ReleaseMouseButton(1)
        reloading(shotTime)

        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(3)
        end
end


function targeting()--ģ
        PressAndReleaseMouseButton(1)
        Sleep(7)
        MoveMouseRelative(0, 2)
        if click == 0 then
                Stopclick()
        elseif click == 1 then SetMKeyState(1)
        end   
end

function Stopclick()--ֹͣģ
        click = 0
        shotTime = 0
        i = 1
end

function Release()--ģ
        Stopclick()
        ReleaseKey("lshift")
        ReleaseMouseButton(1)
end

function scr()--ģ
        if macro and not IsKeyLockOn("scrolllock") then
                PressAndReleaseKey("scrolllock")
        end
        if not macro and IsKeyLockOn("scrolllock") then
                PressAndReleaseKey("scrolllock")
        end
end