I have gone back to the start and started a fresh as the old sketch worked fine on a simulator, but when it came to the real thing it failed terribly 
The outcome I need is this.
Pins 4-5-6 power a bi-colour led to display L_M_H setting selected with pin 11 with a pull up
Pins 8-9-10 when HIGH trigger a l298n to send 12v to a set of relays this is controlled by pin 12
The boost pin 12 is triggered by remote control relay with pull ups attached, if this relay is open I do not want anything to happen, with the exception of allowing the L_M_H setting to be changed.
When the boost pin 12 is momentary triggered the required relays on pins 8-9-10 are set to HIGH and LOW as required.
The sketch below groups the Low Medium and High settings together and performs everything together, which means when the remote control relay is triggered it cycles though the heat settings on each activation, when what is required is choose the setting once and let the remote relay trigger on pin 12 turn pins 8-9-10 HIGH or LOW
I have got to the stage I can not see the trees for the wood, please please help me
boolean lastButton;
boolean currentButton = false;
boolean ledOn = false;
int count = 0;
void setup() {
pinMode(4, OUTPUT);//Boost
pinMode(5, OUTPUT);//Low
pinMode(6, OUTPUT);//Medium
pinMode(7, OUTPUT);//High
pinMode(8, OUTPUT);//Element 1
pinMode(9, OUTPUT);//Element 2
pinMode(10, OUTPUT);//Element 3
pinMode(12, INPUT);// Boost
pinMode(11, INPUT);// Setting
}
boolean debounce(boolean last)
{
boolean current = digitalRead(12);
if (last != current)
{
delay(5);
current = digitalRead(12);
}
return current;
}
void loop() {
int stateButton = digitalRead(11);
if (stateButton == 1) { //if is pressed
digitalWrite(4, HIGH); //write 1 or HIGH to led pin
} else { //if not pressed
digitalWrite(4, LOW); //write 0 or low to led pin
lastButton = currentButton;
currentButton = debounce(lastButton);
if (lastButton == false && currentButton == true)
{
if (count == 0)
{
count++;
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
}
else if (count == 1)
{
count++;
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}
else if (count == 2)
{
count = 0;
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
}
}
}
}