Mindustry

Mindustry

Not enough ratings
Requester Ammo Resupply
   
Award
Favorite
Favorited
Unfavorite
Tags: schematic
File Size
Posted
1.103 KB
25 Apr, 2023 @ 12:30pm
1 Change Note ( view )

Subscribe to download
Requester Ammo Resupply

Description
Made in Mindustryv7.

Remote ammo fillup. Switch dictates if it needs ammo.
Sorter = ammotype.

Binds One free flare Unit.

Link One scatter/Swarmer/ or Salvo for turret.
Supports linking container. Container takes priority.

Schematic:
bXNjaAF4nGNgYmBiYWDJS8xNZRAPSi0sTS0uSS1ScMzNzVcISi0uLSjIqWRgB4ol5mamMHAZWZqZGxmYGJsaMHCnpBYnF2UWlGTm5zEK+CampCpk5in4ZuallBaXFFWWmetxcQWl5uaXpCokgkxLy8zJKS3QUwguzyxJzlBIyUwuSSxJLVbITFPILFHIS01NKQYr1OMKzi8CucEWzC2pLEgFmuQENLdYwT8vVSGtKBVI5CQWpSqE5mWWAOV8MvOywVLFyYklQJ36weWJRblAWiG/SCE4MacMaDmQVVJaVJQKVB8M9BTQhmKFHKC+zLx0heT8vJLEzLzUIj0FZxhToSQxG+i4gqLM/KLMkkqgLcHJGam5iSWZyVZc0cn5Kamx0fpgCmh/fjqGKANbTmJSak4xA190MCjwdBxLShKTs2NZGPhzM5OL8nULivKTU4uL84sY2IrBIQKkwf5mYM8FiiempzIwMLAwgAAfAwPT2oo5T0NP9102EDm7wfGL9pqfDFNK0rx2a79ySQpTCORMe6nml1zwpuexz+3+Z/IfrM+tbpIVWnXlxr7nVs9l4u/fcbm4O97+1iq28gajifu2TGDgy/zHm8T4iHX1V52Iqvr9bO1HPXvvPlrkuCVRxkT9xOorNgL+B8TCRG8flEqLiLHhmBQ+bdZxGZVmJ4V5uw7y6CSHOPgEm1848Nlptee0uTL9i3UV1fbwXPm1vfRhinAL730Fc84mt418SrOqGXtOy9p7nSvT6PQUY7WzasmwdH/0u6FK/8cd7rhfji9d9XtYV7X9k3gyr/Mcc+vbE54LNqxYfpwhqeTeUYZJwntMHvBweUhdaZ/NvGWaTUz7raYfxhtsP1cWnHeYb75tPbfvjOusy720t6zr33JvTXqGqbrOpk+rG5hubrSRcXnYuGD/ij5tjkrF4j9cXh5csu9FdHm3/uZVWJH5TXXJS2//jtMbd4g6bGuzPrWxX9ZyEndNkvR/t+baGRqT/x/t+meWrH5l6qMehtW3bgvMnu/522CV6lXPZ0GTHbOULc7FmL/ac0l2pW3CzV3RXa5C33x26jrK5IQ6zM4M/2I75VaU39Ui76dpp1JmPD+c+vzDKUvxd9pedyLczYLDY4WN1n/fzZPQ9nObwoTFgl9rXGy3by/ycFMyPnhSnEk/6FTomb7QqX/mRDrxJ4eUm3g1mx+SeGwxrePJKgbdgyvXrVFYVqXjseLkZBczxSfG7nwBCfc4WDe0vzthGXHhQvQho9A97WKTZS4vFlFgnLVrUcz1jtdLN//b3+C06kQ51+Jn8yNU15ZPZX89y3jG1L0tU/Xs+gOZ5C1X1+4qV5Bj/v4h/fu8DRHNMrkfZjjtv21//tKHvbv8lX+YxG+236P/f9bkXy+uP7woLcp8PGqV6ZF9R0vE303bJHVXb5FGlfDerW9d/PKeHDEJs+ypYy7mnniDgRGYbBm5GBiZwCwGZiDFyMLIsI56BQI9Mj0DAMToExQ=

Logic:
#Remote Ammo Resupply jump desync notEqual randWait 0 #Prevent processor fighting by desyncing #Some one Time Values op rand randWait 0.48 wait randWait desync: sensor swarmE swarmer1 @ammoCapacity sensor salvoE salvo1 @ammoCapacity sensor scatterE scatter1 @ammoCapacity sensor containE container1 @x jump containerExists notEqual containE null jump scatterExists notEqual scatterE null jump salvoExists notEqual salvoE null jump swarmerExists notEqual swarmE null end containerExists: sensor sorterAmmo sorter1 @config sensor turretX container1 @x sensor turretY container1 @y sensor turretCap container1 @itemCapacity sensor turretTotal container1 sorterAmmo set turretID container1 jump ammoContain always salvoExists: set turretID salvo1 jump turretInfo always swarmerExists: set turretID swarmer1 jump turretInfo always scatterExists: set turretID scatter1 jump turretInfo always turretInfo: sensor turretX turretID @x sensor turretY turretID @y sensor turretCap turretID @ammoCapacity sensor turretTotal turretID @ammo jump ammoTime always ammoContain: sensor switchState switch1 @enabled sensor sorterAmmo sorter1 @config sensor sorterAmmo sorter1 @config op div halfAmmo turretCap 2 jump enableSwitch lessThanEq turretTotal halfAmmo jump switchOff equal switchState 0 jump switchOff greaterThanEq turretTotal turretCap jump firstBind always ammoTime: sensor switchState switch1 @enabled sensor sorterAmmo sorter1 @config sensor sorterAmmo sorter1 @config op div halfAmmo turretCap 2 jump enableSwitch lessThanEq turretTotal halfAmmo jump switchOff equal switchState 0 jump switchOff greaterThanEq turretTotal halfAmmo jump firstBind always switchOff: control enabled switch1 0 jump unBound always end enableSwitch: control enabled switch1 1 #Order bind firstBind: jump unBound strictEqual sorterAmmo null ubind unit1 sensor controller @unit @controller set return @counter op add return @counter 2 jump command equal controller @this #Checks if bound unit is being controlled by this processor jump startBind always set unit1 @unit jump command always startBind: #Starts when controller is not @this processor ubind @flare sensor controlled @unit @controlled #Check if bound unit is controlled jump desync equal controlled @ctrlPlayer jump desync equal controlled @ctrlCommand jump notControlled equal controlled false end notControlled: set @counter return command: #Start of code commands sensor heldCap @unit @itemCapacity sensor heldTotal @unit @totalItems sensor heldOre @unit @firstItem jump deliverAmmo equal heldOre sorterAmmo ulocate building core false @copper corex corey foundCore coreHome ucontrol approach corex corey 6 ucontrol itemDrop coreHome heldCap ucontrol itemTake coreHome sorterAmmo heldCap end deliverAmmo: ucontrol approach turretX turretY 6 ucontrol itemDrop turretID heldCap end unBound: sensor heldTotal @unit @totalItems ubind unit1 ulocate building core false @copper corex corey foundCore coreHome ucontrol approach corex corey 6 ucontrol itemDrop coreHome heldCap jump wC equal heldTotal 0 end wC: ucontrol unbind set unit1 "nope"
1 Comments
lixel>_ 25 Apr, 2024 @ 12:03pm 
Nice dude, you are genius. Go on, hope in you.