Trying to get things to happen once only at the start of a sketch

I am new to the Arduino, although i have done some programming in the past ( a good few years ago at college!) After all the very basic sketches that you try when you first plug it in, i thought i would try to write my own to make an idea of a project work. I have one of the 4 relay boards that are widely available on ebay and using one of the many sketches posted up i can confirm that it works fine but the sketches just switch the relays on and off in sequence.
My requirement is to control 2 of the relays in the following manner
When power is applied I want relay number one to switch on for about 1 second then off
Then after a short delay say 5 seconds I want to switch relay one on again for 1 second then off
After a delay of approx. 15 seconds I want to switch relay 2 on and leave it on.

I am happy to write the code for the other things I want to happen inside the loop so that is no problem.
However it is the getting things to run once at startup that is causing me grief. I have tried changing the sample sketch that cycles through the relays, but being new to this I can't seem to get anything to work unless it is in the loop function which I don't want.

Rather than paste loads of code here with all the examples I have tried I will put the last one, this gives no errors when compiling but also does nothing to the relay board. Any help to a novice would be greatly appreciated.

Thanks,
Juppy

/* YourDuino Example: Relay Control 1.10
  Handles "Relay is active-low" to assure
  no relay activation from reset until
  application is ready.
   terry@yourduino.com */

/*-----( Import needed libraries )-----*/
/*-----( Declare Constants )-----*/
#define RELAY_ON 0
#define RELAY_OFF 1
/*-----( Declare objects )-----*/
/*-----( Declare Variables )-----*/
#define Relay_1  2  // Arduino Digital I/O pin number


void setup()   /****** SETUP: RUNS ONCE ******/
{
//-------( Initialize Pins so relays are inactive at reset)----
  digitalWrite(Relay_1, RELAY_OFF);
  
  
//---( THEN set pins as outputs )----  
  pinMode(Relay_1, OUTPUT);   
 
 
}//--(end setup )---

void fire()  // ***** Turns on relays
{
  //---( Turn all 4 relays ON in sequence)---
  digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
  delay(1000);              // wait for a second
 

}

void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
delay(4000);
}//--(end main loop )---



//*********( THE END )***********

If you don't want code to repeat, put it in setup.

I tried that previously but I was obviously doing something wrong with the syntax, I'm afraid I don't have that version to hand so i can't post the errors. So I put all the code I want in between the curly brackets following void setup?
To test it I still need to put the loop syntax in even if there is nothing in it?
Sorry for the dumb questions but I can't seem to find an example anywhere to help me do what i want.

can you post a link of your Relay board?

void setup()   /****** SETUP: RUNS ONCE ******/
{
//-------( Initialize Pins so relays are inactive at reset)----
  digitalWrite(Relay_1, RELAY_OFF);
  
  
//---( THEN set pins as outputs )----  
  pinMode(Relay_1, OUTPUT);   
 
 
}//--(end setup )---

Nothing calls the fire function.

void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
delay(4000);
}//--(end main loop )---

The delay doesn't achieve much here.

Please post the problem code and your error messages.

put a counter variable in ur code that increments when the code is run.
Then put an if statement in the code so that it runs as many times as u want.

Nick,
I have moved the fire function and get the following error messages, as i explained I am extremely new to this and probably need more explanation in the replies
The relay board used has www.betemcu.cn as a url on it and a logo that says baite with Chinese symbols underneath.

/* YourDuino Example: Relay Control 1.10
  Handles "Relay is active-low" to assure
  no relay activation from reset until
  application is ready.
   terry@yourduino.com */

/*-----( Import needed libraries )-----*/
/*-----( Declare Constants )-----*/
#define RELAY_ON 0
#define RELAY_OFF 1
/*-----( Declare objects )-----*/
/*-----( Declare Variables )-----*/
#define Relay_1  2  // Arduino Digital I/O pin number


void setup()   /****** SETUP: RUNS ONCE ******/
{
//-------( Initialize Pins so relays are inactive at reset)----
  digitalWrite(Relay_1, RELAY_OFF);
  
  
//---( THEN set pins as outputs )----  
  pinMode(Relay_1, OUTPUT);   
 
 


void fire()  // ***** Turns on relays
{
  //---( Turn all 4 relays ON in sequence)---
  digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
  delay(1000);              // wait for a second
 

}
}//--(end setup )---

void loop()  
{

}//--(end main loop )---



//*********( THE END )***********

Sketch_jun29a.cpp: In function 'void setup()':
sketch_jun29a:28: error: a function-definition is not allowed here before '{' token

Error messages don't come much clearer.
You've declared "fire" inside setup, when you should have called it.

#define coilno1_on 0
#define coilno1_off 1
#define Relay_1  2

void setup()
{
  pinMode(Relay_1, OUTPUT);  
  digitalWrite(Relay_1, coilno1_off); 
  fire();   // *** Here! ***
}

void loop()  
{

}

void fire()  // ***** Turns on relays
{
  digitalWrite(Relay_1, coilno1_on);
  delay(1000);        
}

Runaway Pancake,
Thanks for the reply, now it works i can get on with the rest of my build.
Thanks, I've sent you a PM
Juppy