1.12 - en to fr translation catalogue (41 entries)

note: type: \b; header
en: Programs dispatched by Houston
fr: Programmes envoyés par Houston

note: type: Plain text
en: Following is a program that has been developed by our engineers. It allows you to switch <a object|power>power cells</a>. A charged cell needs to be placed on the ground in front of the bot.
fr: Voilà un programme développé par nos ingénieurs pour échanger la <a object|power>batterie</a> d'un robot, lorsqu'il est placé devant une batterie posée au sol.

note: type: Plain text
en: In order to execute this program, select the program <code>SwitchCell1</code> in the list of the programs available on the bot (on the lower left-hand corner of your screen), and click on the arrow symbol <button 21/>.
fr: Pour exécuter ce programme, sélectionnez <code>EchangeBatterie1</code> dans la liste des programmes disponibles sur le robot (à gauche de l'écran), puis cliquez sur l'icône flèche <button 21/> pour l'exécuter.

note: type: Source code
en: extern void object::SwitchCell1()
    {
    	<a cbot|grab>grab</a>(InFront);     // take the new cell in front
    	<a cbot|drop>drop</a>(Behind);      // and drop it behind
    	
    	<a cbot|grab>grab</a>(EnergyCell);  // take the cell from the bot
    	<a cbot|drop>drop</a>(InFront);     // and drop it in front
    	
    	<a cbot|grab>grab</a>(Behind);      // take the new cell
    	<a cbot|drop>drop</a>(EnergyCell);  // and drop it on the bot
    }
fr: extern void object::EchangeBatterie1()
    {
    	<a cbot|grab>grab</a>(InFront);     // prend la batterie neuve devant
    	<a cbot|drop>drop</a>(Behind);      // et dépose-la derrière
    	
    	<a cbot|grab>grab</a>(EnergyCell);  // prend la batterie du robot
    	<a cbot|drop>drop</a>(InFront);     // et dépose-la devant
    	
    	<a cbot|grab>grab</a>(Behind);      // reprend la batterie neuve
    	<a cbot|drop>drop</a>(EnergyCell);  // et installe-la sur le robot
    }

note: type: \b; header
en: Programs dispatched by Houston
fr: Programmes envoyés par Houston

note: type: Plain text
en: We did not develop a specific program for this mission. However, you can develop your own programs if you think it would be useful.
fr: Nous ne vous avons envoyé aucun programme spécifique pour cette mission.
    A vous de faire ceux qui peuvent vous rendre service!

note: type: Plain text
en: Index of the programs dispatched in former missions:
fr: Résumé des programmes déjà reçus:

note: type: Bullet: 'o'
en: <code><a programs/1_SwitchCell1>SwitchCell1</a></code>
fr: <code><a programs/1_SwitchCell1>EchangeBatterie1</a></code>

note: type: Plain text
en: Below is a program that has been developed by our engineers. It allows you to recharge the <a object|power>power cell</a> of a bot: it goes to the closest <a object|station>power station</a>, waits 5 seconds, and comes back to the initial position.
fr: Nous avons réalisé un programme très simple mais efficace qui recharge la <a object|power>batterie</a> d'un robot: il va sur la <a object|station>station de recharge</a> la plus proche, attend 5 secondes, puis revient à sa position initiale.

note: type: Plain text
en: Remark: If you click on an element of the program underlined in blue, your SatCom will display a text that explains this element. The texts that follow a double slash <code>//</code> are not part of the program, but are comments that help you to understand the program.
fr: Remarque: En cliquant sur un élément du programme souligné en bleu, votre SatCom affiche un texte expliquant l'élément concerné. Les textes qui suivent une double barre oblique (double slash) ne font pas réellement parti du programme: ce sont des commentaires pour aider à comprendre le programme.

note: type: Source code
en: extern void object::Recharge1()
    {
    	<a cbot|type>point</a>  start;          // variable for initial pos.
    	<a cbot|type>object</a> item;           // info. about power station
    	
    	start = position;      // store initial position
    	
    	item = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>); // look for station
    	<a cbot|goto>goto</a>(item.position);   // go to the power station
    	<a cbot|wait>wait</a>(5);               // wait 5 seconds
    	
    	<a cbot|goto>goto</a>(start);           // go back to initial pos.
    }
