scripted_gui = {

	Mission_Confirmation = {
		context_type = player_context
		
		window_name = "Mission_Confirmation_container"
		
		visible={
		check_variable = { ROOT.show_Mission_Confirmation > 0 }

		}
		
  
		effects = {
            mission_confirmation_ok_click = {
			
			
			
			var:show_Mission_Confirmation = {
		
			set_variable = {ROOT.r = random}
			multiply_variable = {ROOT.r = 100}
              
			If = { limit = {OR = {check_variable = {ROOT.operation_type@THIS = 1}
			                      check_variable = {ROOT.operation_type@THIS = 2}
								  check_variable = {ROOT.operation_type@THIS = 3}
								  check_variable = {ROOT.operation_type@THIS = 4}
								  check_variable = {ROOT.operation_type@THIS = 5}
								  check_variable = {ROOT.operation_type@THIS = 6}
								  check_variable = {ROOT.operation_type@THIS = 7}
								  check_variable = {ROOT.operation_type@THIS = 8}
								  check_variable = {ROOT.operation_type@THIS = 9}
								  }}			           
			  
            country_event = { id = espionage.news.370 days = 2 }  
            set_country_flag =  { flag = Spy_Action_Attempted days = 60 value = 1 }
            set_variable = {ROOT.network_strength@THIS = 0}
            set_country_flag = { flag = Being_Disrupted_By@ROOT value = 1}				

			}
			
			else_if = { limit = {OR = {check_variable = {ROOT.operation_type@THIS = 10}
			                      check_variable = {ROOT.operation_type@THIS = 11}
								  check_variable = {ROOT.operation_type@THIS = 12}
								  check_variable = {ROOT.operation_type@THIS = 13}
								  }}			  
			  
            country_event = { id = espionage.news.376 days = 2 }
            set_country_flag =  { flag = Spy_Action_Attempted days = 60 value = 1 }
            set_variable = {ROOT.network_strength@THIS = 0}	
            set_country_flag = { flag = Being_Disrupted_By@ROOT value = 1}			

		}   
			 
			
			else_if = { limit = { AND = {check_variable = { ROOT.operation_type@THIS = 14}
			       check_variable = { ROOT.r = ROOT.Success_Chance@THIS}}}
		    country_event = { id = espionage.news.361 days = 2 } 
					    ROOT = { 
			subtract_from_variable = { spies_available = 150}}  

				   
		}
		
		
		else_if = { limit = {
			
			AND = {check_variable = { ROOT.operation_type@THIS = 14}
			       check_variable = { ROOT.r < ROOT.Success_Chance@THIS}}}
		    country_event = { id = espionage.news.360 days = 2 }
			ROOT = { set_country_flag = { flag = currently_infiltrating}
			subtract_from_variable = { spies_available = 150}}
			}
			
			
	    else_if = { limit = {
			
			AND = {check_variable = { ROOT.operation_type@THIS = 14}
			       check_variable = { ROOT.r > ROOT.Success_Chance@THIS}}}
		    country_event = { id = espionage.news.361 days = 2 } 
		    ROOT = { 
			subtract_from_variable = { spies_available = 150}}   
		}
		
		
		}
		
		clear_variable = ROOT.show_Mission_Confirmation
		}
		
		
		
		mission_confirmation_cancel_click = {
		
		 clear_variable = show_Mission_Confirmation
		 clear_variable = ROOT.operation_type@THIS
		
		}
		
		
		 
		}
		
		triggers = {
	     
		
		
		
		}
		
		
		ai_enabled = {
            always = yes
        } 
		
		ai_check = {
        check_variable = { show_Mission_Confirmation > 0 }
        }
		ai_test_interval = 120
		ai_test_variance = 0.3

		
		
		ai_max_weight_taken_per_test = 1
		
		
		ai_weights = {
       mission_confirmation_ok_click = {
        weight = 1  
		
		ai_will_do = {
		
            factor = 1

        }}}
		
		
	
    
}}

