- #var scrapValue 0
- #var compT 1;
- #var boltV 0
- #var layerV 0
- #var plankV 0
- #var ingotV 0
- #var firstI 0
- #var secondI 0
- #var firstP 0
- #var secondP 0
- #var firstB 0
- #var secondB 0
- #var firstL 0
- #var secondL 0
- #var iT1 0
- #var pT1 0
- #var bT1 0
- #var lT1 0
- #act {^ [ %1 ] < T2,%3 > a bolt %4}{#math {boltV}{$boltV + $1}}
- #act {^ [ %1 ] < T2,%3 > a layer %4}{#math {layerV}{$layerV + $1}}
- #act {^ [ %1 ] < T2,%3 > a plank %4}{#math {plankV}{$plankV + $1}}
- #act {^ [ %1 ] < T2,%3 > an ingot %4}{#math {ingotV}{$ingotV + $1}}
- #act {^ < T2,%2 > a bolt %3}{#math {boltV}{$boltV + 1}}
- #act {^ < T2,%2 > a layer %3}{#math {layerV}{$layerV + 1}}
- #act {^ < T2,%2 > a plank %3}{#math {plankV}{$plankV + 1}}
- #act {^ < T2,%2 > an ingot %3}{#math {ingotV}{$ingotV + 1}}
- #act {^ < T1,%3 > a bolt %4}{#math {bT1}{$bT1 + 1};#if {$firstB = 0}{#var firstB 1} else {#if {$firstB > 0 && $secondB = 0}{#var secondB 1}}}
- #act {^ < T1,%3 > a layer %4}{#math {lT1}{$lT1 + 1};#if {$firstL = 0}{#var firstL 1} else {#if {$firstL > 0 && $secondL = 0}{#var secondL 1}}}
- #act {^ < T1,%3 > a plank %4}{#math {pT1}{$pT1 + 1};#if {$firstP = 0}{#var firstP 1} else {#if {$firstP > 0 && $secondP = 0}{#var secondP 1}}}
- #act {^ < T1,%3 > an ingot %4}{#math {iT1}{$iT1 + 1};#if {$firstI = 0}{#var firstI 1} else {#if {$firstI > 0 && $secondI =0}{#var secondI 1}}}
- #act {^ [ %1 ] < T1,%3 > a bolt %4}{#math {bT1}{$bT1 + $1};#var temp $1 ;#if {$firstB = 0}{#var firstB $temp} else {#if {$firstB > 0 && $secondB = 0}{#var secondB $temp}}}
- #act {^ [ %1 ] < T1,%3 > a layer %4}{#math {lT1}{$lT1 + $1};#var temp $1;#if {$firstL = 0}{#var firstL $temp} else {#if {$firstL > 0 && $secondL = 0}{#var secondL $temp}}}
- #act {^ [ %1 ] < T1,%3 > a plank %4}{#math {pT1}{$pT1 + $1};#var temp $1;#if {$firstP = 0}{#var firstP $temp} else {#if {$firstP > 0 && $secondP = 0}{#var secondP $temp}}}
- #act {^ [ %1 ] < T1,%3 > an ingot %4}{#math {iT1}{$iT1 + $1};#var temp $1;#if {$firstI = 0}{#var firstI $temp} else {#if {$firstI > 0 && $secondI =0}{#var secondI $temp}}}
- #alias {CompSorter}{resetComps;look}
- #alias {sortcomps2}{#if {$ingotV >= 2 && $boltV >=1}{get ingot;get ingot;get bolt;nextComp} else {#if {$ingotV >=2 && $plankV >=1}{get ingot;get ignot;get plank;nextComp} else {#if {$boltV >=2 && $layerV >=2}{get bolt;get bolt;get layer;get layer;nextComp} else {#if {$plankV >=2 && $layerV >=2}{get plank;get plank;get layer;get layer;nextComp}}}}}
- #alias {nextComp}{#math {compT}{$compT +1};put all.comp,$compT.alp;CompSorter}
- #alias {sortcomps1}{#var boltV 0;#var layerV 0;#var plankV 0;#var ingotV 0;#var firstI 0;#var secondI 0;#var firstP 0;#var secondP 0;#var firstB 0;#var secondB 0;#var firstL 0;#var secondL 0;#var iT1 0;#var pT1 0;#var bT1 0;#var lT1 0}
- #alias {sortcomps1}{#if {$iT1 >= 4 && $pT1 >= 4}{ingot+plank} else {#if {$iT1 >= 4 && $bT1 >= 4}{ingot+bolt} else {#if {$pT1 >= 4 && $lT1 >= 4}{plank+layer} else {#if {$bT1 >= 4 && $lT1 >= 4}{bolt+layer}}}}}
- #alias {ingot+plank}{#if {$firstI >2 && $iT1 > $firstI +1}{#if {$firstP > 2 && $pT1 > $firstP +1}{2Ingot2Plank} else {#if {$secondP > 2 && $pT1 > $secondP +1}{2Ingot1Plank} else {2Ingot4Plank}}} else {#if {$secondI >2 && $iT1 > $secondI +1}{#if {$firstP > 2 && $pT1 > $firstP +1}{1Ingot2Plank} else {#if {$secondP > 2 && $pT1 > $secondP +1}{1Ingot1Plank} else {1Ingot4Planks}}} else {#if {$firstP > 2 && $pT1 > $firstP +1}{4ingot2Plank} else {#if {$secondP > 2 && $pT1 > $secondP +1}{4Ingot1Plank} else {#out {~~~test 4I4P~~~};4Ingot4Plank}}}}}
- #alias {2Ingot2Plank}{#math {tempI}{$firstI +1};#math {tempP}{$firstP +1};get $tempI.ingot;get $tempI.ingot;get ingot;get ingot;get $tempP.plank;get $tempP.plank;get plank;get plank;nextComp}
- #alias {2Ingot1Plank}{#math {tempI}{$firstI +1};#math {tempP}{$secondP +1};get $tempI.ingot;get $tempI.ingot;get ingot;get ingot;get $tempP.plank;get plank;get plank;get plank;nextComp}
- #alias {2Ingot4Plank}{#math {tempI}{$firstI +1};#math {tempP}{$firstP +1};get $tempI.ingot;get $tempI.ingot;get ingot;get ingot;#loop {1,4}{get plank};nextComp}
- #alias {1Ingot2Plank}{#math {tempI}{$secondI +1};#math {tempP}{$firstP +1};get $tempI.ingot;get ingot;get ingot;get ingot;get $tempP.plank;get $tempP.plank;get plank;get plank;nextComp}
- #alias {1Ingot1Plank}{#math {tempI}{$secondI +1};#math {tempP}{$secondP +1};get $secondI.ingot;get ingot;get ingot;get ingot;get $tempP.plank;get plank;get plank;get plank;nextComp}
- #alias {1Ingot4Plank}{#math {tempI}{$secondI +1};#math {tempP}{$secondP +1};get $secondI.ingot;get ingot;get ingot;get ingot;#loop {1,4}{get plank};nextComp}
- #alias {4Ingot2Plank}{#math {tempP}{$firstP +1};#loop {1,4}{get ingot};get $tempP.plank;get $tempP.plank;get plank;get plank;nextComp}
- #alias {4Ingot1Plank}{#math {tempP}{$secondP +1};#loop {1,4}{get ingot};get $tempP.plank;get plank;get plank;get plank;nextComp}
- #alias {4Ingot4Plank}{#loop {1,4}{get ingot;get plank};nextComp}
- #alias {ingot+bolt}{#if {$firstI >2 && $iT1 > $firstI +1}{#if {$firstB > 2 && $bT1 > $firstB +1}{2Ingot2Bolt} else {#if {$secondB > 2 && $bT1 > $secondB +1}{2Ingot1Bolt} else {2Ingot4Bolt}}} else {#if {$secondI >2 && $iT1 > $secondI +1}{#if {$firstB > 2 && $bT1 > $firstB +1}{1Ingot2bolt} else {#if {$secondB > 2 && $bT1 > $secondB +1}{1Ingot1Bolt} else {1Ingot4Bolt}}} else {#if {$firstB > 2 && $bT1 > $firstB +1}{4Ingot2Bolt} else {#if {$secondB > 2 && $bT1 > $secondB +1}{4Ingot1Bolt} else {4Ingot4Bolt}}}}}
- #alias {2Ingot2Bolt}{#math {tempI}{$firstI +1};#math {tempB}{$firstB +1};get $tempI.ingot;get $tempI.ingot;get ingot;get ingot;get $tempB.bolt;get $tempB.bolt;get bolt;get bolt;nextComp}
- #alias {2Ingot1Bolt}{#math {tempI}{$firstI +1};#math {tempB}{$secondB +1};get $tempI.ingot;get $tempI.ingot;get ingot;get ingot;get $tempB.bolt;get bolt;get bolt;get bolt;nextComp}
- #alias {2Ingot4Bolt}{#math {tempI}{$firstI +1};#math {tempB}{$secondB +1};get $tempI.ingot;get $tempI.ingot;get ingot;get ingot;#loop {1,4}{get bolt};nextComp}
- #alias {1Ingot2Bolt}{#math {tempI}{$secondI +1};#math {tempB}{$firstB +1};get $tempI.ingot;get ingot;get ingot;get ingot;get $tempB.bolt;get $tempB.bolt;get bolt;get bolt;nextComp}
- #alias {1Ingot1Bolt}{#math {tempI}{$secondI +1};#math {tempB}{$secondB +1};get $secondI.ingot;get ingot;get ingot;get ingot;get $tempB.bolt;get bolt;get bolt;get bolt;nextComp}
- #alias {1Ingot4Bolt}{#math {tempI}{$secondI +1};#math {tempB}{$secondB +1};get $secondI.ingot;get ingot;get ingot;get ingot;#loop {1,4}{get bolt};nextComp}
- #alias {4Ingot2Bolt}{#math {tempB}{$firstB +1};#loop {1,4}{get ingot};get $tempB.bolt;get $tempB.bolt;get bolt;get bolt;nextComp}
- #alias {4Ingot1Bolt}{#math {tempB}{$secondB +1};#loop {1,4}{get ingot};get $tempB.bolt;get bolt;get bolt;get bolt;nextComp}
- #alias {4Ingot4Bolt}{#loop {1,4}{get ingot;get bolt};nextComp}
- #alias {plank+layer}{#if {$firstP >2 && $pT1 > $firstP +1}{#if {$firstL > 2 && $lT1 > $firstL +1}{2Plank2Layer} else {#if {$secondL > 2 && $lT1 > $secondL +1}{2Plank1Layer} else {2Plank4Layer}}} else {#if {$secondP >2 && $pT1 > $secondP +1}{#if {$firstL > 2 && $lT1 > $firstL +1}{1Plank2Layer} else {#if {$secondL > 2 && $lT1 > $secondL +1}{1Plank1Layer} else {1Plank4Layer}}} else {#if {$firstL > 2 && $lT1 > $firstL +1}{4Plank2Layer} else {#if {$secondL > 2 && $lT1 > $secondL +1}{4Plank1Layer} else {4Plank4Layer}}}}}
- #alias {2Plank2Layer}{#math {tempP}{$firstP +1};#math {tempL}{$firstL +1};get $tempP.plank;get $tempP.plank;get plank;get plank;get $tempL.layer;get $tempL.layer;get layer;get layer;nextComp}
- #alias {2Plank1Layer}{#math {tempP}{$firstP +1};#math {tempL}{$secondL +1};get $tempP.plank;get $tempP.plank;get plank;get plank;get $tempL.layer;get layer;get layer;get layer;nextComp}
- #alias {2Plank4Layer}{#math {tempP}{$firstP +1};#math {tempL}{$secondL +1};get $tempP.plank;get $tempP.plank;get plank;get plank;#loop {1,4}{get layer};nextComp}
- #alias {1Plank2Layer}{#math {tempP}{$secondP +1};#math {tempL}{$firstL +1};get $tempP.plank;get plank;get plank;get plank;get $tempL.layer;get $tempL.layer;get layer;get layer;nextComp}
- #alias {1Plank1Layer}{#math {tempP}{$secondP +1};#math {tempL}{$secondL +1};get $secondP.plank;get plank;get plank;get plank;get $tempL.layer;get layer;get layer;get layer;nextComp}
- #alias {1Plank4Layer}{#math {tempP}{$secondP +1};#math {tempL}{$secondL +1};get $secondP.plank;get plank;get plank;get plank;#loop {1,4}{get layer};nextComp}
- #alias {4Plank2Layer}{#math {tempL}{$firstL +1};#loop {1,4}{get plank};get $tempL.layer;get $tempL.layer;get layer;get layer;nextComp}
- #alias {4Plank1Layer}{#math {tempL}{$secondL +1};#loop {1,4}{get plank};get $tempL.layer;get layer;get layer;get layer;nextComp}
- #alias {4Plank4Layer}{#loop {1,4}{get plank;get layer};nextComp}
- #alias {bolt+layer}{#if {$firstB >2 && $bT1 > $firstB +1}{#if {$firstL > 2 && $lT1 > $firstL +1}{2Bolt2Layer} else {#if {$secondL > 2 && $lT1 > $secondL +1}{2Bolt1Layer} else {2Bolt4Layer}}} else {#if {$secondB >2 && $bT1 > $secondB +1}{#if {$firstL > 2 && $lT1 > $firstL +1}{1Bolt2Layer} else {#if {$secondL > 2 && $lT1 > $secondL +1}{1Bolt1Layer} else {1Bolt4Layer}}} else {#if {$firstL > 2 && $lT1 > $firstL +1}{4Bolt2Layer} else {#if {$secondL > 2 && $lT1 > $secondL +1}{4Bolt1Layer} else {4Bolt4Layer}}}}}
- #alias {2Bolt2Layer}{#math {tempB}{$firstB +1};#math {tempL}{$firstL +1};get $tempB.bolt;get $tempB.bolt;get bolt;get bolt;get $tempL.layer;get $tempL.layer;get layer;get layer;nextComp}
- #alias {2Bolt1Layer}{#math {tempB}{$firstB +1};#math {tempL}{$secondL +1};get $tempB.bolt;get $tempB.bolt;get bolt;get bolt;get $tempL.layer;get layer;get layer;get layer;nextComp}
- #alias {2Bolt4Layer}{#math {tempB}{$firstB +1};#math {tempL}{$secondL +1};get $tempB.bolt;get $tempB.bolt;get bolt;get bolt;#loop {1,4}{get layer};nextComp}
- #alias {1Bolt2Layer}{#math {tempB}{$secondB +1};#math {tempL}{$firstL +1};get $tempB.bolt;get bolt;get bolt;get bolt;get $tempL.layer;get $tempL.layer;get layer;get layer;nextComp}
- #alias {1Bolt1Layer}{#math {tempB}{$secondB +1};#math {tempL}{$secondL +1};get $secondB.bolt;get bolt;get bolt;get bolt;get $tempL.layer;get layer;get layer;get layer;nextComp}
- #alias {1Bolt4Layer}{#math {tempB}{$secondB +1};#math {tempL}{$secondL +1};get $secondB.bolt;get bolt;get bolt;get bolt;#loop {1,4}{get layer};nextComp}
- #alias {4Bolt2Layer}{#math {tempL}{$firstL +1};#loop {1,4}{get bolt};get $tempL.layer;get $tempL.layer;get layer;get layer;nextComp}
- #alias {4Bolt1Layer}{#math {tempL}{$secondL +1};#loop {1,4}{get bolt};get $tempL.layer;get layer;get layer;get layer;nextComp}
- #alias {4Bolt4Layer}{#loop {1,4}{get bolt;get layer};nextComp}
- resetComps;look