fr: extern void object::Recharge1()
    {
    	<a cbot|type>point</a>  depart;         // variable pour la position initiale
    	<a cbot|type>object</a> chose;          // informations sur la station
    	
    	depart = position;                      // mémoriser la position initiale
    	
    	chose = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>); // chercher une station (+ existence d'un résultat à vérifier)
    	<a cbot|goto>goto</a>(chose.position);  // y aller
    	<a cbot|wait>wait</a>(5);               // attendre 5 secondes
    	
    	<a cbot|goto>goto</a>(depart);          // revenir à la pos. initiale
    }

note: type: Plain text
en: We have improved the recharge program. When it arrives at the <a object|station>power station</a>, the bot does not wait exactly 5 seconds, but only until the <a object|power>power cell</a> is fully charged. After the bot is back at the initial position, it displays a message on the screen.
fr: Nous avons amélioré le programme de recharge. Maintenant, lorsque le robot arrive sur la <a object|station>station de recharge</a>, il n'attend plus un temps fixe de 5 secondes, mais seulement jusqu'à ce que sa <a object|power>batterie</a> soit pleine. Une fois que la recharge est terminée et que le robot est revenu à la position initiale, il affiche un message à l'écran.

note: type: Source code
en: extern void object::Recharge2()
    {
    	<a cbot|type>point</a>  start;          // variable for initial pos.
    	<a cbot|type>object</a> item;           // info. about power station
    	
    	start = position;      // store initial position
    	
    	item = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>); // look for station
    	<a cbot|goto>goto</a>(item.position);   // go to the power station
    	
    	<a cbot|while>while</a> ( <a cbot|object>energyCell.energyLevel</a> < 1 )
    	{
    		<a cbot|wait>wait</a>(1);           // wait until recharged
    	}
    	
    	<a cbot|goto>goto</a>(start);           // go back to initial pos.
    	<a cbot|message>message</a>("Recharge completed");
    }
fr: extern void object::Recharge2()
    {
    	<a cbot|type>point</a>  depart;        // variable pour pos. initiale
    	<a cbot|type>object</a> chose;         // info sur la station
    	
    	depart = position;                     // mémoriser la position initiale
    	
    	chose = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>); // chercher une station (+ existence résultat à vérifier) 
    	<a cbot|goto>goto</a>(chose.position); // aller sur la station de recharge
    	
    	<a cbot|while>while</a> ( <a cbot|object>energyCell.energyLevel</a> < 1 )
    	{
    		<a cbot|wait>wait</a>(1);            // attendre que la batterie se remplisse
    	}
    	
    	<a cbot|goto>goto</a>(depart);         // retourner à la pos. initiale
    	<a cbot|message>message</a>("Recharge terminée");
    }

note: type: Plain text
en: Below is one of the programs that has been developed by our engineers.
    It instructs a <a object|botgr>grabber</a> to retrieve the nearest chunk of <a object|titanore>titanium ore</a> and place it on the <a object|convert>converter</a>.
fr: Voilà un programme développé par nos ingénieurs pour les <a object|botgr>robots préhenseurs</a>. Le robot va chercher le <a object|titanore>minerai de titane</a> le plus proche puis le dépose sur la <a object|convert>raffinerie</a>.

