Using if while multiple conditions need to be met
Posted: 19 Nov 2017, 03:29
My code works fine but it's super redundant. I need to meet two conditions (A = Window AND B = Image to File) to take a screenshot, or it will do several clicks to meet the 2 conditions. The following is a simplified version of my code:
Is there a way to simplify this? Two conditions are already pretty time-consuming for me to write the code in that fashion, but I might run into situations requiring more than that. I really appreciate anyone who can help.
Code: Select all
if A = Window
{
if B= Image to File
{
Take the screenshot
}
else
{
Several clicks to make B= Image to File
Sleep, 100
Take the screenshot
}
}
else
{
Several clicks to make A = Window
if B= Image to File
{
Take the screenshot
}
else
{
Several clicks to make B= Image to File
Sleep, 100
Take the screenshot
}
}