Jump to content
Sign in to follow this  
Valuater

New set of Eyes ...please

Recommended Posts

Valuater

I just cant find it... probably something dumb...... and I will have to pay the price of ridicule... :mellow:

Any ways.... NO CLICKING... needed

1 Place your mouse over "Auto Click" it will turn green - On

2 Place your mouse over "Auto Move" ( no clicking) it will turn green

... you can move the GUI for 4 seconds

3 Place your mouse over "Auto Click" it will turn Blue - Off

... now comes the problem, "Auto Move" will be activated (turn green) ...why?????

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

Global $Hover = 0, $Pause = 200

$Main = GUICreate("T-90", 330, 180, -1, -1, $WS_POPUP)
$exit = GUICtrlCreateLabel("EXIT", 295, 4, 25, 12)

$AutoClick = GUICtrlCreateLabel(" AUTO_CLICK", 99, 3, 70, 14)
GUICtrlSetBkColor(-1, 0x4876FF)
$AutoMove = GUICtrlCreateLabel(" AUTO_MOVE", 199, 3, 70, 14, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0x4876FF)
GUISetState()

While 1
    
    If $Hover Then
        Sleep($Pause * 10)
        ToolTip("")
        $inf = GUIGetCursorInfo($Main)
        $msg = $inf[4]
    Else
        $msg = GUIGetMsg()
        $inf = GUIGetCursorInfo($Main)
        If $inf[4] = $AutoClick Then $msg = $AutoClick
    EndIf
    
    Switch $msg
        Case $exit, -3
            Exit
        Case $AutoClick
            If $Hover = 0 Then
                $Hover = 1
                GUICtrlSetBkColor($AutoClick, 0x00ff00) ; Green
            Else
                $Hover = 0
                GUICtrlSetBkColor($AutoClick, 0x4876FF) ;FF0000) ; red
                Sleep(1000)
                ;ContinueLoop
            EndIf
        Case $AutoMove
            GUICtrlSetBkColor($AutoMove, 0x00ff00) ; Green
            $info = 'If MouseDown(""left"") And Sleep(' & $Pause * 20 & ') And MouseUp(""left"") = 1 Then Exit'
            RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"')
            GUICtrlSetBkColor($AutoMove, 0x4876FF) ;FF0000) ; red
            Sleep(1000)
    EndSwitch
    
WEnd

thx

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
ResNullius

It's definitely related to the code executed by

RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"')
just can't figure out why yet.

Share this post


Link to post
Share on other sites
Valuater

It's definitely related to the code executed by

RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"')
just can't figure out why yet.
But, the strange part is "Case $AutoMove" shouldn't even receive a message!!!...???

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
rover

Hi Valuater

not the first time I've seen glitchiness from GuiGetMsg()

if I disabled a button just after pressing it, that caused problems with GuiGetMsg()

(I recall that the problem has since been fixed)

Case $AutoMove
            Opt("GUIOnEventMode", 1) 
            GUICtrlSetBkColor($AutoMove, 0x00ff00) ; Green
            $info = 'If MouseDown(""left"") And Sleep(' & $Pause * 20 & ') And MouseUp(""left"") = 1 Then Exit'
            RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"', @ScriptDir, @SW_HIDE)
            Opt("GUIOnEventMode", 0) 
            GUICtrlSetBkColor($AutoMove, 0x4876FF) ;FF0000) ; red
            Sleep(1000)

I see fascists...

Share this post


Link to post
Share on other sites
Valuater

Hi Valuater

not the first time I've seen glitchiness from GuiGetMsg()

if I disabled a button just after pressing it, that caused problems with GuiGetMsg()

(I recall that the problem has since been fixed)

Case $AutoMove
            Opt("GUIOnEventMode", 1) 
            GUICtrlSetBkColor($AutoMove, 0x00ff00) ; Green
            $info = 'If MouseDown(""left"") And Sleep(' & $Pause * 20 & ') And MouseUp(""left"") = 1 Then Exit'
            RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"', @ScriptDir, @SW_HIDE)
            Opt("GUIOnEventMode", 0) 
            GUICtrlSetBkColor($AutoMove, 0x4876FF) ;FF0000) ; red
            Sleep(1000)
Cool!

Ya know, I'm not the kind guy who needs to know "why". But with this add-on you gave me, I can just move forward... Thanks

For the dev's maybe you might want to look into this...

thx

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
rover

Cool!

Ya know, I'm not the kind guy who needs to know "why". But with this add-on you gave me, I can just move forward... Thanks

For the dev's maybe you might want to look into this...

thx

8)

no problem

turning on and off the message polling resets GuiGetMsg()

to eliminate the message bounce.

I don't know why that happens

but I have experienced it before in v3.2.8.1

Edit: poor wording corrected

Edited by rover

I see fascists...

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.