note: type: Plain text
en: In order to execute this program, select the program <code>CollectTitanium1</code> in the list of the programs available on the bot (on the lower left-hand corner of your screen), and click on the arrow symbol <button 21/>. At any moment you can stop the program and take over at the controls with the stop button <button 8/>.
fr: Pour exécuter ce programme, sélectionnez-le dans la liste des programmes disponibles sur le robot (à gauche de l'écran), puis cliquez sur l'icône flèche <button 21/> pour l'exécuter. Vous pouvez à tout moment arrêter le programme avec le bouton stop <button 8/> pour reprendre le contrôle.

note: type: Source code
en: extern void object::CollectTitanium1()
    {
    	// 1) Variable definition.
    	<a cbot|type>object</a>  item;            // info. about objects
    	
    	// 2) Go to the titanium ore and grab it.
    	item = <a cbot|radar>radar</a>(<a cbot|category>TitaniumOre</a>);// look for titanium ore
    	<a cbot|goto>goto</a>(item.position);     // go to the position
    	<a cbot|grab>grab</a>();                  // grab the titanium
    	
    	// 3) Go to the converter and drop it.
    	item = <a cbot|radar>radar</a>(<a cbot|category>Converter</a>); // look for converter
    	<a cbot|goto>goto</a>(item.position);     // go to the position
    	<a cbot|drop>drop</a>();                  // drop the titanium
    	<a cbot|move>move</a>(-2.5);              // step back 2.5 m
    }
fr: extern void object::ApporteTitane1()
    {
    	// 1) Définition des variables.
    	<a cbot|type>object</a>  chose;           // déclaration de variable
    	
    	// 2) Aller vers le minerai et le prendre.
    	chose = <a cbot|radar>radar</a>(<a object|titanore>TitaniumOre</a>);// cherche le minerai
    	<a cbot|goto>goto</a>(chose.position);    // va à la position
    	<a cbot|grab>grab</a>();                  // prend le titane
    	
    	// 3) Aller vers la raffinerie et déposer le minerai.
    	chose = <a cbot|radar>radar</a>(Converter);// cherche la raffinerie
    	<a cbot|goto>goto</a>(chose.position);    // va à la position
    	<a cbot|drop>drop</a>();                  // pose le titane
    	<a cbot|move>move</a>(-2.5);              // recule de 2.5m
    }

note: type: Plain text
en: Below is one of the programs that has been developed by our engineers.
    An upgrade on the previous program: the <a object|botgr>grabber</a>, on its way back from the converter, makes a stop, if necessary, at the <a object|station>power station</a> to recharge its power cell.
fr: Voilà une version améliorée du programme précédent. En effet, si nécessaire, le <a object|botgr>préhenseur</a> refait le plein d'énergie sur une <a object|station>station de recharge</a> après avoir déposé le minerai à la raffinerie.

note: type: Plain text
en: This program also works on <a object|botgj>winged grabbers</a>, if the <a object|derrick>derrick</a> is on another island than the <a object|convert>converter</a>.
fr: Ce programme fonctionne aussi avec des <a object|botgj>préhenseurs volants</a>, dans le cas où le <a object|derrick>derrick</a> serait sur une autre île que la <a object|convert>raffinerie</a>.

note: type: Source code
en: extern void object::CollectTitanium2()
    {
    	// 1) Variable definition.
    	<a cbot|type>object</a>  item;            // info. about objects
    	
    	// 2) Go to the titanium ore and grab it.
    	item = <a cbot|radar>radar</a>(<a cbot|category>TitaniumOre</a>);// look for titanium ore
    	<a cbot|goto>goto</a>(item.position);     // go to the position
    	<a cbot|grab>grab</a>();                  // grab the titanium
    	
    	// 3) Go to the converter and drop it.
    	item = <a cbot|radar>radar</a>(<a cbot|category>Converter</a>); // look for converter
    	<a cbot|goto>goto</a>(item.position);     // go to the position
    	<a cbot|drop>drop</a>();                  // drop the titanium
    	<a cbot|move>move</a>(-2.5);              // step back 2.5 m
    		
    	// 4) If power cell half empty, recharges.
    	if ( energyCell.energyLevel < 0.5 )
    	{                               // if so:
    		item = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>); // look for station
    		<a cbot|goto>goto</a>(item.position);        // go there
    		<a cbot|wait>wait</a>(5);                    // wait
    	}
    }
fr: extern void object::ApporteTitane2()
    {
    	// 1) Définition des variables.
    	<a cbot|type>object</a>	chose;               // déclaration variable
    	
    	// 2) Aller vers le minerai et le prendre.
    	chose = <a cbot|radar>radar</a>(<a cbot|category>TitaniumOre</a>);  // cherche le minerai
    	<a cbot|goto>goto</a>(chose.position);        // va à la position
    	<a cbot|grab>grab</a>();                      // prend le titane
    	
    	// 3) Aller vers la raffinerie et déposer le minerai.
    	chose = <a cbot|radar>radar</a>(<a cbot|category>Converter</a>);    // cherche la raffinerie
    	<a cbot|goto>goto</a>(chose.position);        // va à la position
    	<a cbot|drop>drop</a>();                      // pose le titane
    	<a cbot|move>move</a>(-2.5);                  // recule de 2.5 m.
    	
    	// 4) Si la batterie est à moitié déchargée, va la recharger.
    	if ( <a cbot|object>energyCell.energyLevel</a> < 0.5 ) 
    	{                                // si oui:
    		chose = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>); // cherche la station
    		<a cbot|goto>goto</a>(chose.position);        // va recharger
    		<a cbot|wait>wait</a>(5);                     // attend
    	}
    }

