You can use also a fixed int to make it just once by something like

static int A=0;
if (your conditions && A==0)

then when your conditions met the first time it will find the value of A=0 and it will give you an alert once and increase A to be 1 then when it checks again it will find A=1 so it will not alert again.