XRWS           §
  Ÿ  ¥kext_01.cat ext_01.dat md/kuertee_loot_mining.xml 24275 1793294410 e0112d44935f01ba4752e01cec300330
md/kuertee_loot_mining_config.xml 7338 1793195316 ce5075161c2c38e2e2b31ce926bb5147
t/0001-l007.xml 3702 1758813822 89ca4e41281e102d84beedac0a41ee17
t/0001-l033.xml 2794 1758335560 08d72792d811c517be132633571b7e09
t/0001-l086.xml 1981 1758335568 d1576a5b20078d1c95287c70ea290162
t/0001.xml 2257 1782840152 d557ad102e33b1f189db359298166e32
<?xml version="1.0" encoding="utf-8"?>
<mdscript name="Kuertee_loot_mining" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
	<cues>
		<cue name="LootMining" namespace="this">
			<conditions>
				<event_cue_signalled cue="md.Setup.Start" />
			</conditions>
			<actions>
				<set_value name="$DebugChance" exact="100" />
				<set_value name="$UserLootTargetingAI" exact="true" />
				<set_value name="$UserMoreEfficientInventoryLootMining" exact="true" />
				<set_value name="$UserNativeInventoryLootDropMultiplier" exact="2" />
				<set_value name="$UserMissingInventoryLootDropMultiplier" exact="1" />
			</actions>
			<cues>
				<cue name="OnGameLoad" instantiate="true">
					<conditions>
						<event_cue_signalled cue="md.Setup.Start" />
					</conditions>
					<actions>
						<set_value name="$DebugChance" exact="0" />
						<debug_text text="'$DebugChance %s'.[$DebugChance]" />
					</actions>
				</cue>

				<cue name="InitTargets">
					<actions>
						<set_value name="$AsteroidBeingMined" exact="null" />
						<set_value name="$LastActivePosition" exact="null" />
						<set_value name="$LastTarget" exact="null" />
						<set_value name="$LastTargetWare" exact="null" />
					</actions>
				</cue>

				<cue name="InitMission">
					<actions>
						<set_value name="$MissionTargets" exact="[]" />
						<set_value name="$DroppedDataByWare" exact="table[]" />
						<set_value name="$CollectedCount" exact="0" />
					</actions>
				</cue>

				<cue name="TargetSet" instantiate="true">
					<conditions>
						<check_any>
							<check_all comment="player attacked targeted asteroid">
								<event_player_attacked_object />
								<check_value value="event.param != $AsteroidBeingMined" />
								<check_value value="event.param.isclass.asteroid" />
								<check_value value="event.param.drop" />
								<check_value value="event.param.wares.count" />
								<check_value value="player.container" />
								<check_value value="not player.container.turrets.operational.list.indexof.{event.param3.{2}}" comment="attacked asteroid with main weapon and not a turret weapon" />
							</check_all>
							<check_all>
								<event_player_changed_target />
								<check_value value="player.occupiedship" />
								<check_value value="$UserLootTargetingAI" />
								<check_any>
									<check_value value="not event.param" />
									<check_value value="event.param.isclass.collectable" />
									<check_value value="event.param.isclass.asteroid" />
								</check_any>
							</check_all>
						</check_any>
					</conditions>
					<actions>
						<debug_text text="'TargetSet.static.$lastInstance %s event.name %s param %s'.[[@TargetSet.static.$lastInstance], event.name, event.param]" chance="$DebugChance" />
						<do_if value="TargetSet.static.$lastInstance?">
							<debug_text text="'    cancel_cue %s'.[[TargetSet.static.$lastInstance]]" chance="$DebugChance" />
							<cancel_cue cue="TargetSet.static.$lastInstance" />
						</do_if>
						<set_value name="TargetSet.static.$lastInstance" exact="TargetSet" />
						<do_if value="not event.param">
							<remove_value name="TargetSet.static.$lastInstance" />
							<cancel_cue cue="TargetSet" />
						</do_if>
						<do_else>
							<do_if value="event.name == 'event_player_attacked_object'">
								<do_if value="$LastTargetWare != event.param.wares.{1}">
									<set_value name="$DroppedDataByWare" exact="table[]" />
								</do_if>
								<set_value name="$LastTargetWare" exact="event.param.wares.{1}" />
								<set_value name="$AsteroidBeingMined" exact="event.param" />
								<debug_text text="'    $LastTargetWare %s $AsteroidBeingMined %s'.[$LastTargetWare, $AsteroidBeingMined]" chance="$DebugChance" />
							</do_if>
							<do_elseif value="event.name == 'event_player_changed_target'">
								<debug_text text="'    event.param.class %s drop %s'.[@event.param.class, @event.param.drop]" chance="$DebugChance" />
								<do_if value="(not event.param) or (not event.param.isclass.[class.asteroid, class.collectable])">
									<reset_cue cue="InitTargets" />
									<remove_value name="TargetSet.static.$lastInstance" />
									<cancel_cue cue="TargetSet" />
								</do_if>
								<do_elseif value="event.param.isclass.collectable or (event.param.isclass.asteroid and (not event.param.drop))">
									<!-- target is a collectable -->
									<do_if value="$LastTargetWare != event.param.wares.{1}">
										<set_value name="$DroppedDataByWare" exact="table[]" />
									</do_if>
									<set_value name="$LastTargetWare" exact="event.param.wares.{1}" />
									<debug_text text="'    $LastTargetWare %s'.[$LastTargetWare]" chance="$DebugChance" />
									<signal_cue_instantly cue="FindMissionTargets" />
									<signal_cue cue="UpdateMission" />
									<!-- revert previous target -->
									<do_if value="$LastTarget
										and player.entity.hascontext.{$LastTarget.sector}
										and player.entity.distanceto.{$LastTarget} le player.container.maxradarrange">
										<debug_text text="'    set_player_target %s'.[$LastTarget]" chance="$DebugChance" />
										<do_if value="player.target != $LastTarget">
											<set_player_target object="$LastTarget" />
										</do_if>
										<set_value name="$LastTarget" exact="null" />
									</do_if>
									<do_else>
										<clear_player_target />
									</do_else>
								</do_elseif>
								<do_else>
									<set_value name="$LastTarget" exact="event.param" />
									<do_if value="$LastTarget and $LastTarget.isclass.asteroid and $LastTarget.drop and $LastTarget.wares.count">
										<do_if value="$LastTargetWare != $LastTarget.wares.{1}">
											<set_value name="$DroppedDataByWare" exact="table[]" />
										</do_if>
										<set_value name="$LastTargetWare" exact="$LastTarget.wares.{1}" />
										<set_value name="$AsteroidBeingMined" exact="$LastTarget" />
										<debug_text text="'    $LastTargetWare %s $AsteroidBeingMined %s'.[$LastTargetWare, $AsteroidBeingMined]" chance="$DebugChance" />
									</do_if>
								</do_else>
							</do_elseif>
						</do_else>
					</actions>
					<cues>
						<cue name="CleanUp">
							<conditions>
								<check_any>
									<event_cue_signalled />
									<check_all>
										<event_object_changed_zone object="player.entity" />
										<check_value value="$LastActivePosition" />
										<check_any>
											<check_value value="not player.sector" />
											<check_value value="player.entity.distanceto.[player.sector, $LastActivePosition] gt player.container.maxradarrange * 0.5" />
										</check_any>
									</check_all>
									<event_player_stopped_control />
								</check_any>
							</conditions>
							<actions>
								<debug_text text="'event.name %s TargetSet %s'.[event.name, [TargetSet]]" chance="$DebugChance" />
								<reset_cue cue="InitTargets" />
								<remove_value name="TargetSet.static.$lastInstance" />
								<cancel_cue cue="TargetSet" />
							</actions>
						</cue>

						<cue name="DebugChat_TargetSet">
							<conditions>
								<event_ui_triggered screen="'Chat_Window_API'" control="'text_entered'" />
								<check_any>
									<check_value value="event.param3.$text == 'debug lootm TargetSet'" />
									<check_value value="event.param3.$text == 'debug lootm DroppedDataByWare'" />
									<check_value value="event.param3.$text == 'debug lootm target'" />
								</check_any>
							</conditions>
							<actions>
								<debug_text text="event.param3" />
								<do_if value="event.param3.$text == 'debug lootm target'">
									<debug_text text="'player.target class %s wares %s drop %s'.[player.target.class, player.target.wares.list, player.target.drop]" />
								</do_if>
								<do_if value="event.param3.$text == 'debug lootm DroppedDataByWare'">
									<debug_text text="'$DroppedDataByWare %s'.[$DroppedDataByWare]" />
									<do_for_each name="$ware" valuename="$value" in="$DroppedDataByWare">
										<debug_text text="'$ware %s %s'.[$ware, $value]" />
									</do_for_each>
								</do_if>
								<do_if value="event.param3.$text == 'debug lootm TargetSet'">
									<debug_text text="'TargetSet %s'.[[TargetSet]]" />
								</do_if>
								<reset_cue cue="this"/>
							</actions>
						</cue>

						<cue name="ObjectsDropped" instantiate="true">
							<conditions>
								<event_object_dropped_objects object="$AsteroidBeingMined" check="false" />
							</conditions>
							<actions>
								<debug_text text="event.name" chance="$DebugChance" />
								<create_position name="$LastActivePosition" space="player.sector" object="player.entity" />
								<append_list_elements name="$MissionTargets" other="event.param" />
								<debug_text text="'$AsteroidBeingMined.hullpercentage %s'.[$AsteroidBeingMined.hullpercentage]" chance="$DebugChance" />
								<do_if value="not $AsteroidBeingMined.hullpercentage">
									<signal_cue_instantly cue="MakeMiningMoreEfficient" param="event.param" />
									<do_if value="player.target == $AsteroidBeingMined">
										<signal_cue cue="TargetNewAsteroid" />
									</do_if>
								</do_if>
								<signal_cue cue="UpdateMission" />
							</actions>
						</cue>
					</cues>
				</cue>

				<cue name="MakeMiningMoreEfficient" instantiate="true">
					<conditions>
						<event_cue_signalled />
						<check_value value="$UserMoreEfficientInventoryLootMining" />
					</conditions>
					<delay exact="0.25s" comment="allow time to populate .wares" />
					<actions>
						<set_value name="$droppedObjects" exact="event.param" />
						<debug_text text="'$droppedObjects %s'.[$droppedObjects]" chance="$DebugChance" />
						<sort_list list="$droppedObjects" sortbydistanceto="player.entity" />
						<create_position name="$droppedObjectPos" space="$droppedObjects.{1}.sector" object="$droppedObjects.{1}" max="$droppedObjects.{1}.distanceto.{player.entity}" />

						<set_value name="$dataByExistingWareInDrop" exact="table[]" />
						<set_value name="$missingWaresInDrop" exact="$DroppedDataByWare.keys.list" />
						<do_for_each name="$droppedObject" in="$droppedObjects">
							<do_if value="$droppedObject.wares.count">
								<do_for_each name="$ware" in="$droppedObject.wares.list">
									<set_value name="$count" exact="$droppedObject.wares.{$ware}.count" />
									<set_value name="$idx" exact="$missingWaresInDrop.indexof.{$ware}" />
									<debug_text text="'$droppedObject %s $ware %s $count %s $idx %s'.[$droppedObject, $ware, $count, $idx]" chance="$DebugChance" />
									<do_if value="$idx">
										<remove_value name="$missingWaresInDrop.{$idx}" />
									</do_if>
									<do_elseif value="(not $dataByExistingWareInDrop.{$ware}?) or $dataByExistingWareInDrop.{$ware}.$count gt $count">
										<set_value name="$dataByExistingWareInDrop.{$ware}" exact="table[$count = $count, $macro = $droppedObject.macro]" />
									</do_elseif>
								</do_for_each>
							</do_if>
						</do_for_each>
						<debug_text text="'$DroppedDataByWare %s'.[$DroppedDataByWare]" chance="$DebugChance" />
						<debug_text text="'$dataByExistingWareInDrop %s $missingWaresInDrop %s'.[$dataByExistingWareInDrop, $missingWaresInDrop]" chance="$DebugChance" />

						<do_if value="$UserMissingInventoryLootDropMultiplier != 0 and $missingWaresInDrop.count">
							<do_for_each name="$ware" in="$missingWaresInDrop">
								<!-- missing $ware that was previously dropped, create_object with this ware for collection -->
								<get_safe_pos result="$safepos" sector="player.sector" value="$droppedObjectPos" />
								<debug_text text="'$safepos.distanceto.{$droppedObjectPos} %s player.entity'.[$safepos.distanceto.{$droppedObjectPos}, player.entity.distanceto.[$droppedObjects.{1}.sector, $safepos]]" chance="$DebugChance" />
								<create_object name="$extraCollectable" macro="$DroppedDataByWare.{$ware}.$macro" sector="player.sector">
									<position value="$safepos" />
								</create_object>
								<append_to_list name="$MissionTargets" exact="$extraCollectable" />
								<!-- remove any cargo -->
								<do_for_each name="$ware" in="$extraCollectable.wares.list">
									<remove_cargo object="$extraCollectable" ware="$ware" exact="$extraCollectable.wares.{$ware}.count" />
								</do_for_each>
								<!-- add missing $ware -->
								<add_cargo object="$extraCollectable" ware="$ware" exact="$DroppedDataByWare.{$ware}.$count * $UserMissingInventoryLootDropMultiplier" />
								<debug_text text="'$UserMissingInventoryLootDropMultiplier %s $extraCollectable %s $ware %s count %s'.[$UserMissingInventoryLootDropMultiplier, $extraCollectable, $ware, $extraCollectable.wares.{$ware}.count]" chance="$DebugChance" />
							</do_for_each>
						</do_if>

						<do_if value="$UserNativeInventoryLootDropMultiplier != 0">
							<do_for_each name="$droppedObject" in="$droppedObjects">
								<do_if value="$droppedObject.wares.count">
									<debug_text text="'$droppedObject.class %s wares %s'.[$droppedObject.class, $droppedObject.wares.list]" chance="$DebugChance" />
									<do_for_each name="$ware" in="$droppedObject.wares.list">
										<do_if value="$dataByExistingWareInDrop.{$ware}? and $DroppedDataByWare.{$ware}?">
											<set_value name="$count" exact="$droppedObject.wares.{$ware}.count" />
											<set_value name="$targetCount" exact="$count * $UserNativeInventoryLootDropMultiplier" />
											<do_if value="$targetCount lt $count">
												<remove_cargo object="$droppedObject" ware="$ware" exact="$count - $targetCount" />
											</do_if>
											<do_elseif value="$targetCount gt $count">
												<add_cargo object="$droppedObject" ware="$ware" exact="$targetCount - $count" />
											</do_elseif>
											<debug_text text="'$UserNativeInventoryLootDropMultiplier %s $droppedObject %s $ware %s count %s new %s'.[$UserNativeInventoryLootDropMultiplier, $droppedObject, $ware, $count, $droppedObject.wares.{$ware}.count]" chance="$DebugChance" />
										</do_if>
									</do_for_each>
								</do_if>
							</do_for_each>
						</do_if>

						<do_for_each name="$ware" valuename="$data" in="$dataByExistingWareInDrop">
							<debug_text text="'$DroppedDataByWare.{%s} %s $data %s'.[$ware, @$DroppedDataByWare.{$ware}, $data]" chance="$DebugChance" />
							<do_if value="(not $DroppedDataByWare.{$ware}?) or $DroppedDataByWare.{$ware}.$count gt $data.$count">
								<set_value name="$DroppedDataByWare.{$ware}" exact="table[$count = $data.$count, $macro = $data.$macro]" />
							</do_if>
						</do_for_each>
						<debug_text text="'$DroppedDataByWare (new) %s'.[$DroppedDataByWare]" chance="$DebugChance" />
					</actions>
				</cue>

				<cue name="TargetNewAsteroid" instantiate="true">
					<conditions>
						<event_cue_signalled />
					</conditions>
					<actions>
						<set_value name="$LastTarget" exact="null" />
						<find_object groupname="$otherAsteroids" class="class.asteroid" space="player.sector" sortbydistanceto="player.entity" multiple="true">
							<match_distance object="player.entity" max="player.container.maxradarrange" />
						</find_object>
						<debug_text text="'$otherAsteroids %s'.[$otherAsteroids.count]" chance="$DebugChance" />
						<do_if value="$otherAsteroids.count">
							<set_value name="$otherAsteroid_withWare" exact="null" />
							<do_for_each name="$otherAsteroid" in="$otherAsteroids">
								<do_if value="$otherAsteroid.drop">
									<do_if value="$LastTargetWare">
										<do_if value="$otherAsteroid.wares.{$LastTargetWare}.exists">
											<debug_text text="'set_player_target %s $LastTargetWare %s'.[$otherAsteroid, $LastTargetWare]" chance="$DebugChance" />
											<set_player_target object="$otherAsteroid" />
											<break />
										</do_if>
									</do_if>
									<do_elseif value="$otherAsteroid.wares.count">
										<debug_text text="'set_player_target %s wares.count %s'.[$otherAsteroid, $otherAsteroid.wares.count]" chance="$DebugChance" />
										<do_if value="player.target != $otherAsteroid">
											<set_player_target object="$otherAsteroid" />
										</do_if>
										<break />
									</do_elseif>
								</do_if>
							</do_for_each>
						</do_if>
					</actions>
				</cue>

				<cue name="FindMissionTargets" instantiate="true">
					<conditions>
						<event_cue_signalled />
					</conditions>
					<actions>
						<set_value name="$waresInTarget" exact="player.target.wares.list" />
						<debug_text text="'$waresInTarget %s'.[$waresInTarget]" chance="$DebugChance" />
						<clear_list list="$MissionTargets" />
						<find_object groupname="$collectables" class="[class.asteroid, class.collectable]" space="player.sector" sortbydistanceto="player.entity" multiple="true">
							<match_distance object="player.entity" max="player.container.maxradarrange" />
							<!-- <match_any_cargo wares="$waresInTarget"/> -->
						</find_object>
						<debug_text text="'$collectables %s'.[$collectables]" chance="$DebugChance" />
						<do_for_each name="$collectable" in="$collectables" counter="$idx">
							<do_if value="((not $collectable.isclass.asteroid) or (not $collectable.drop))">
								<do_for_each name="$ware" in="$waresInTarget">
									<do_if value="$collectable.wares.{$ware}.exists">
										<append_to_list name="$MissionTargets" exact="$collectable" />
										<break />
									</do_if>
								</do_for_each>
							</do_if>
						</do_for_each>
						<debug_text text="'$MissionTargets %s'.[$MissionTargets.count]" chance="$DebugChance" />
					</actions>
				</cue>

				<cue name="UpdateMission" instantiate="true">
					<conditions>
						<event_cue_signalled />
					</conditions>
					<actions>
						<do_if value="UpdateMission.static.$lastInstance? and UpdateMission.static.$lastInstance.state == cuestate.complete">
							<cancel_cue cue="UpdateMission.static.$lastInstance" />
						</do_if>
						<set_value name="UpdateMission.static.$lastInstance" exact="UpdateMission" />
					</actions>
					<delay exact="1s" />
					<actions>
						<do_if value="not $MissionTargets.count">
							<signal_cue cue="CleanUpMission" />
						</do_if>
						<do_else>
							<debug_text text="'$LootMining.hasmission %s'.[LootMining.hasmission]" chance="$DebugChance" />
							<do_for_each name="$missionTarget" in="$MissionTargets" counter="$idx" reverse="true">
								<do_if value="not $missionTarget.exists">
									<remove_value name="$MissionTargets.{$idx}" />
								</do_if>
							</do_for_each>
							<create_group groupname="$missionGroup" />
							<add_to_group groupname="$missionGroup" list="$MissionTargets" />
							<sort_group group="$missionGroup" sortbydistanceto="player.entity" />

							<do_if value="not LootMining.hasmission">
								<create_mission cue="LootMining"
									name="{111213, 1000}"
									faction="faction.player"
									type="missiontype.guidance">
									<briefing>
										<objective step="1" action="objective.collect" group="$missionGroup" />
									</briefing>
								</create_mission>
							</do_if>

							<set_objective cue="LootMining" step="1"
								action="objective.collect"
								group="$missionGroup"
								updatebriefing="true">
								<progress progress="$CollectedCount" max="$CollectedCount + $MissionTargets.count" />
							</set_objective>
						</do_else>
						<remove_value name="UpdateMission.static.$lastInstance" />
					</actions>
				</cue>

				<cue name="CleanUpMission" instantiate="true">
					<conditions>
						<check_any>
							<event_cue_signalled />
							<event_mission_aborted cue="LootMining" />
							<check_all>
								<event_object_changed_zone object="player.entity" />
								<check_value value="$LastActivePosition" />
								<check_any>
									<check_value value="not player.sector" />
									<check_value value="player.entity.distanceto.[player.sector, $LastActivePosition] gt player.container.maxradarrange * 0.5" />
								</check_any>
							</check_all>
							<event_player_stopped_control />
						</check_any>
						<check_value value="LootMining.hasmission" />
					</conditions>
					<actions>
						<debug_text text="event.name" chance="$DebugChance" />
						<do_if value="LootMining.hasguidance and md.Kuertee_AMFL.ReactivatePreviousMission?">
							<signal_cue cue="md.Kuertee_AMFL.ReactivatePreviousMission" />
						</do_if>
						<reset_cue cue="InitMission" />
						<remove_mission cue="LootMining" />
					</actions>
				</cue>

				<cue name="MissionTargetCollected" instantiate="true">
					<conditions>
						<event_player_collected_ware />
						<debug_text text="'event %s param %s param2 %s param3 %s class %s knownname %s'.[event.name, @event.param.idcode, event.param2, event.param3, @event.param3.class, @event.param3.knownname]" debugchance="$DebugChance" />
						<check_value value="$MissionTargets.indexof.{event.param3}" />
					</conditions>
					<actions>
						<create_position name="$LastActivePosition" space="player.sector" object="player.entity" />
						<set_value name="$CollectedCount" operation="add" exact="1" />
						<debug_text text="'$CollectedCount %s'.[$CollectedCount]" chance="$DebugChance" />
						<signal_cue cue="UpdateMission" />
					</actions>
				</cue>

				<cue name="User_DebugEnableDisable" namespace="this">
					<conditions>
						<event_ui_triggered screen="'Chat_Window_API'" control="'text_entered'" />
						<check_any>
							<check_value value="event.param3.$text == 'debug lootm enable'" />
							<check_value value="event.param3.$text == 'debug lootm disable'" />
							<check_value value="event.param3.$text == 'debug lootm'" />
						</check_any>
					</conditions>
					<actions>
						<debug_text text="event.param3" />
						<do_if value="event.param3.$text == 'debug lootm enable'">
							<set_value name="$DebugChance" exact="100" />
							<raise_lua_event name="'Chat_Window_API.Print'" param="'debug enabled: ' + ($DebugChance > 0)" />
						</do_if>
						<do_if value="event.param3.$text == 'debug lootm disable'">
							<set_value name="$DebugChance" exact="0" />
							<raise_lua_event name="'Chat_Window_API.Print'" param="'debug enabled: ' + ($DebugChance > 0)" />
						</do_if>
						<do_if value="event.param3.$text == 'debug lootm'">
							<raise_lua_event name="'Chat_Window_API.Print'" param="'debug enabled: ' + ($DebugChance > 0)" />
						</do_if>
						<reset_cue cue="this" />
					</actions>
				</cue>

				<cue name="DeactivateMod">
					<conditions>
						<check_any>
							<event_cue_signalled />
							<check_all>
								<event_ui_triggered screen="'OptionsMenu'" control="'uix_deactivate_mod'" />
								<check_value value="event.param3 == 'kuerteeLootMining'" />
							</check_all>
							<check_all>
								<event_ui_triggered screen="'Chat_Window_API'" control="'text_entered'" />
								<check_value value="event.param3.$text == 'kuertee deactivate'" />
							</check_all>
						</check_any>
					</conditions>
					<actions>
						<debug_text text="event.name" />
						<cancel_cue cue="LootMining" />
					</actions>
				</cue>

				<cue name="DebugChat" namespace="this">
					<conditions>
						<event_ui_triggered screen="'Chat_Window_API'" control="'text_entered'" />
						<check_any>
							<check_value value="event.param3.$text == 'debug kuertee mission'" />
						</check_any>
					</conditions>
					<actions>
						<debug_text text="event.param3" />
						<do_if value="event.param3.$text == 'debug kuertee mission'">
							<debug_text text="'LootMining hasmission %s'.[LootMining.hasmission]" />
						</do_if>
						<reset_cue cue="this"/>
					</actions>
				</cue>
			</cues>
		</cue>
	</cues>
