Jump to content

Recommended Posts

Posted (edited)

First Question: ( Concerns CPU Usage as this is the most important. )

WHY does my script force FireFox to use 98+ CPU usage? ( I include the script at the bottom of this post. ) How do I fix this?

Second Question: ( Concerns Compatibility: This script won't work on another PC. )

ControlClick - This is the command that won't work.

It's clicking SOMETHING on his computer , because if you rightclick , to bring up that menu , it disapears proving SOMETHINGS been clicked. Just not what we wanted.

I have tried everything I can possibly think of , making SURE the coordinates were right. Etc. It just seems his computer IGNORES controlclicking ... because If I use those coords with a regular MouseClick , its all fine.

Third Question: ( Concerns a person inquiry of mine. )

WHY are the coordinates given to me on the Mouse tab of the autoit window tool Different then those given in the Controls tab?

Script:

HotKeySet( "!d", "_PSelf")
HotKeySet( "!s", "_Test")
HotKeySet( "!e", "_Exit")

Global $Sleep, $Paused, $Pixel, $InputTitle, $class

$InputTitle = InputBox( "Title", "What is the title you want?")


While 1
    Sleep( 5000 )
WEnd

Func _PSelf()
    _Class()
    _ChangeTitle()
    ControlClick( $inputtitle, "", $class, "left", 1, 776, 98);I DON'T KNOW IF THIS ONE WORKS OR NOT , I DON'T CARE ABOUT THIS ONE.
    $Paused = NOT $Paused
    $Sleep = Inputbox( "Wait", "How often should it go? ( In seconds. ) I suggest between 3-5 seconds.", 5)
    $Sleep = $Sleep * 1000
    While $Paused
    Sleep( $Sleep )
    ControlClick( $InputTitle, "", $class, "left", 1, 186, 212 ); THIS IS THE CONTROLCLICK I'M REFERRING TO.
    WEnd
EndFunc

Func _Test()
_Class()
MsgBox( 0, "sdfg", "Class = "&$class)
EndFunc

Func _ChangeTitle()
    WinSetTitle( "[active]", "", $inputtitle)
EndFunc

Func _Class()
$Class = ControlGetFocus("[active]")
EndFunc

Func _Exit()
    Exit
EndFunc

I apologize for CAPS , lack of information , or if anyone finds this post hostile. I'm just really frustrated as this script works GREAT on my computer , but fails to do so on my friends. If anyone has any ideas , suggestions , or even solutions I GREATLY appreciate it.

Thank you for your time and any help.

God Bless,

*Drew

Edited by Drew
Posted

Second Question: ( Concerns Compatibility: This script won't work on another PC. )

What OS is your friend using?

tolle indicium

Posted

Coordinates are likely to be different on another PC. Why not just omit the coordinates

ControlClick( $InputTitle, "", $class);default to left button, one click in centre

or use ControlGetPos to find the coordinates relative to WinGetPos

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

i have very similair problem

this

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

[code=auto:0]

is standart way of looping an gui,from help and so on..but it eats 100% of my CPU

is there any other way how to loop an gui?

thanks a lot

Posted

GUIGetMsg() doesn't actually use 100% of your CPU. Jon explained this in a post before which I cannot find. If any other process requests CPU time, the CPU usage will of your script will drop considerably.

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...