Sign in to follow this  
Followers 0
MirnesC2

Close / Stope button isnt working

7 posts in this topic

#1 ·  Posted (edited)

I can't seem to figure out whats wrong, I tried moving it to a number of places and nothing worked. It's as if when ever it is spamming "hello world" its in its own world and ignores all the other code.

#include <GUIConstantsEx.au3>
$GUI = GUICreate("hello world", 150, 50)
$startbutton = GUICtrlCreateButton("Start", 8, 10, 60)
$stopbutton = GUICtrlCreateButton("Stop", 68, 10, 60)

GUISetState(@SW_SHOW)

Do
    $msg = GUIGetMsg()
    Select

    Case $msg = $startbutton
        Do
        Send("Hello world!")
        Until $msg = $stopbutton  
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

Another question separate from this one but in

GUISetBkColor(0x00E0FFFF)

The color, what format is that in? How can I find the code for other colors?

Edited by MirnesC2

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <GUIConstantsEx.au3>
$GUI = GUICreate("hello world", 150, 50)
$startbutton = GUICtrlCreateButton("Start", 8, 10, 60)
$stopbutton = GUICtrlCreateButton("Stop", 68, 10, 60)

GUISetState(@SW_SHOW)

Do
    $msg = GUIGetMsg()
    Select

    Case $msg = $startbutton        ;at this point $msg = startbutton
        Do              ;$msg = startbutton
        Send("Hello world!")        ;$msg = startbutton
        $msg = GUIGetMsg()      ;$msg will now = whatever you pressed
        Until $msg = $stopbutton  
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

The problem was that when it starts spamming $msg = $Startbutton. You have to get the msg again to see if the exit button was pressed.

GUISetBkColor(0xrrggbb) - it is in hex, red green blue. after a while, you get pretty good at guessing at it, or you could make a program with sliders for red, green, and blue to find colors (i could make one in my free time if you need). The autoit window tool can find colors on any window for you.

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

The color is a hexadecimal. you can use this chart for other colors Color Chart


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The color is a hexadecimal. you can use this chart for other colors Color Chart

'oly carp! Thats a lot of colors lol

*edit*

Here it is, the pretty color generator. accepts colors in "0xrrggbb" or just "rrggbb" format. I tried to keep it simple.

#include <GUIConstantsEx.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("OoOoOoO Pretty colors.,.,.,.", 309, 169, 225, 178)
$Sliderr = GUICtrlCreateSlider(152, 8, 150, 45)
GUICtrlSetLimit(-1, 255, 0)
$Sliderg = GUICtrlCreateSlider(152, 48, 150, 45)
GUICtrlSetLimit(-1, 255, 0)
$Sliderb = GUICtrlCreateSlider(152, 88, 150, 45)
GUICtrlSetLimit(-1, 255, 0)
$num = GUICtrlCreateInput("000000", 168, 136, 121, 21)
$Label1 = GUICtrlCreateLabel("", 8, 8, 140, 140)
GUICtrlSetBkColor($Label1,0x000000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

    $nMsg = GUIGetMsg()

While 1
    $nMsg = GUIGetMsg()

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit    
            
        Case $Sliderr
            refresh(1)
        Case $Sliderg
            refresh(1)
        Case $Sliderb
            refresh(1)
        Case $num
            refresh(2)
        
    EndSwitch
WEnd

Func refresh($toggle);are the sliders or the msgbox changeing
    If $toggle = 1 Then
        $color = "0x"
        $color &= Hex( GUICtrlRead($Sliderr) ,2)
        $color &= Hex( GUICtrlRead($Sliderg) ,2)
        $color &= Hex( GUICtrlRead($Sliderb) ,2)
        ConsoleWrite($color & @crlf)
        GUICtrlSetData($num,$color)
    Else
        If stringleft(GUICtrlRead($num),2) = "0x" Then
            $color = GUICtrlRead($num)
        Else
            $color = "0x" & GUICtrlRead($num)
        EndIf
                
        $red =  dec(StringLeft(StringRight($color,6),2))
            GUICtrlSetData($Sliderr, $red)
        $green =dec(StringLeft(StringRight($color,4),2))
            GUICtrlSetData($Sliderg, $green)
        $blue = dec(           (StringRight($color,2)))
            GUICtrlSetData($Sliderb, $blue)
        
        ConsoleWrite($color & @crlf & "red: " & $red & "    green: " & $green & "    blue: " & $blue & @CRLF)
    EndIf
    GUICtrlSetBkColor($Label1,$color)
EndFunc
Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
$GUI = GUICreate("hello world", 150, 50)
$startbutton = GUICtrlCreateButton("Start", 8, 10, 60)
$stopbutton = GUICtrlCreateButton("Stop", 68, 10, 60)

GUISetState(@SW_SHOW)

Do
    $msg = GUIGetMsg()
    Select

    Case $msg = $startbutton        ;at this point $msg = startbutton
        Do              ;$msg = startbutton
        Send("Hello world!")        ;$msg = startbutton
        $msg = GUIGetMsg()      ;$msg will now = whatever you pressed
        Until $msg = $stopbutton  
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

The problem was that when it starts spamming $msg = $Startbutton. You have to get the msg again to see if the exit button was pressed.

GUISetBkColor(0xrrggbb) - it is in hex, red green blue. after a while, you get pretty good at guessing at it, or you could make a program with sliders for red, green, and blue to find colors (i could make one in my free time if you need). The autoit window tool can find colors on any window for you.

Heh, I don't think I would have ever thought of that. Thanks, +1rep to all who replied.

Share this post


Link to post
Share on other sites

How do I send a double right click? I looked in help files and couldn't find anything

Share this post


Link to post
Share on other sites

How do I send a double right click? I looked in help files and couldn't find anything

There are a few ways.

MouseClick("right", "", "", 2, 50)

Or...

MouseClick("right")
Sleep(50)
MouseClick("right")

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