</mdscript>
<?xml version="1.0" encoding="utf-8"?>
<mdscript name="Kuertee_loot_mining_config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
	<cues>
		<cue name="StartSMO" instantiate="true">
			<conditions>
				<event_cue_signalled cue="md.Simple_Menu_Options.Reloaded"/>
			</conditions>
			<actions>
				<!-- <debug_text text="'signal_cue_instantly ' + @md.Simple_Menu_API.Register_Options_Menu" /> -->
				<signal_cue_instantly cue="md.Simple_Menu_API.Register_Options_Menu"
					param="table[
						$id = 'Kuertee_loot_mining_extension_options_menu',
						$columns = 2,
						$title = {111213, 688900},
						$onOpen = BuildOptionsMenu
					]" />
				<cancel_cue cue="this" />
			</actions>
		</cue>
		<cue name="BuildOptionsMenu" instantiate="true">
			<conditions>
				<event_cue_signalled />
			</conditions>
			<actions>
				<!-- <t id="688902">Loot targeting AI</t>
				<t id="688903">Manually targeting loot will create a mission that targets the same loot.</t>
				<t id="688904">More efficient inventory loot mining</t>
				<t id="688905">Previously dropped inventory loot are dropped from asteroids that don't or are doubled from asteroids that do.</t>
				<t id="688906">Native inventory loot drop multiplier</t>
				<t id="688907">Multiplier for inventory loot from asteroids that drop them. More efficient inventory loot mining is required.</t>
				<t id="688908">Missing loot drop multiplier</t>
				<t id="688909">Multiplier for inventory loot from asteroids that don't drop them. More efficient inventory loot mining is required.</t>
				<t id="688910">Loot targeting AI max targets</t>
				<t id="688911">The maximum number of targets for the Loot targeting AI.</t>
				<t id="688912">Software is required?</t>
				<t id="688913">The Mineral Finder and Collectible Locator are required for the ship to auto-target mineable asteroids and collectible loot.</t> -->
				<signal_cue_instantly cue="md.Simple_Menu_API.Add_Row"/>
				<signal_cue_instantly cue="md.Simple_Menu_API.Make_Text" param="table[$col=1, $text={111213, 688902}]"/>
				<signal_cue_instantly
					cue = "md.Simple_Menu_API.Make_CheckBox"
					param = "table[
						$id = 'UserLootTargetingAI',
						$checked = md.Kuertee_loot_mining.LootMining.$UserLootTargetingAI,
						$col = 2,
						$width = 'Helper.standardButtonHeight', $height = 'Helper.standardButtonHeight',
						$default = true,
						$mouseOverText = {111213, 688903} + ' ' + {1001, 2661} + ': ' + {1001, 2648},
						$onClick = OnSMOCheckboxChange
					]"
					comment = "2648 = 'on', 2649 = 'off'"
					/>
				<signal_cue_instantly cue="md.Simple_Menu_API.Add_Row"/>
				<signal_cue_instantly cue="md.Simple_Menu_API.Make_Text" param="table[$col=1, $text={111213, 688904}]"/>
				<signal_cue_instantly
					cue = "md.Simple_Menu_API.Make_CheckBox"
					param = "table[
						$id = 'UserMoreEfficientInventoryLootMining',
						$checked = md.Kuertee_loot_mining.LootMining.$UserMoreEfficientInventoryLootMining,
						$col = 2,
						$width = 'Helper.standardButtonHeight', $height = 'Helper.standardButtonHeight',
						$default = true,
						$mouseOverText = {111213, 688905} + ' ' + {1001, 2661} + ': ' + {1001, 2648},
						$onClick = OnSMOCheckboxChange
					]"/>
				<do_if value="md.Kuertee_loot_mining.LootMining.$UserMoreEfficientInventoryLootMining">
					<signal_cue_instantly cue="md.Simple_Menu_API.Add_Row"/>
					<signal_cue_instantly cue="md.Simple_Menu_API.Make_Text" param="table[$col=1, $text={111213, 688906}]"/>
					<signal_cue_instantly
						cue = "md.Simple_Menu_API.Make_Slider"
						param = "table[
							$id = 'UserNativeInventoryLootDropMultiplier',
							$start = md.Kuertee_loot_mining.LootMining.$UserNativeInventoryLootDropMultiplier,
							$col = 2,
							$text = table[$text=''],
							$min = 1, $max = 5, $prefix='x',
							$default = 2,
							$mouseOverText = {111213, 688907} + ' ' + {1001, 2661} + ': 2.',
							$onSliderCellChanged = OnSMOSliderChange
						]"/>
					<signal_cue_instantly cue="md.Simple_Menu_API.Add_Row"/>
					<signal_cue_instantly cue="md.Simple_Menu_API.Make_Text" param="table[$col=1, $text={111213, 688908}]"/>
					<signal_cue_instantly
						cue = "md.Simple_Menu_API.Make_Slider"
						param = "table[
							$id = 'UserMissingInventoryLootDropMultiplier',
							$start = md.Kuertee_loot_mining.LootMining.$UserMissingInventoryLootDropMultiplier,
							$col = 2,
							$text = table[$text=''],
							$min = 0, $max = 5, $prefix='x',
							$default = 2,
							$mouseOverText = {111213, 688909} + ' ' + {1001, 2661} + ': 1.',
							$onSliderCellChanged = OnSMOSliderChange
						]"/>
				</do_if>
				<signal_cue_instantly cue="md.Simple_Menu_API.Add_Row"/>
				<signal_cue_instantly cue="md.Simple_Menu_API.Make_Text" param="table[$col=1, $text={111213, 688901}, $color='Helper.color.red']"/>
				<signal_cue_instantly
					cue = "md.Simple_Menu_API.Make_CheckBox"
					param = "table[
						$id = 'DebugChance',
						$checked = if md.Kuertee_loot_mining.LootMining.$DebugChance == 100 then true else false,
						$col = 2,
						$width = 'Helper.standardButtonHeight', $height = 'Helper.standardButtonHeight',
						$bgColor = 'Helper.color.red',
						$onClick = OnSMOCheckboxChange
					]"/>
			</actions>
		</cue>
		<cue name="OnSMOSliderChange" instantiate="true">
			<conditions>
				<event_cue_signalled />
			</conditions>
			<actions>
				<!-- <debug_text text="event.param.$id + ' to: ' + @event.param.$value + ' or ' + @event.param.$checked" /> -->
				<debug_text text="event.param.$id + ' pre: ' + md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" chance="md.Kuertee_loot_mining.LootMining.$DebugChance"/>
				<set_value name="md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" exact="event.param.$value" />
				<debug_text text="event.param.$id + ' post: ' + md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" chance="md.Kuertee_loot_mining.LootMining.$DebugChance"/>
			</actions>
		</cue>
		<cue name="OnSMOCheckboxChange" instantiate="true">
			<conditions>
				<event_cue_signalled />
			</conditions>
			<actions>
				<!-- <debug_text text="event.param.$id + ' to: ' + @event.param.$value + ' or ' + @event.param.$checked" /> -->
				<debug_text text="event.param.$id + ' pre: ' + md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" chance="md.Kuertee_loot_mining.LootMining.$DebugChance"/>
				<do_if value="event.param.$id == 'DebugChance'">
					<set_value name="md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" exact="if event.param.$checked then 100 else 0" />
					<signal_cue_instantly cue="md.Simple_Menu_API.Refresh_Menu"/>
				</do_if>
				<do_else>
					<set_value name="md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" exact="event.param.$checked" />
					<do_if value="event.param.$id == 'UserMoreEfficientInventoryLootMining'">
						<signal_cue_instantly cue="md.Simple_Menu_API.Refresh_Menu"/>
					</do_if>
				</do_else>
				<debug_text text="event.param.$id + ' post: ' + md.Kuertee_loot_mining.LootMining.{'$' + event.param.$id}" chance="md.Kuertee_loot_mining.LootMining.$DebugChance"/>
			</actions>
		</cue>
	</cues>
