Ticket #315: shitty.au3

File shitty.au3, 2.3 KB (added by furroy@…, 16 years ago)

Repro code & workaround

Line 
1#include <GUIConstants.au3>
2#include <WindowsConstants.au3>
3#include <ButtonConstants.au3>
4#include <Color.au3>
5
6Global $g_szVersion = "Debug Window"
7If WinExists($g_szVersion) Then Exit ; It's already running
8AutoItWinSetTitle($g_szVersion)
9
10Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
11
12
13Local $console = GuiCreate("Debug Console", 200, 400, 50, 50, "", $WS_EX_TOPMOST)
14;
15; if you move the button code here, it will work
16;
17Local $stateLabel = GuiCtrlCreateLabel("AI: ", 0, 0, 200, 20)
18Local $loadLabel = GuiCtrlCreateLabel("Load: ", 0, 20, 100, 20)
19Local $foodLabel = GuiCtrlCreateLabel("Food: ", 100, 20, 100, 20)
20Local $healthLabel = GuiCtrlCreateLabel("Health: 0%", 0, 40, 100, 20)
21Local $arouseLabel = GuiCtrlCreateLabel("Arouse: 0%", 100, 40, 100, 20)
22Local $manaLabel = GuiCtrlCreateLabel("Mana: 0%", 0, 60, 100, 20)
23Local $painLabel = GuiCtrlCreateLabel("Pain: 0%", 100, 60, 100, 20)
24Local $killsLabel = GuiCtrlCreateLabel("Kills: 0", 0, 80, 60, 20)
25Local $fleesLabel = GuiCtrlCreateLabel("Flees: 0", 60, 80, 60, 20)
26Local $deathsLabel = GuiCtrlCreateLabel("Deaths: 0", 120, 80, 60, 20)
27Local $xpLabel = GuiCtrlCreateLabel("XP: 0", 0, 100, 200, 20)
28Local $cashLabel = GuiCtrlCreateLabel("$$: 0", 0, 120, 200, 20)
29Local $roomsLabel = GuiCtrlCreateLabel("Rooms: 0", 0, 140, 200, 20)
30Local $idleLabel = GuiCtrlCreateLabel("Idle: off", 100, 140, 200, 20)
31Local $timeLabel = GuiCtrlCreateLabel("Run Time: 0 hours", 0, 160, 200, 20)
32Local $selectLabel = GuiCtrlCreateLabel("Select: ", 0, 180, 200, 20)
33Local $destLabel = GuiCtrlCreateLabel("Dest: ", 0, 200, 200, 20)
34Local $stepsLabel = GuiCtrlCreateLabel("Steps: ", 0, 220, 200, 20)
35Local $dpsInLabel = GuiCtrlCreateLabel("DPS IN: ", 0, 240, 200, 20)
36Local $equipLabel = GuiCtrlCreateLabel("Equip: ", 0, 260, 200, 20)
37Local $plantLabel = GuiCtrlCreateLabel("Plant: ", 0, 280, 200, 20)
38Local $npcLabel = GuiCtrlCreateLabel("NPCs: ", 0, 300, 200, 20)
39Local $deathLabel = GuiCtrlCreateLabel("Death: ", 0, 320, 200, 40)
40
41;
42; if the button is created down here it won't work
43;
44Local $rButton = GuiCtrlCreateButton("R", 100, 0, 20, 20)
45GUICtrlSetOnEvent($rButton, "BrokenButton")
46
47; end of code to move
48
49GUISetState(@SW_SHOW, $console)
50
51While 1
52        Sleep(1000)
53Wend
54
55Func BrokenButton()
56        Exit
57Endfunc   ;==>BrokenButton