little help stuck in loop
Posted: 16 Jan 2022, 10:10
Hey ho! Long time i posted here.
Ive used some scripts from different people and tried to combine them but cant get it to work somehow.
I have a small GUI that indicates "ON" or "OFF" it looks really cool im happy with how it looks. but when i put my loop in the "ON" section it stays on "ON". It is stuck in its loop Any help?
Thanks!
Ive used some scripts from different people and tried to combine them but cant get it to work somehow.
I have a small GUI that indicates "ON" or "OFF" it looks really cool im happy with how it looks. but when i put my loop in the "ON" section it stays on "ON". It is stuck in its loop Any help?
Code: Select all
SoundPlay, audio\start.mp3
sleep 3000
#MaxThreadsPerHotkey 2
#warn
leftbound:= A_ScreenWidth/2-5
rightbound:= A_ScreenWidth/2+5
topbound:= A_ScreenHeight/2-5
bottombound:= A_ScreenHeight/2+5
Modified=20130110
Filename1=gui
setworkingdir,%a_scriptdir%
Gui,2:Font,Cdefault,Fixedsys
Gui,2:Color,Black
z:=""
Gui,2:Color, EEAA99
Gui,2:Add,Progress, x10 y20 w100 h23 Disabled BackgroundGreen vC2
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 vB2 gStart,ON
Gui,2:Add,Progress, xp yp wp hp Disabled BackgroundRED vC1
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 vB1 gStart,OFF
Gui,2: Show, x10 y1 w200 h60 ,%filename1%
Gui 2:+LastFound +ToolWindow +AlwaysOnTop
WinSet, TransColor, EEAA99
Gui,2:-Caption
return
~$F1::
start:
gui,2:submit,nohide
z:=!z
if z
{
GuiControl,2: hide,B1
GuiControl,2: hide,C1
GuiControl,2: show,B2
GuiControl,2: show,C2
loop
{
CoordMode, Pixel, Screen
PixelSearch, FoundX, FoundY, leftbound, topbound, rightbound, bottombound, 0xA145A3, 35, Fast RGB
If (ErrorLevel = 0){
Sleep 10
Click
}
}
}
else
{
GuiControl,2: hide,B2
GuiControl,2: hide,C2
GuiControl,2: show,B1
GuiControl,2: show,C1
}
return
F4::
ExitApp