</mdscript>
<?xml version="1.0" encoding="UTF-8" ?>
<!--  translated into russian by Alex5Not   -->
<diff><add sel="/language">
	<!-- "kuertee loot mining" = "klm" = "11 12 13" in https://www.boxentriq.com/code-breaking/letters-to-numbers -->
	<page id="111213" voice="no">
		<!-- миссии -->
		<t id="1000">Сбор ресурсов</t>
		<t id="1001">Цель собираемый объект</t>
		<t id="1002">Собрано: %1(ware)</t>
		<t id="1003">(set_objective text)%1(ware), %2(cargotype): %3(count)</t>
		<t id="1004">Показать текущее задание</t>
		<t id="1005">Показать задание сбора ресурсов</t>
		<t id="1006">Активируйте и выберите астероид для сбора</t>
		<t id="1007">Цель добываемый астероид</t>
		<t id="1008">Миссия выполнена: %1(original mission name)</t>
		<!-- Програмное Обеспечение -->
		<t id="2000">Детектор Минералов</t>
		<t id="2001">Представляем Детектор Минералов — интуитивно понятный программный инструмент, который помогает космическим добытчикам легко находить близлежащие астероиды, пригодные для разработки.</t>
		<t id="2002">Локатор добычи</t>
		<t id="2003">Локатор добычи - это удобный программный инструмент, предназначенный для того, чтобы помочь исследователям космоса легко находить близлежащую добычу и предметы сбора.</t>
		<!-- настройки -->
		<t id="688900">kuertee: Сбор ресурсов</t>
		<t id="688901">Отладка</t>
		<t id="688902">Режим ИИ поиска добычи</t>
		<t id="688903">При ручном наведении цели на ресурс будет создана миссия, целью которой будет тот же ресурс.</t>
		<t id="688904">Более эффективная добыча ресурсов</t>
		<t id="688905">Ранее выпавший ресурс выпадает с астероидов, в которых нет такого ресурса, или удваивается с астероидов, в которых такой ресурс есть.</t>
		<t id="688906">Множитель выпадения добычи</t>
		<t id="688907">Множитель добычи ресурссов с астероидов, в которых они есть. Требуется "Более эффективная добыча ресурсов".</t>
		<t id="688908">Множитель отсутствующей добычи</t>
		<t id="688909">Множитель добычи ресурсов с астероидов, в котрых их нет. Требуется "Более эффективная добыча ресурсов".</t>
		<t id="688910">Максимум целей "Режима ИИ поиска добычи"</t>
		<t id="688911">Максимальное колличество целей для "Режима ИИ поиска добычи".</t>
		<t id="688912">Требуется программное обеспечение?</t>
		<t id="688913">Детектор Минералов и Локатор добычи необходимы кораблю для автоматического наведения на астероиды, пригодные для добычи, и на сбор добычи.</t>
	</page>
