Jump to content

Recommended Posts

Posted

Hello ,

I want to learn something.

This If funtion here wait for the CPU and sleeps till it is below desired range.

I want to make that check on every mouseclick down there. Is there a shorter way than writing this IF every time ?

ControlClick("\\himini-svr-01\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "StdBtn25")
Sleep(2000)

;~ ; successful? Then enter loop

If @error=0 And IsArray($poCounter) Then
    $iCounterValue=Round(_PDH_ProcessObjectUpdateCounters($poCounter,0)/$_PDH_iCPUCount)
    Do
        Sleep(200)
        $iCounterValue=_PDH_ProcessObjectUpdateCounters($poCounter,0)
        If @error=32 Then ExitLoop      ; Process can no longer be found
        $iCounterValue=Round($iCounterValue/$_PDH_iCPUCount)
            If $iCounterValue > 30 Then
                Sleep (100)
            EndIf
    Until $iCounterValue = 0
EndIf

ControlClick("\\himini-svr-01\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "StdBtn1")
Sleep (2000)

MouseClickDrag("left", 74, 469, 329,885)    
MouseClickDrag("left", 69, 357, 367,885)
MouseClickDrag("left", 77, 374, 407,885,0)  
MouseClickDrag("left", 75, 759, 476,885)    
MouseClickDrag("left", 71, 583, 545,885)    
MouseClickDrag("left", 78, 598, 614,885)    
MouseClickDrag("left", 72, 565, 673,885)    
MouseClickDrag("left", 74, 678, 329,885)    
MouseClickDrag("left", 74, 900, 237,900)    
MouseClickDrag("left", 74, 726, 276,900)    
MouseClickDrag("left", 74, 934, 317,900)    
MouseClickDrag("left", 74, 438, 370,900)
Posted

Hi alfa,

you could write a function for that.

Func _sleepUntilXX()
    $iCounterValue=Round(_PDH_ProcessObjectUpdateCounters($poCounter,0)/$_PDH_iCPUCount)
    Do
        Sleep(200)
        $iCounterValue=_PDH_ProcessObjectUpdateCounters($poCounter,0)
        If @error=32 Then ExitLoop      ; Process can no longer be found
        $iCounterValue=Round($iCounterValue/$_PDH_iCPUCount)
            If $iCounterValue > 30 Then
                Sleep (100)
            EndIf
    Until $iCounterValue = 0
  EndIf
Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Posted

Hi :huh2:

Thanks for the answer ;)

But i dont know how to recall it between those mouse cliks ?

MouseClickDrag("left", 74, 469, 329,885)

MouseClickDrag("left", 69, 357, 367,885)

MouseClickDrag("left", 77, 374, 407,885,0)

MouseClickDrag("left", 75, 759, 476,885)

How should i insert it between ?

Posted

How 'bout sth like:

MouseClick(xxxx)
_SleepUntilXX()
MouseClick(xxxx)

:huh2:

Please consider reading the help file article under "Language Reference" => Functions. ;)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Posted

I did.

I only ask here after i read through help file.

It is most likely that i dont understant them :huh2:

thanks for answer again.

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
×
×
  • Create New...