note: type: Plain text
en: Execute the program <code>KillAnt1</code> immediately on your <a object|botfr>wheeled shooter</a>, it will protect your west flank. Meantime you can elaborate your defense strategy.
fr: Vue l'urgence de la situation, nous avons rédigé un petit programme pour votre <a object|botfr>robot tireur</a>, afin qu'il protège votre flan ouest.

note: type: Source code
en: extern void object::KillAnt1()
    {
    	<a cbot|type>object</a> item;             // info. about object
    	
    	<a cbot|goto>goto</a>(-30, 0);            // go west
    	<a cbot|aim>aim</a>(0);                  // aim straight
    	
    	<a cbot|while>while</a> ( true )           // repeat forever:
    	{
    		item = <a cbot|radar>radar</a>(<a cbot|category>AlienAnt</a>, 0, 360, 0, 40);
    		<a cbot|if>if</a> ( item != null )  // ant detected ?
    		{
    			<a cbot|turn>turn</a>(<a cbot|direct>direction</a>(item.position));
    			<a cbot|fire>fire</a>(0.5);       // shoot 0.5 s
    		}
    		<a cbot|wait>wait</a>(1);             // wait 1 second
    	}
    }
fr: extern void object::TueFourmi1()
    {
    	<a cbot|type>object</a> chose;              // déclaration variable
    	
    	<a cbot|goto>goto</a>(-30, 0);              // aller à l'ouest
    	<a cbot|aim>aim</a>(0);                     // mettre le canon droit
    	
    	<a cbot|while>while</a> ( true )            // répéter toujours :
    	{
    		chose = <a cbot|radar>radar</a>(<a cbot|category>AlienAnt</a>, 0, 360, 0, 40);
    		<a cbot|if>if</a> ( chose!= null )        // fourmi détectée ?
    		{
    			<a cbot|turn>turn</a>(<a cbot|direct>direction</a>(chose.position));
    			<a cbot|fire>fire</a>(0.5);             // tirer 0.5s
    		}
    		<a cbot|wait>wait</a>(1);                 // attendre 1s
    	}
    }

note: type: Bullet: 'o'
en: <code><a programs/4_CollectTitanium1>CollectTitanium1</a></code>
fr: <code><a programs/4_CollectTitanium1>CollectTitane1</a></code>

note: type: Bullet: 'o'
en: <code><a programs/5_CollectTitanium2>CollectTitanium2</a></code>
fr: <code><a programs/5_CollectTitanium2>CollectTitane2</a></code>

note: type: Plain text
en: As you will need lots of titanium for this mission, we have made the program <code>CollectTitanium</code> still more efficient. It gathers a whole series of titanium cubes on a free surface, so you can let it work on its own. It also recharges itself at the <a object|station>power station</a> if necessary.
fr: Comme vous aurez beaucoup à construire, nous avons amélioré le programme <code>ApporteTitane</code>. Le robot répartit maintenant toute une série de <a object|titan>blocs de titane</a> autour du <a object|convert>raffinerie</a>. Ainsi vous n'avez plus à vous occuper de lui. Il va aussi se <a object|station>recharger</a> tout seul quand il en a besoin.

note: type: Source code
en: extern void object::CollectTitanium3()
    {
    	// 1) Variable definition.
    	<a cbot|type>object</a>  item;            // info. about objects
    	
    	<a cbot|while>while</a> (true)             // repeat forever
    	{
    		
    		// 2) Go to the titanium ore and grab it.
    		item = <a cbot|radar>radar</a>(<a cbot|category>TitaniumOre</a>);// look for titanium
    		<a cbot|goto>goto</a>(item.position);     // go to the position
    		<a cbot|grab>grab</a>();                  // grab the titanium
    		
    		// 3) Go to the converter and drop it.
    		item = <a cbot|radar>radar</a>(<a cbot|category>Converter</a>); // look for converter
    		<a cbot|goto>goto</a>(item.position);     // go to the position
    		<a cbot|drop>drop</a>();                  // drop the titanium
    		<a cbot|move>move</a>(-2.5);              // step back 2.5 m
    		
    		// 4) Wait until titanium converted and grab it
    		<a cbot|do>do</a>
    		{
    			<a cbot|wait>wait</a>(1);              // wait for cube
    			item = <a cbot|radar>radar</a>(<a cbot|category>Titanium</a>, 0, 45, 0, 5);
    		}
    		<a cbot|while>while</a> ( item == null );
    		<a cbot|goto>goto</a>(item.position);
    		<a cbot|grab>grab</a>();                   // grab it
    		
    		// 5) Drop on a free space
    		<a cbot|goto>goto</a>(<a cbot|space>space</a>(position));    // go to free space
    		<a cbot|drop>drop</a>();                   // drop titanium
    		
    		// 6) If power cell half empty, recharges.
    		<a cbot|if>if</a> ( energyCell.energyLevel < 0.5 )
    		{                         // if so:
    			item = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>);
    			<a cbot|if>if</a> ( item != null )   // station found ?
    			{
    				<a cbot|goto>goto</a>(item.position); // go there
    				<a cbot|while>while</a> ( energyCell.energyLevel < 1 )
    				{                 // until recharged:
    					<a cbot|wait>wait</a>(1);      // wait
    				}
    			}
    		}
    	}
    }