</add></diff>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- english -->
<diff><add sel="/language">
	<!-- "kuertee loot mining" = "klm" = "11 12 13" in https://www.boxentriq.com/code-breaking/letters-to-numbers -->
<page id="111213" voice="no">
		<!-- mission -->
		<t id="1000">Récupération du butin</t>
		<t id="1001">Cibler un objet à récupérer</t>
		<t id="1002">Collecter : %1(marchandise)</t>
		<t id="1003">(set_objective text)%1(marchandise), %2(type de cargaison) : %3(quantité)</t>
		<t id="1004">Afficher la mission d'origine</t>
		<t id="1005">Afficher la mission de Récupération de butin</t>
		<t id="1006">Activer et cibler un astéroïde récupérable</t>
		<t id="1007">Cibler un astéroïde récupérable</t>
		<t id="1008">Mission accomplie : %1(nom de la mission d'origine)</t>
		<!-- logiciel -->
		<t id="2000">Détecteur de minéraux</t>
		<t id="2001">Le Détecteur de minéraux est un outil logiciel intuitif qui aide les mineurs spatiaux à localiser facilement les astéroïdes miniers à proximité.</t>
		<t id="2002">Localisateur d'objets récupérables</t>
		<t id="2003">Le Localisateur d'objets récupérables est un outil logiciel convivial conçu pour aider les explorateurs spatiaux à trouver facilement les butins et les objets à collectionner à proximité.</t>
		<!-- config -->
		<t id="688900">kuertee : Récupération de butin</t>
		<t id="688901">Journal de débogage</t>
		<t id="688902">IA de localisation de butin</t>
		<t id="688903">Le ciblage manuel du butin créera une mission qui ciblera le butin de même type.</t>
		<t id="688904">Récupération de butin d'inventaire plus efficace</t>
		<t id="688905">Les butins d'inventaire précédemment largués sont larguées à partir d'astéroïdes qui ne le font pas ou sont doublés à partir d'astéroïdes qui le font.</t>
		<t id="688906">Multiplicateur natif de largage de butin d'inventaire</t>
		<t id="688907">Multiplicateur pour les butins d'inventaire provenant d'astéroïdes qui les larguent. Un Récupération de butin d'inventaire plus efficace est requis.</t>
		<t id="688908">Multiplicateur de largage de butin manquant</t>
		<t id="688909">Multiplicateur pour les butins d'inventaire provenant d'astéroïdes qui ne les larguent pas. Un Récupération de butin d'inventaire plus efficace est requis.</t>
		<t id="688910">Nombre maximum de cibles pour l'IA de localisation de butin</t>
		<t id="688911">Le nombre maximum de cibles pour l'IA de localisation de butin.</t>
		<t id="688912">Le logiciel est-il requis ?</t>
		<t id="688913">Le Détecteur de minéraux et le Localisateur d'objets récupérables sont nécessaires pour que le vaisseau cible automatiquement les astéroïdes miniers et les butins récupérables.</t>
	</page>
</add></diff>
<?xml version="1.0" encoding="UTF-8" ?>
<diff><add sel="/language">
	<!-- "kuertee loot mining" = "klm" = "11 12 13" in https://www.boxentriq.com/code-breaking/letters-to-numbers -->
	<page id="111213" voice="no">
		<!-- mission -->
		<t id="1000">收集战利品</t>
		<t id="1001">瞄准一个可收集的物体</t>
		<t id="1002">收集: %1(ware)</t>
		<t id="1003">(set_objective text)%1(ware), %2(cargotype): %3(count)</t>
		<t id="1004">显示原始任务</t>
		<t id="1005">显示战利品收集任务</t>
		<t id="1006">激活并瞄准一个可收集的小行星</t>
		<t id="1007">瞄准一个可收集的小行星</t>
		<t id="1008">完成任务: %1(original mission name)</t>
		<!-- software -->
		<t id="2000">矿物搜寻器</t>。
		<t id="2001">矿物搜寻器是一个直观的软件工具，帮助太空矿工轻松找到附近可开采的小行星。</t>
		<t id="2002">收藏品定位器</t>
		<t id="2003">收藏品定位器是一个用户友好的软件工具，旨在帮助太空探险者轻松找到附近的战利品和收藏品。</t>
		<!-- config -->
		<t id="688900">kuertee: 收集战利品</t>
		<t id="688901">调试日志</t>
		<t id="688902">收集目标AI</t>
		<t id="688903">手动瞄准战利品将创建一个针对相同战利品的任务。</t>
		<t id="688904">更有效的库存战利品开采</t>
		<t id="688905">以前掉落的库存战利品是从不掉落的小行星上掉落的，或者是从掉落的小行星上翻倍的。</t>
		<t id="688906">本地库存战利品掉落倍率</t>
		<t id="688907">从小行星上掉落的库存战利品的乘数。需要更有效的库存战利品开采。</t>
		<t id="688908">缺少战利品掉落倍率</t>
		<t id="688909">不掉落的小行星的库存战利品的乘数。需要更有效的库存战利品开采。</t>
		<t id="688910">战利品瞄准AI最大目标数</t>
		<t id="688911">收集目标AI的最大目标数。</t>
	</page>
</add></diff>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- english -->
<diff><add sel="/language">
	<!-- "kuertee loot mining" = "klm" = "11 12 13" in https://www.boxentriq.com/code-breaking/letters-to-numbers -->
	<page id="111213" voice="no">
		<!-- mission -->
		<t id="1000">Loot Mining</t>
		<t id="1001">Target a collectable object</t>
		<t id="1002">Collect: %1(ware)</t>
		<t id="1003">(set_objective text)%1(ware), %2(cargotype): %3(count)</t>
		<t id="1004">Show original mission</t>
		<t id="1005">Show Loot Mining mission</t>
		<t id="1006">Activate and target a collectable asteroid</t>
		<t id="1007">Target a collectable asteroid</t>
		<t id="1008">Complete mission: %1(original mission name)</t>
		<!-- software -->
		<t id="2000">Mineral Finder</t>
		<t id="2001">Introducing the Mineral Finder is an intuitive software tool that helps space miners easily locate nearby mineable asteroids.</t>
		<t id="2002">Collectible Locator</t>
		<t id="2003">The Collectible Locator is a user-friendly software tool designed to help space explorers easily find nearby loot and collectibles.</t>
		<!-- config -->
		<t id="688900">kuertee: Loot mining</t>
		<t id="688901">Debug log</t>
		<t id="688902">Loot targeting AI</t>
		<t id="688903">Manually targeting loot will create a mission that targets the same loot.</t>
		<t id="688904">More efficient inventory loot mining</t>
		<t id="688905">Previously dropped inventory loot are dropped from asteroids that don't or are doubled from asteroids that do.</t>
		<t id="688906">Native inventory loot drop multiplier</t>
		<t id="688907">Multiplier for inventory loot from asteroids that drop them. More efficient inventory loot mining is required.</t>
		<t id="688908">Missing loot drop multiplier</t>
		<t id="688909">Multiplier for inventory loot from asteroids that don't drop them. More efficient inventory loot mining is required.</t>
		<t id="688910">Loot targeting AI max targets</t>
		<t id="688911">The maximum number of targets for the Loot targeting AI.</t>
		<t id="688912">Software is required?</t>
		<t id="688913">The Mineral Finder and Collectible Locator are required for the ship to auto-target mineable asteroids and collectible loot.</t>
	</page>
</add></diff><?xml version="1.0" encoding="utf-8"?>
<content id="" name="" author="kuertee" version="900" date="2026-11-01" save="false" description="" lastupdate="">
  <text language="" description="Loot mining&#13;&#10; https://www.nexusmods.com/x4foundations/mods/511&#13;&#10; by kuertee&#13;&#10; &#13;&#10; Mod effects:&#13;&#10; ============&#13;&#10; 1. Loot targeting:&#13;&#10; - Target asteroids or containers with loot will highlight other containers with the same loot.&#13;&#10; - After breaking a targeted asteroid, the nearest asteroid of the same type is auto-targeted.&#13;&#10; 2. More efficient mining:&#13;&#10; - After breaking an asteroid, other asteroids of the same type drops the same resources.&#13;&#10;"/>
</content>
