Jump to content

Is This A Bug?


Recommended Posts

So i decided to create a script that changes the GUI background color. It seems to work they way I want it to until it starts the sixth loop. Then the GUI turns regular default theme color (which is grey for me). At this point if you interact with the GUI(minimize, maximize, restore) it becomes unresponsive and freezes. Is this a bug, my script, or just my machine? I think it might be a bug but i wanted some input before reporting it as a bug in the bugs forum.

Info:

This script was run using v3.1.1.118 (beta) which produced the problem.

#include <GUIConstants.au3>
; == GUI generated with Koda ==
Global $MainForm 
$MainForm = GUICreate("Color Test", 520, 322, 192, 125)
GUISetState(@SW_SHOW)
Dim $iRedVal, $iGreenVal,$iBlueVal
$iGreenVal = 0
$iBlueVal = 0
$iRedVal = 0
Dim $introundcounter = 0
;Put Everything that you would normally put in your While loop for the GUI in this WhileLoopFunction()
Func WhileLoopFunction()
        $msg = GuiGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case Else
            ;;;;;;;
        EndSelect
EndFunc

;Code from here down does the color changing, This causes the GUI to freeze at the beginning of the sixth loop
While 1
    $introundcounter = $introundcounter + 1
    For $iRedVal = 0 To 254
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)  
    Next
    For $iGreenVal= 0 To 254
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)  
    Next
    For $iRedVal = 254 To 1 Step -1
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)  
    Next
    For $iBlueVal = 0 To 254
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)   
    Next
        For $iGreenVal= 254 To 1 Step -1
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)  
    Next
    For $iRedVal = 0 To 254
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)  
    Next
    For  $iGreenVal = 0 To 254
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2) )
        GUISetBkColor("0x" & Hex ( $iRedVal ,2 ) & Hex ( $iGreenVal ,2 ) & Hex($iBlueVal,2),$MainForm)  
    Next
    For  $iAllColors = 254 To 1 Step -1
        WhileLoopFunction()
        ConsoleWrite(@CRLF & "0x" & Hex ( $iAllColors ,2 ) & Hex ( $iAllColors ,2 ) & Hex($iAllColors,2) )
        GUISetBkColor("0x" & Hex ( $iAllColors ,2 ) & Hex ( $iAllColors ,2 ) & Hex($iAllColors,2),$MainForm)    
    Next
    $iGreenVal = 0
    $iBlueVal = 0
    $iRedVal = 0
    ConsoleWrite(@CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "================================================= While Loop " & $introundcounter)
WEnd

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Yeah, but i don't think it is a bug with my script. My script works fine for the first five loops. I think it might be something with the actual AutoIt engine. You know how those bugs are, they just love to pick random intervals and sequences to suddenly appear.

NOTE: When it takes over the screen, the easiest way i found to end the script was to press the Esc key.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

I shortened it a bunch, and it freaks out at a little less than the 10000th background change.

HotKeySet ("{ESC}", "quitme")

#include <GUIConstants.au3>

Global $MainForm = GUICreate("Color Test", 520, 322, 192, 125)
GUISetState(@SW_SHOW)
Global $introundcounter = 0

While 1
    GUISetBkColor ($introundcounter, $MainForm)
    $introundcounter += 1
    TrayTip ("color", $introundcounter, 1)
WEnd

Func quitme()
    Exit
EndFunc

Pressing esc is good for GUIs, and I always have that hotkey func anyway, so I'm safe.

Link to comment
Share on other sites

Yup, that proves it. It must be a bug in the AutoIt Engine. It must freak out after a certain number of background changes. I am going to post this bug in the bugs forum. Thanks for the help greenmachine. :think:

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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