Jump to content

High CPU usage


acidfear
 Share

Recommended Posts

Not sure if my last post went through on this subject because the site timed out, and I haven't found it yet if it did.

Basically I made a working pixelsearch aimbot for condition zero from code I used on someones aimbot. I forgot the name. Sunical or something. Anyway, it runs fine but the problem is it uses 99% of my CPU. I changed the settings for pixelsearch to 2 to scan every other ppixel, but it still runs a lot of cpu usage.

Are there ways of getting it down?

Thanks.

Link to comment
Share on other sites

Don't the game screen change constantly?

If it does not you could do the obvious sleep(10).

Othervice you have to show your algorithm.

Or even better, search the forum as this topic is comming up like every week :P

Link to comment
Share on other sites

I have been searching the forums.

Heres my code:

#Include <Misc.au3>

HotKeySet("p","stop")

while 1
    


$searchcolor = 0xD0272E


sleep(2000)
$found = "no"


    If $found = "no" Then
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 50) , ($pos[1] - 50) , ($pos[0] + 50) , ($pos[1] + 50), $searchcolor,3,2) ; initial search area 50sq'pixels
                If IsArray($coord) = 1 and _ispressed(01) = 1 Then
                    Mousemove( $coord[0], $coord[1],0)
                    $found = "yes"
            EndIf
        EndIf   
        
            If $found = "yes" Then
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 10) , ($pos[1] + 10), $searchcolor,3,2) ; locked on search area 10sq'pixels
                    If IsArray($coord) = 1  and _ispressed(01) = 1 Then
                            Mousemove( $coord[0], $coord[1],0)
                        
                Else
                    $found = "no"
                EndIf
            EndIf
            
        WEnd
        
        
        
        
        func stop()
    
    exit
EndFunc
Edited by acidfear
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...