Jump to content
Sign in to follow this  
d0n

getting % with pixelsearch + progress bar help

Recommended Posts

d0n

Hi i have something here that works but is there a way to get a more accurate, like by 1% not 10%?

Func HP()
    $0 = Hex(PixelGetColor(55,75,$handle),6)
    $10 = Hex(PixelGetColor(65,75,$handle),6)
    $20 = Hex(PixelGetColor(76,75,$handle),6)
    $30 = Hex(PixelGetColor(87,75,$handle),6)
    $40 = Hex(PixelGetColor(98,75,$handle),6)
    $50 = Hex(PixelGetColor(109,75,$handle),6)
    $60 = Hex(PixelGetColor(120,75,$handle),6)
    $70 = Hex(PixelGetColor(130,75,$handle),6)
    $80 = Hex(PixelGetColor(140,75,$handle),6)
    $90 = Hex(PixelGetColor(150,75,$handle),6)
    $100 = Hex(PixelGetColor(161,75,$handle),6)
    If $100 = "FF0000" Then
        GUICtrlSetData($Progress, "100%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $90 = "FF0000" Then
        GUICtrlSetData($Progress, "90%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $80 = "FF0000" Then
        GUICtrlSetData($Progress, "80%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $70 = "FF0000" Then
        GUICtrlSetData($Progress, "70%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $60 = "FF0000" Then
        GUICtrlSetData($Progress, "60%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $50 = "FF0000" Then
        GUICtrlSetData($Progress, "50%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $40 = "FF0000" Then
        GUICtrlSetData($Progress, "40%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $30 = "FF0000" Then
        GUICtrlSetData($Progress, "30%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $20 = "FF0000" Then
        GUICtrlSetData($Progress, "20%")
        GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    Elseif $10 = "FF0000" Then
        GUICtrlSetData($Progress, "10%")
        GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    Elseif $0 = "FF0000" Then
        GUICtrlSetData($Progress, "1%")
        GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    EndIf
EndFunc

Share this post


Link to post
Share on other sites
GodlessSinner

$handle = WinActivate("");modify it
HP($handle)

Func HP($handle)
    $0 = Hex(PixelGetColor(55,75,$handle),6)
    $10 = Hex(PixelGetColor(65,75,$handle),6)
    $20 = Hex(PixelGetColor(76,75,$handle),6)
    $30 = Hex(PixelGetColor(87,75,$handle),6)
    $40 = Hex(PixelGetColor(98,75,$handle),6)
    $50 = Hex(PixelGetColor(109,75,$handle),6)
    $60 = Hex(PixelGetColor(120,75,$handle),6)
    $70 = Hex(PixelGetColor(130,75,$handle),6)
    $80 = Hex(PixelGetColor(140,75,$handle),6)
    $90 = Hex(PixelGetColor(150,75,$handle),6)
    $100 = Hex(PixelGetColor(161,75,$handle),6)
        For $i = 0 To 100 Step 10
        If $i = "FF0000" Then
            GUICtrlSetData($Progress, $i)
            GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
        EndIf   
        Next
EndFunc

Edited by Vitas

_____________________________________________________________________________

Share this post


Link to post
Share on other sites
d0n

thank you

Share this post


Link to post
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
Sign in to follow this  

×