{$CLEO .cm}

:MyMission 
thread "MyMission" 
gosub @MissionStart 
if 
  wasted_or_busted 
then 
  gosub @MissionFailed 
end 
gosub @MissionCleanup 
end_thread 

:MissionStart 
gosub @MissionPassed 
return 

:MissionPassed
wait 500 
01E3: text_1number_styled 'M_PASSD' 0 5000 ms 1 // MISSION PASSED! 
return 

:MissionFailed 
00BA: text_styled 'M_FAIL' 5000 ms 1 // ~r~MISSION FAILED! 
return 

:MissionCleanup 
$ONMISSION = 0 // integer values 
mission_cleanup 
return 