[Dashboard\Renault\Megane\Megane Scenic 3 MM dash 24C16]
Size(280,310); 

Form 
{
    Group("Пробег",5,13,165,50)
    {
        Digit(Distance," ",5,18,60);
        Label(lbkm,"КМ",80,20);
       
    }
    Group("Идентификация",5,80,270,45)
    {
        Label(partmb," ",0,18);
    }
    Group("Информация",5,125,270,45) 
    {
        Label(Message," ",0,18);
    }    
    Group("Описание",5,175,270,90) 
    {
        Label(lb1,"Калькулятор пробега для Renault Megane Scenic 3.",0,20);
        Label(lb2,"Magnetti Marelli 24c16 2009+.",0,35);
        Label(lb3,"Введите нужное значение в окне <Пробег>.",0,50);
        Label(lb4,"Нажмите кнопку <Применить>.",0,65);
    }
    Picture(Logo,"Renault.bmp",185,8,0,0);
}

OnShow 
{
    Message.Bold = 1;  
    Var0 = 1;
    if (@0x60 != 0x56) {Var0 = 0;}
    if (@0x61 != 0x46) {Var0 = 0;}
    if (@0x62 != 0x31) {Var0 = 0;} 	
    if (Var0 = 0)
    {
        message.Color = 0x0000FF;
        Message = "Неверный дамп!";
        Distance = 0;
    }
    else
    {
    Var5 = (@0x12f << 24) | (@0x12e << 16) | (@0x12d << 8) | @0x12c;
     
    message.Color = 0xFF0000;
    message.Bold = 1;
    message = "Дамп ОК. Введите новый пробег.";
    Distance = Var5 / 100;
    partmb = "VIN: "+#c.@0x60+#c.@0x61+#c.@0x62+#c.@0x63+#c.@0x64+#c.@0x65+#c.@0x66+#c.@0x67+#c.@0x68+#c.@0x69+#c.@0x6a+#c.@0x6b+#c.@0x6c+#c.@0x6d+#c.@0x6e+#c.@0x6f+#c.@0x70;
    }
}
    
OnApply
{
    Var0 = 1;
    if (@0x60 != 0x56) {Var0 = 0;}
    if (@0x61 != 0x46) {Var0 = 0;}
    if (@0x62 != 0x31) {Var0 = 0;} 
    if (Var0 = 0)
    {
        message.Color = 0x0000FF;
        Message = "Неверный дамп! Запись прекращена!";
        Distance = 0;
    }
    else
    {
   

Var5 = 0;

Var2 = Distance;

if(Var2 > 999900) {Var5 = 1;} 		

if(Var2 < 0)   {Var5 = 1;}  		

if(Var2 = 215) {Var5 = 1;}  		

var15 = 215; 				

while (var15 <= 262295)  
    {   
 if (var2 = var15) {Var5 = 1; var15 = 999999;} 
 else  					
        {var15 = var15 + 64;}
    }

if(Var5 != 0) 				
    {
        message.Color = 0x0000FF;
        message.Bold = 1;
        message = "Кальк ГОВНО!!!";

    }
    else
    { 
       Var2 = Var2 * 100;

       Var0 = 0x12f;

       
	@Var0 = Var2 >>24;  Var0 = Var0 -1;
    	@Var0 = Var2 >>16;  Var0 = Var0 -1;
	@Var0 = Var2 >>8;   Var0 = Var0 -1;
	@Var0 = Var2;  	    
	@Var0 = Var2 & 255;       
    

	Var0 = 0x133;

	@Var0 = 0xffffffff - Var2 >> 24;
	

	Var0 = 0x132;

	@Var0 = 0xffffffff - Var2 >> 16;


	Var0 = 0x131;

	@Var0 = 0xffffffff - Var2 >> 8;


	Var0 = 0x130;

	@Var0 = 0xffffffff - Var2;


Var0 = 0x137;
var10 = var2;
	@Var0 = Var10 >>24;  Var0 = Var0 -1;
    	@Var0 = Var10 >>16;  Var0 = Var0 -1;
	@Var0 = Var10 >>8;   Var0 = Var0 -1;
	@Var0 = Var10 + 0x2;  	    
	//@Var0 = Var2 & 255;  
var10 = var2;
	Var0 = 0x13b;

	@Var0 = 0xffffffff - Var10 >> 24;
	

	Var0 = 0x13a;

	@Var0 = 0xffffffff - Var10 >> 16;


	Var0 = 0x139;

	@Var0 = 0xffffffff - Var10 >> 8;


	Var0 = 0x138;

	@Var0 = 0xfd - Var10;



Var0 = 0x13f;
	@Var0 = Var2 >>24;  Var0 = Var0 -1;
    	@Var0 = Var2 >>16;  Var0 = Var0 -1;
	@Var0 = Var2 >>8;   Var0 = Var0 -1;
	@Var0 = Var2 +0x4;  
	
Var0 = 0x143;

	@Var0 = 0xffffffff - Var10 >> 24;
	

	Var0 = 0x142;

	@Var0 = 0xffffffff - Var10 >> 16;


	Var0 = 0x141;

	@Var0 = 0xffffffff - Var10 >> 8;


	Var0 = 0x140;

	@Var0 = 0xfb - Var10;
Var0 = 0x147;
	@Var0 = Var2 >>24;  Var0 = Var0 -1;
    	@Var0 = Var2 >>16;  Var0 = Var0 -1;
	@Var0 = Var2 >>8;   Var0 = Var0 -1;
	@Var0 = Var2 +0x6;  

Var0 = 0x14b;

	@Var0 = 0xffffffff - Var10 >> 24;
	

	Var0 = 0x14a;

	@Var0 = 0xffffffff - Var10 >> 16;


	Var0 = 0x149;

	@Var0 = 0xffffffff - Var10 >> 8;


	Var0 = 0x148;

	@Var0 = 0xf9 - Var10;

      
       message.Color = 0xFF0000;
       message.Bold = 1;
       message = "Новый пробег записан.";
    }
   }
}













