Jump to content

Loop_ If then Elseif


Recommended Posts

i have had this problem befor and dont remember the solution...

only the last 3 if statments work...

i know its a simmple fix... i just dont remember...

#Include <Misc.au3>
HotKeySet("!{ESC}", "Terminate")
HotKeySet("{END}", "test")

$left = 640
$top = 514
$right = 640
$bottem = 512
$fov = 0
$dll = DllOpen("user32.dll")
$terrorB = "0xFF00F7"
$terrorD = "0x63005A"
$CtB = "0x00FBEF"
$CtD = "0x00827B"
$key = "01"
While 1

    If _IsPressed("39", $dll) Then ; 9
        $ColorB = $terrorB; "0xFF00F7" ; bright pink
        $ColorD = $terrorD; "0x63005A" ; dark pink
        Sleep(500)
    ElseIf _IsPressed("30", $dll) Then; 0
        $ColorB = $CtB; "0x00FBEF"  ; bright teal
        $ColorD = $CtD; "0x00827B"  ; dark teal
        Sleep(500)
    ElseIf _IsPressed("2D", $dll) Then; Insert
        ToolTip("assalt - Rifles, Mouse 1", 450, 0)
        ToolTip("assalt - Rifles, Mouse 1", 450, 0)
        $terrorB = "0xFF00F7";
        $terrorD = "0x63005A";
        $CtB = "0x00FBEF";
        $CtD = "0x00827B";
        $key = "01"
        Sleep(500)
    ElseIf _IsPressed("2E", $dll) Then; Delete
        ToolTip("Awp - Power, Shift Key", 450, 0)
        ToolTip("Awp - Power, Shift Key", 450, 0)
        $terrorB = "0xCE0000"
        $terrorD = "0x7B0000"
        $CtB = "0x0000CE"
        $CtD = "0x00006B"
        $key = "10"
        Sleep(500)

    ElseIf _IsPressed("26", $dll) Then
        $left = $left - 1
        $top = $top - 1
        $right = $right + 1
        $bottem = $bottem + 1
        $fov = $fov + 1
        ToolTip("fov turned up" & "'" & $fov & "'", 450, 0)
        ToolTip("fov turned up" & "'" & $fov & "'", 450, 0)
        Sleep(100)
    ElseIf _IsPressed("28", $dll) Then
        $left = $left + 1
        $top = $top + 1
        $right = $right - 1
        $bottem = $bottem - 1
        $fov = $fov - 1
        ToolTip("fov turned Down" & "'" & $fov & "'", 450, 0)
        ToolTip("fov turned Down" & "'" & $fov & "'", 450, 0)
        Sleep(100)
    ElseIf _IsPressed($key, $dll) Then
        MsgBox(0, "popo", "o")
        ;$key = "01"
        If WinActive("Counter-Strike") Then
            $Pos = PixelSearch($left, $top, $right, $bottem, $ColorB, 100, 1)
            If IsArray($Pos) Then
                MouseMove($Pos[0], $Pos[1], 0)
                Send("{ENTER}")
                Send("{PGDN}")
                Sleep(20)
            Else
                $Pos = PixelSearch($left, $top, $right, $bottem, $ColorD, 25, 1)
                If IsArray($Pos) Then
                    MouseMove($Pos[0], $Pos[1], 0)
                    Send("{ENTER}")
                    Send("{PGDN}")
                    Sleep(20)
                    
                EndIf
            EndIf
        EndIf
    EndIf
    



    Sleep(100)


WEnd

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate
DllClose($dll)

Func test()
    MouseMove($left, $top, 5)
    
    
    MouseMove($left, $bottem, 5)
    Sleep(100)
    MouseMove($right, $top, 5)
    Sleep(100)
    MouseMove($right, $bottem, 5)
    Sleep(100)
EndFunc   ;==>test
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...