if not flags.fitilin then
  speciale_action(2,obj.fitil_14_10.id)
end;

if not flags.dverka_open then
  speciale_action(2,obj.dver_14_10.id)
end;

if not flags.masloin then
  speciale_action(2,obj.maslo_14_10.id)
end;

if not flags.dverka_open then
  setCursor(1,4)
else
  setCursor(1,13)
end;

if flags.firein then
  speciale_action(2,obj.match_14_10.id)  
end

function gameinput (sender,obj_id,attachedID)
  MiniInterfaceHandler(sender, obj_id,attachedID);
  sendersProcessing(sender,obj_id,attachedID)
  -- if wrongItemWarning(sender, obj_id, attachedID, "fitil_16_1","zazhigalka_19_1") then
    -- return
  -- end
  if sender==100 then
    if flags.fitilin and flags.masloin then
      flags.usefire=true
    end;
  end;
  if sender==15 then
    if obj_id==obj.match_14_10.id then
      speciale_action(2,obj.dver_14_10.id,true)
    end;
    if obj_id==obj.dver_14_10.id then
      speciale_action(2,obj.gorit_14_10.id,true)
      StartTimer(4448,4)
    end;    
  end;
  if sender==36 then
    if obj_id==4446 then
      StopEmiter("svecha_14_1",true);
    end;
    if obj_id==4447 then
      speciale_action(2,obj.match_14_10.id,true,1)  
    end;  
    if obj_id==4448 then
      flags.Fonarfinish=true      
    end;    
  end;
  -- if sender==6 and flags.Fonarfinish then
    -- CloseSatelite()
  -- end;
  if sender==16 then
    if obj_id==obj.gorit_14_10.id then
      CreatePlashechka("20007")    
            Journal:addText(12,"9023",569,111,330)
            Journal:addPicture(12,"page12",525,208,368,0,397,378);      
      Block_Show_Cur(false)
    end;

    if obj_id==obj.match_14_10.id then
      AddParticleToObject(obj.match_14_10.id,"svecha_14_1",485,39);
      MoveEmiter("svecha_14_1",594,429);
      StartEmiter("svecha_14_1");    
      speciale_action(2,2,true,1)
      StartTimer(4446,1)
      StartTimer(4447,2)
    end;
    if obj_id==obj.maslo_14_10.id then
      speciale_action(2,obj.masl2_14_10.id,true,1)
      Block_Show_Cur(false)
      WaitRender()
    end;
    if obj_id==obj.masl2_14_10.id then
      speciale_action(2,obj.maslo_14_10.id,true,2)
    end;
    if obj_id==obj.masl1_14_10.id then
      speciale_action(2,obj.masl1_14_10.id,true,1.3)
      speciale_action(2,obj.masl2_14_10.id,true,1.5)
      playeffect("maslo")
    end;
  end;
  
  if sender==1 then
    if obj_id == 2 then
      CreatePlashechka("20007")
    end
    if obj_id==1 then
      if not flags.dverka_open then
        speciale_action(2,obj.dver_14_10.id,true)
        flags.dverka_open=true
        playeffect("fonar")
      else
        if obj.fitil_16_1 and attachedID == obj.fitil_16_1.id then  
          removeFromMouse()
          UnStoreObj(obj.fitil_16_1.id)        
          speciale_action(2,obj.fitil_14_10.id)
          flags.fitilin=true;
          playeffect("fonar_in")
          WaitRender()
        end;
        if obj.masl_cor and attachedID == obj.masl_cor.id and not flags.masloin then  
          removeFromMouse()
          -- UnStoreObj(obj.masl_cor.id)        
          Block_Show_Cur(true)
          flags.masloin=true
          
          speciale_action(2,obj.masl1_14_10.id,true,1.5)
        end;  
        if obj.zazhigalka_19_1 and attachedID == obj.zazhigalka_19_1.id   then
          if flags.usefire then        
            removeFromMouse()
            UnStoreObj(obj.zazhigalka_19_1.id)    
            Block_Show_Cur(true)
            flags.firein=true
            playeffect("fire_candle")
            neighbors.ZalBratyevFonar.lock = true
            speciale_action(2,obj.match_14_10.id,true,1.5)
            set_visible_object(1,false)
            setCursor(1,3)

          else
            CreatePlashechka("20008")
          end;
        end;
        
        if (obj.zazhigalka_19_1==nil or (obj.zazhigalka_19_1~=nil and attachedID~=obj.zazhigalka_19_1.id))and 
        (obj.masl_cor==nil or (obj.masl_cor~=nil and attachedID~=obj.masl_cor.id) )and 
        (obj.fitil_16_1==nil or (obj.fitil_16_1~=nil and attachedID~=obj.fitil_16_1.id) )and 
        attachedID~=-1 then
          CreatePlashechka("10000")
        end;  
        if   attachedID==-1 then
          CreatePlashechka("20006")
        end;  
      end;
    end;
  end
end