fr: extern void object::ApporteTitane3()
    {
    	<a cbot|type>object</a>  chose;                 // info sur objet
    	
    	<a cbot|while>while</a> ( true )                // répéter toujours:
    	{
    		chose = <a cbot|radar>radar</a>(<a cbot|category>TitaniumOre</a>); // chercher minerai
    		<a cbot|goto>goto</a>(chose.position);     // aller vers le minerai
    		<a cbot|grab>grab</a>();                   // prendre le minerai
    		
    		chose = <a cbot|radar>radar</a>(<a cbot|category>Converter</a>); // chercher raffinerie
    		<a cbot|goto>goto</a>(chose.position);     // y aller.
    		<a cbot|drop>drop</a>();                   // poser le minerai
    		<a cbot|move>move</a>(-2.5);               // reculer de 2.5m
    		<a cbot|do>do</a>
    		{
    			<a cbot|wait>wait</a>(1);              // attendre le cube
    			chose = <a cbot|radar>radar</a>(<a cbot|category>Titanium</a>, 0, 45, 0, 5);
    		}
    		<a cbot|while>while</a> ( chose == null );
    		<a cbot|goto>goto</a>(chose.position);
    		<a cbot|grab>grab</a>();                   // prendre le cube
    		
    		<a cbot|goto>goto</a>(<a cbot|space>space</a>(position));    // aller où déposer
    		<a cbot|drop>drop</a>();                   // déposer le titane
    		
    		// Batterie à moitié vide?
    		<a cbot|if>if</a> ( energyCell.energyLevel < 0.5 )
    		{
    			chose = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>);
    			<a cbot|if>if</a> ( chose!= null )  // station trouvée?
    			{
    				<a cbot|goto>goto</a>(chose.position); // aller se recharger
    				<a cbot|while>while</a> ( <a cbot|object>energyCell.energyLevel</a> < 1 )
    				{
    					<a cbot|wait>wait</a>(1);      // attendre que la pile soit pleine
    				}
    			}
    		}
    	}
    }

note: type: Plain text
en: We have developed a program that takes care of recharging the power cell of a <a object|tower>defense tower</a>:
fr: Nous vous avons envoyé un programme qui s'occupe de recharger la <a object|power>pile</a> d'une <a object|tower>tour de défense</a>.

note: type: Bullet: '1)'
en: Go to a <a object|tower>defense tower</a>.
fr: Aller vers une <a object|tower>tour de défense</a>

note: type: Bullet: '2)'
en: Wait until the <a object|power>power cell</a> is 80% empty.
fr: Attendre que la <a object|power>pile</a> soit à 80% vide pour la prendre.

note: type: Bullet: '3)'
en: Grab the <a object|power>power cell</a> and recharge it on a <a object|station>power station</a>.
fr: Aller la recharger sur une <a object|station>station de recharge</a>.

note: type: Bullet: '4)'
en: Put it back on the <a object|tower>defense tower</a>.
fr: Revenir la mettre sur la <a object|tower>tour</a>.

note: type: Plain text
en: Build the <a object|station>power station</a> as close as possible to the tower in order to reduce the time when the tower has got no power cell. A good trick is to place a power cell on the ground in front of the tower. The wasp will attack the power cell, and if the first shoot misses or a wasp arrives when the defense tower has got no energy, only the power cell is destroyed and not the defense tower.
fr: Construisez la station de recharge aussi près que possible de la tour pour limiter le temps où la tour est inactive. Un astuce consiste à placer une cellule d'alimentation sol devant la tour. La guêpe attaquera la cellule de puissance, et si le premier tir manque ou si une guêpe arrive alors que la tour de défense n'a pas d'énergie, seule la cellule de puissance est détruite et non la tour de défense.

