Sign in to follow this  
Followers 0
Rex

How to lover cpu usage ?

3 posts in this topic

Yo i'd made a wery litle script, for one of my frinds who likes to see porno on the internet.

The script i did is desigend to auto close some autoInstall popups.

The script work sofar ok, but it uses a lot of cpu power course i da my checks in a while 1.

My problem is now that i have seen me blinde on how to lover the cpu usage :whistle:

Please some one give me a hint...

Opt("GUIOnEventMode", 1)       ;0=disabled, 1=OnEvent mode enabled
Opt("RunErrorsFatal", 0)       ;1=fatal, 0=silent set @error
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode",1)

$exit = TrayCreateItem("Exit")
TrayItemsetOnEvent(-1,"Off")
TraySetState()
TraySetIcon("shell32.dll", 65)

While 1
    If WinExists("Advarsel",'Vil du installere og køre') Then; #32770
WinActivate("Advarsel",'Vil du installere og køre')
; Send("!N")
WinKill("Advarsel",'Vil du installere og køre')
EndIf
If WinExists("Microsoft Internet Explorer",'You must click YES') Then
    WinActivate("Microsoft Internet Explorer",'You must click YES')
    WinKill("Microsoft Internet Explorer",'You must click YES')
    WinClose("Microsoft Internet Explorer",'You must click YES')
;Send("{ENTER}")
    EndIf
WEnd

Func Off()
Exit
EndFunc

Share this post


Link to post
Share on other sites



If you still find the CPU usage to be high then try a larger number like Sleep(100). People have been discussing elsewhere that small Sleep() values don't lower CPU usage.

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  
Followers 0