Difference between revisions of "AI Craftapalooza Parts"
Jump to navigation
Jump to search
Troylaurin (talk | contribs) |
Troylaurin (talk | contribs) (Properly escape "or" conditions) |
||
Line 35: | Line 35: | ||
tier = global.int.get("craft_tier:3.1") | tier = global.int.get("craft_tier:3.1") | ||
count = global.double.get("craft_count:3.1") | count = global.double.get("craft_count:3.1") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 5 {{!}} count < 1.0) |
; Verify ingot resources | ; Verify ingot resources | ||
Line 310: | Line 310: | ||
; Craft circuit boards | ; Craft circuit boards | ||
lo2: gotoif(hi2, board_lo <= craft_inventory * (count("plate.circuit", tier * 2 - 1))) | lo2: gotoif(hi2, board_lo <= craft_inventory * (count("plate.circuit", tier * 2 - 1))) | ||
− | waitwhile(active("refinery") | + | waitwhile(active("refinery") {{!}} count("plate", tier * 2 - 1) < board_lo - craft_inventory * (count("plate.circuit", tier * 2 - 1))) |
produce("plate", tier * 2 - 1, board_lo - craft_inventory * (count("plate.circuit", tier * 2 - 1)), "refinery") | produce("plate", tier * 2 - 1, board_lo - craft_inventory * (count("plate.circuit", tier * 2 - 1)), "refinery") | ||
hi2: gotoif(end, board_hi <= craft_inventory * (count("plate.circuit", tier * 2))) | hi2: gotoif(end, board_hi <= craft_inventory * (count("plate.circuit", tier * 2))) | ||
− | waitwhile(active("refinery") | + | waitwhile(active("refinery") {{!}} count("plate", tier * 2) < board_hi - craft_inventory * (count("plate.circuit", tier * 2))) |
produce("plate", tier * 2, board_hi - craft_inventory * (count("plate.circuit", tier * 2)), "refinery") | produce("plate", tier * 2, board_hi - craft_inventory * (count("plate.circuit", tier * 2)), "refinery") | ||
Line 444: | Line 444: | ||
; Craft circuit wires | ; Craft circuit wires | ||
lo2: gotoif(hi2, circuit_lo <= craft_inventory * count("circuit", tier * 2 - 1)) | lo2: gotoif(hi2, circuit_lo <= craft_inventory * count("circuit", tier * 2 - 1)) | ||
− | waitwhile(count("cable", tier * 2 - 1) < circuit_lo - craft_inventory * count("circuit", tier * 2 - 1) | + | waitwhile(count("cable", tier * 2 - 1) < circuit_lo - craft_inventory * count("circuit", tier * 2 - 1) {{!}} active("assembler")) |
produce("cable", tier * 2 - 1, circuit_lo - craft_inventory * count("circuit", tier * 2 - 1), "assembler") | produce("cable", tier * 2 - 1, circuit_lo - craft_inventory * count("circuit", tier * 2 - 1), "assembler") | ||
hi2: gotoif(end, circuit_hi <= craft_inventory * count("circuit", tier * 2)) | hi2: gotoif(end, circuit_hi <= craft_inventory * count("circuit", tier * 2)) | ||
− | waitwhile(count("cable", tier * 2) < circuit_hi - craft_inventory * count("circuit", tier * 2) | + | waitwhile(count("cable", tier * 2) < circuit_hi - craft_inventory * count("circuit", tier * 2) {{!}} active("assembler")) |
produce("cable", tier * 2, circuit_hi - craft_inventory * count("circuit", tier * 2), "assembler") | produce("cable", tier * 2, circuit_hi - craft_inventory * count("circuit", tier * 2), "assembler") | ||
Line 574: | Line 574: | ||
tier = global.int.get("craft_tier:3.2") | tier = global.int.get("craft_tier:3.2") | ||
count = global.double.get("craft_count:3.2") | count = global.double.get("craft_count:3.2") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
global.int.set("craft_tier:ingot", tier) | global.int.set("craft_tier:ingot", tier) | ||
Line 631: | Line 631: | ||
tier = global.int.get("craft_tier:3.3") | tier = global.int.get("craft_tier:3.3") | ||
count = global.double.get("craft_count:3.3") | count = global.double.get("craft_count:3.3") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
plates = count * 9.0 - craft_inventory * count("plate.stack", tier) | plates = count * 9.0 - craft_inventory * count("plate.stack", tier) | ||
Line 644: | Line 644: | ||
produce("ingot", tier, plates - craft_inventory * count("plate", tier), "presser") | produce("ingot", tier, plates - craft_inventory * count("plate", tier), "presser") | ||
− | stacks: waitwhile(count("plate", tier) < plates | + | stacks: waitwhile(count("plate", tier) < plates {{!}} active("presser")) |
craft("plate.stack", tier, count - craft_inventory * count("plate.stack", tier)) | craft("plate.stack", tier, count - craft_inventory * count("plate.stack", tier)) | ||
produce("plate.stack", tier, count, "presser") | produce("plate.stack", tier, count, "presser") | ||
Line 724: | Line 724: | ||
tier = global.int.get("craft_tier:3.4") | tier = global.int.get("craft_tier:3.4") | ||
count = global.double.get("craft_count:3.4") | count = global.double.get("craft_count:3.4") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
plates: platesperblock = 4.0 * round((33332222220.0 / (10.0 ^ i2d(tier))) % 10.0) | plates: platesperblock = 4.0 * round((33332222220.0 / (10.0 ^ i2d(tier))) % 10.0) | ||
Line 792: | Line 792: | ||
tier = global.int.get("craft_tier:3.5") | tier = global.int.get("craft_tier:3.5") | ||
count = global.double.get("craft_count:3.5") | count = global.double.get("craft_count:3.5") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
global.int.set("craft_tier:ingot", tier) | global.int.set("craft_tier:ingot", tier) | ||
Line 852: | Line 852: | ||
tier = global.int.get("craft_tier:3.6") | tier = global.int.get("craft_tier:3.6") | ||
count = global.double.get("craft_count:3.6") | count = global.double.get("craft_count:3.6") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
cables = count * max(max(1.0, i2d(tier) - 2.0), max(10.0 - (5.0 * ((i2d(tier) - 8.0) ^ 2.0)), ceil(((i2d(tier) - 1.0) ^ 1.5) - 11.0))) | cables = count * max(max(1.0, i2d(tier) - 2.0), max(10.0 - (5.0 * ((i2d(tier) - 8.0) ^ 2.0)), ceil(((i2d(tier) - 1.0) ^ 1.5) - 11.0))) | ||
Line 978: | Line 978: | ||
tier = global.int.get("craft_tier:3.7") | tier = global.int.get("craft_tier:3.7") | ||
count = global.double.get("craft_count:3.7") | count = global.double.get("craft_count:3.7") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
global.int.set("craft_tier:ingot", tier) | global.int.set("craft_tier:ingot", tier) | ||
Line 1,038: | Line 1,038: | ||
tier = global.int.get("craft_tier:3.8") | tier = global.int.get("craft_tier:3.8") | ||
count = global.double.get("craft_count:3.8") | count = global.double.get("craft_count:3.8") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
; ingots | ; ingots | ||
Line 1,170: | Line 1,170: | ||
screws: gotoif(end, count <= craft_inventory * count("screw", tier)) | screws: gotoif(end, count <= craft_inventory * count("screw", tier)) | ||
− | waitwhile(count("rod", tier) < (count - craft_inventory * count("screw", tier))/4.0 | + | waitwhile(count("rod", tier) < (count - craft_inventory * count("screw", tier))/4.0 {{!}} active("cutter")) |
produce("rod", tier, ceil((count - craft_inventory * count("screw", tier))/4.0), "cutter") | produce("rod", tier, ceil((count - craft_inventory * count("screw", tier))/4.0), "cutter") | ||
Line 1,240: | Line 1,240: | ||
wire: gotoif(end, count <= craft_inventory * count("wire", tier)) | wire: gotoif(end, count <= craft_inventory * count("wire", tier)) | ||
− | waitwhile(count("cable", tier) < count - count - craft_inventory * count("wire", tier) | + | waitwhile(count("cable", tier) < count - count - craft_inventory * count("wire", tier) {{!}} active("refinery")) |
produce("cable", tier, count - craft_inventory * count("wire", tier), "refinery") | produce("cable", tier, count - craft_inventory * count("wire", tier), "refinery") | ||
Line 1,311: | Line 1,311: | ||
tier = global.int.get("craft_tier:3.9") | tier = global.int.get("craft_tier:3.9") | ||
count = global.double.get("craft_count:3.9") | count = global.double.get("craft_count:3.9") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0) |
executesync("craft 3:9:in") | executesync("craft 3:9:in") | ||
Line 1,546: | Line 1,546: | ||
rings: gotoif(end, count*2.0 < craft_inventory * count("ring", tier)) | rings: gotoif(end, count*2.0 < craft_inventory * count("ring", tier)) | ||
− | waitwhile(count("rod", tier) < rods | + | waitwhile(count("rod", tier) < rods {{!}} active("shaper")) |
produce("rod", tier, count*2.0 - craft_inventory * count("ring", tier), "shaper") | produce("rod", tier, count*2.0 - craft_inventory * count("ring", tier), "shaper") | ||
Line 1,635: | Line 1,635: | ||
tier = global.int.get("craft_tier:wire") | tier = global.int.get("craft_tier:wire") | ||
count = global.double.get("craft_count:wire") | count = global.double.get("craft_count:wire") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0 {{!}} global.int.get("craft_status") > 199) |
cables: gotoif(wires, count < craft_inventory * count("cable", tier)) | cables: gotoif(wires, count < craft_inventory * count("cable", tier)) | ||
Line 1,693: | Line 1,693: | ||
tier = global.int.get("craft_tier:screw") | tier = global.int.get("craft_tier:screw") | ||
count = global.double.get("craft_count:screw") | count = global.double.get("craft_count:screw") | ||
− | gotoif(99, tier < 1 | + | gotoif(99, tier < 1 {{!}} tier > 10 {{!}} count < 1.0 {{!}} global.int.get("craft_status") > 199) |
:local double rods | :local double rods |
Revision as of 07:54, 27 January 2021
Parts scripts
Output | Part | Scripts | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | chips |
| |||||||||||||||||||||||||||
2 | plates |
| |||||||||||||||||||||||||||
3 | dense plates |
| |||||||||||||||||||||||||||
4 | blocks |
| |||||||||||||||||||||||||||
5 | cables |
| |||||||||||||||||||||||||||
6 | insulated cables |
| |||||||||||||||||||||||||||
7 | rods |
| |||||||||||||||||||||||||||
8 | motors |
| |||||||||||||||||||||||||||
9 | pumps |
|
Wires
(pic)
Name | Lines | Code | |||
---|---|---|---|---|---|
craft part:wire | 9 |
|
Screws
(pic)
Name | Lines | Code | |||
---|---|---|---|---|---|
craft part:screw | 12 |
|