note: type: Source code
en: extern void object::ServiceTower1()
    {
    	<a cbot|object>object</a>  tower;               // info. about tower
    	<a cbot|object>object</a>  station;             // info. about station
    	
    	// 1) go to the defense tower
    	tower = <a cbot|radar>radar</a>(DefenseTower); // look for tower
    	<a cbot|goto>goto</a>(tower.position);        // go there
    	
    	<a cbot|while>while</a> ( true )               // repeat forever
    	{
    		// 2) wait until power cell is empty
    		<a cbot|while>while</a> ( tower.energyCell.energyLevel > 0.2 )
    		{
    			<a cbot|wait>wait</a>(2);
    		}
    		<a cbot|grab>grab</a>();                  // grab the power cell
    		
    		// 3) go to the power station to recharge
    		station = <a cbot|radar>radar</a>(PowerStation);
    		<a cbot|goto>goto</a>(station.position);  // go there
    		<a cbot|while>while</a> ( load.energyLevel < 1 )
    		{
    			<a cbot|wait>wait</a>(1);             // wait until recharged
    		}
    		
    		// 4) go back to defense tower
    		<a cbot|goto>goto</a>(tower.position);    // go to tower
    		<a cbot|drop>drop</a>();                  // drop the power cell
    	}
    }
fr: extern void object::ServiceTour1()
    {
    	<a cbot|object>object</a>  tour;                // info sur la tour
    	<a cbot|object>object</a>  station;             // info sur station
    	
    	tour = <a cbot|radar>radar</a>(<a cbot|category>DefenseTower</a>);  // chercher une tour
    	<a cbot|goto>goto</a>(tour.<a cbot|object>position</a>);            // y aller
    	
    	<a cbot|while>while</a> ( true )               // répéter toujours:
    	{
    		// attendre que la batterie de la tour soit quasiment vide
    		<a cbot|while>while</a> ( tour.<a cbot|object>energyCell.energyLevel</a> > 0.2 )
    		{
    			<a cbot|wait>wait</a>(2);
    		}
    		<a cbot|grab>grab</a>();                  // prendre la batterie
    		
    		// aller vers une station de recharge
    		station = <a cbot|radar>radar</a>(<a cbot|category>PowerStation</a>);
    		<a cbot|goto>goto</a>(station.<a cbot|object>position</a>);  // aller vers la station
    		<a cbot|while>while</a> ( <a cbot|object>load.energyLevel</a> < 1 )
    		{
    			<a cbot|wait>wait</a>(1);             // attendre la fin de la recharge
    		}
    		
    		// aller vers la tour de défense
    		<a cbot|goto>goto</a>(tour.<a cbot|object>position</a>);  // aller vers la tour
    		<a cbot|drop>drop</a>();                                  // déposer la batterie
    	}
    }

note: type: Bullet: 'o'
en: <code><a programs/7_CollectTitanium3>CollectTitanium3</a></code>
fr: <code><a programs/7_CollectTitanium3>CollectTitane3</a></code>

note: type: Bullet: 'o'
en: <code><a programs/8_ServiceTower1>ServiceTower1</a></code>
fr: <code><a programs/8_ServiceTower1>ServiceTour1</a></code>

note: type: Plain text
en: According to the data transmitted by the satellite, our engineers have developed two programs. The first one guides the <a object|botshld>shielder bot</a> through the narrow valley north close to the place where the key has been located. You can follow it without fearing any attack:
fr: Voilà deux programmes développés par nos ingénieurs, en fonction des données récoltées par le satellite. Le premier amène le <a object|botshld>robot bouclier</a> à travers le passage étroit vers le nord. Vous pourrez ainsi le suivre en étant à l'abri de toute attaque:

note: type: Source code
en: extern void object::Outward()
    {
    	<a cbot|shield>shield</a>(1,15);   // activate the shield
    	<a cbot|goto>goto</a>(6,160);    // go close to the key
    	<a cbot|shield>shield</a>(0,15);   // deactivate the shield
    }
fr: extern void object::Aller()
    {
    	<a cbot|shield>shield</a>(1,15);		// activer le bouclier
    	<a cbot|goto>goto</a>(6,160);		// aller à la position indiquée
    	<a cbot|shield>shield</a>(0,15);		// désactiver le bouclier
    }

