Mindustry

Mindustry

评价数不足
Dual-mode mono mining logic
   
奖励
收藏
已收藏
取消收藏
标签: schematic
文件大小
发表于
更新日期
1.013 KB
11 月 30 日 上午 5:09
12 月 14 日 上午 2:12
6 项改动说明 ( 查看 )

订阅以下载
Dual-mode mono mining logic

描述
Attention! This processor is only for starting the game! It is recommended to replace it with a more powerful one at the first opportunity.

This processor operates in two modes: comparative and priority. The name indicates what each mode is responsible for. The processor can also avoid using a unit controlled by another processor and can clear groups of unused units. The processor will stop if no mono is found and will send them to the core if it is filled with resources.

Processor ver. 1.92
_________________________

Processor code:

printflush message1
print "[green]Mono[] mining processor ."
print "\nMade by: <[cyan]x[blue]y[red]z[w"
print "hite]>AlWx."
ubind @mono
jump 9 notEqual @unit null
control enabled switch1 0 0 0 0
control config sorter1 null 0 0 0
end
sensor Check @unit @flag
jump 14 equal Check 0
sensor Check @unit @controlled
jump 4 notEqual Check 0
ucontrol flag 0 999 0 0 0
print "\nSelected mode:[#ffcf00] "
sensor Check switch1 @enabled
jump 22 equal Check 0
print "priority[].\n[#99999999]They only "
print "extract the resource selected in t"
print "he sorter (,,).\n\n"
sensor Ore sorter1 @config
set @counter 37
print "comparative[].\n[#99999999]Mono ex"
print "tracts the resource that is least "
print "abundant in the core (,,).\n\n"
ulocate building core 0 @copper Xpos Ypos 0 Core
sensor Res Core @copper
sensor Check Core @lead
set Ore @copper
jump 32 lessThan Res Check
set Res Check
set Ore @lead
sensor Check Core @sand
jump 36 lessThan Res Check
set Res Check
set Ore @sand
control config sorter1 Ore 0 0 0
print "Use the switch to change the mode."
sensor Check Core @itemCapacity
jump 48 greaterThanEq Res Check
sensor Check @unit @firstItem
jump 43 equal Check null
jump 48 notEqual Check Ore
ulocate ore core 0 Ore Xpos Ypos 0 0
ucontrol approach Xpos Ypos 5 0 0
ucontrol mine Xpos Ypos 5 0 0
sensor Check @unit @totalItems
jump 0 lessThan Check 20
ulocate building core 0 @copper Xpos Ypos 0 Core
ucontrol stop 0 0 0 0 0
ucontrol move Xpos Ypos 0 0 0
ucontrol itemDrop Core 9999 0 0 0