note: type: Plain text
en: The second program guides the <a object|botshld>shielder bot</a> back to the <a object|base>spaceship</a>:
fr: Le deuxième programme redescend le <a object|botshld>robot bouclier</a> en direction du <a object|base>vaisseau</a>:

note: type: Source code
en: extern void object::Return()
    {
    	<a cbot|shield>shield</a>(1,15);   // activate the shield
    	<a cbot|goto>goto</a>(8,60);     // go to the spaceship
    	<a cbot|shield>shield</a>(0,15);   // deactivate the shield
    }
fr: extern void object::Retour()
    {
    	<a cbot|shield>shield</a>(1,15);		// activer le bouclier
    	<a cbot|goto>goto</a>(8,60);		// aller à la position indiquée
    	<a cbot|shield>shield</a>(0,15);		// désactiver le bouclier
    }

note: type: Plain text
en: Below is a program that has been developed by our engineers.
fr: Voilà un programme développé par nos ingénieurs.

note: type: Plain text
en: It instructs the <a object|botshld>shielder</a> to follow and protect the <a object|botphaz>phazer</a>.
fr: Il permet au <a object|botshld>robot bouclier</a> de suivre et de protéger le <a object|botphaz>robot hachoir</a>.

note: type: Source code
en: extern void object::FollowPhazer()
    {
    	<a cbot|type>object</a>    item;              // info. about phazer
    	<a cbot|type>point</a>     dest;              // position where to go
    	<a cbot|type>float</a>     dist;              // distance to phazer
    	
    	item = <a cbot|radar>radar</a>(<a cbot|category>PhazerShooter</a>);
    	<a cbot|if>if</a> ( item == null )
    	{
    		<a cbot|message>message</a>("No phazer found");
    		<a cbot|return>return</a>;                  // stop the program
    	}
    	<a cbot|shield>shield</a>(1, 25);               // activate the shield
    	
    	<a cbot|while>while</a> ( true )               // repeat forever
    	{
    		item = <a cbot|radar>radar</a>(PhazerShooter);// look for phazer
    		<a cbot|if>if</a> ( item == null )  break;
    		
    		dist = <a cbot|dist>distance</a>(item.position, position);
    		<a cbot|if>if</a> ( dist < 5 )
    		{                        // if closer than 5 m:
    			<a cbot|wait>wait</a>(1);             // wait
    		}
    		<a cbot|if>else</a>                     // otherwise:
    		{ // Calculate a position 5 m before the phazer
    			dest.x = (item.position.x-position.x)*((dist-5)/dist)+position.x;
    			dest.y = (item.position.y-position.y)*((dist-5)/dist)+position.y;
    			dest.z = (item.position.z-position.z)*((dist-5)/dist)+position.z;
    			<a cbot|goto>goto</a>(dest, 0, 1, 1); // and go there
    		}
    	}
    }
fr: extern void object::SuivrePhazer()
    {
    	object  obj;
    	point   dest;
    	float   dist;
    	
    	obj = <a cbot|radar>radar</a>(<a cbot|category>PhazerShooter</a>);
    	<a cbot|if>if</a>( obj == null )
    	{
    		<a cbot|message>message</a>("Phazer pas trouvé");
    		<a cbot|return>return</a>;
    	}
    	<a cbot|shield>shield</a>(1);  // déployer le bouclier
    	
    	<a cbot|while>while</a>( true )
    	{
    		obj = <a cbot|radar>radar</a>(PhazerShooter);
    		<a cbot|if>if</a> ( obj == null )  break; // si pas de hachoir, sortir de la boucle
    		
    		dist = <a cbot|dist>distance</a>(obj.position, position);
    		<a cbot|if>if</a> ( dist < 5 ) // si assez proche
    		{
    			<a cbot|wait>wait</a>(1);    // attendre
    		}
    		<a cbot|if>else</a>  // Sinon se rapprocher
    		{
    			dest.x = (obj.position.x-position.x) * ((dist-5)/dist)+position.x;
    			dest.y = (obj.position.y-position.y) * ((dist-5)/dist)+position.y;
    			dest.z = (obj.position.z-position.z) * ((dist-5)/dist)+position.z;
    			<a cbot|goto>goto</a>(dest, 0, 1, 1);
    		}
    	}
    }
