Compare commits

...

19 Commits

Author SHA1 Message Date
97acc9b466 Update Frame Quarry requirements (#5)
The requirements for the frame quarry were pretty outdated, some items were only used when we did the runs on the Bedcraft server with TickThreading.

This updates the requirements to the latest version of the Mystcraft-based (eternal day, Meadow single biome, flat) frame quarry.

I haven't figured out a good design for overworld frame quarries that are protected against falling blocks or liquids from above, so this must do for now.

Co-authored-by: ThePixelbrain <19214217+ThePixelbrain@users.noreply.github.com>
Reviewed-on: #5
Co-authored-by: Pixelbrain <pixelbrain@noreply.localhost>
Co-committed-by: Pixelbrain <pixelbrain@noreply.localhost>
2024-08-11 14:50:19 +02:00
dc7d2c54f0 Update crafting cube resources 2024-05-24 20:12:09 +02:00
c277dc9623 Fix centrifuge distribution code 2024-05-19 19:55:18 +02:00
b9dc5a5d35 Fix file links in README 2024-05-18 19:01:55 +02:00
da57201c78 Fix soulcage stats 2024-05-10 20:28:46 +02:00
55fb28ee19 Add spawner statistics and plots 2024-05-04 01:35:42 +02:00
fe01e1935c Add early machine crafting order 2024-05-01 20:10:09 +02:00
76e47dffbd Add geothermal and lava calcs 2024-05-01 00:47:21 +02:00
aa855105b2 Merge pull request 'Add programs for IBF distribution and centrifuge distribution' (#3) from ibf_distribution into main
Reviewed-on: #3
2024-04-30 18:25:58 +02:00
0ead4d6084 Add centrifuge distribution programs 2024-04-30 18:19:30 +02:00
46f9ef0df6 Rename things 2024-04-30 18:04:18 +02:00
b8689fb78f Fix small problem 2024-04-30 18:00:01 +02:00
21b85d9b13 Add initial version of automated centrifuge usage 2024-04-30 18:00:01 +02:00
f86998cb72 Latest 2024-04-30 18:00:01 +02:00
Anton Reinhard
c13f0817c3 Add IBF distribution 2024-04-30 18:00:01 +02:00
69d7165497 Merge pull request 'Calculations for Titanium, Chrome and Iridium' (#2) from calcs into main
Reviewed-on: #2
2024-04-30 17:59:30 +02:00
1f595c299d Add images, add titanium calcs, improve notes, add splits 2024-04-30 17:35:43 +02:00
f8c96811fe Add more precise fusion material calculations and Chrome 2024-04-30 16:20:37 +02:00
70f63b2270 Add chrome calculations 2024-04-30 00:26:56 +02:00
39 changed files with 1651 additions and 98 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text

View File

@@ -1,40 +0,0 @@
## miner setup
- place one ender chest, then 4 turtles facing away from it around it, with fuel and preferably labels set
**execute commands**:
- pastebin get gGy2HWcF mine
- mine
## boiler builder
- place turtle infront (facing away) from a resupply station
- provide low pressure boilers, liquid fueled fireboxes and liquiducts in the resupply station
- follow the instructions of the turtle after placing it and starting the program
- give the turtle fuel beforehand
**execute commands**:
- pastebin get ZJt5uwjW boiler
- boiler
## lava refuel setup
- place at edge of lava lake in the nether
- place 1 bucket of lava in first slot
**execute commands**:
- label set <name>
- pastebin get nFSUKiYE lava
- refuel
- lava 10
## grindstone turtle
**execute commands**:
- pastebin get pRPJkvnv grind
- grind
same for the killing turtles in xp farm
# quarry program
quarry -oreQuarry true -enderChest 16 -doRefuel false -dumpCompareItems false -invert false -rednet false -dim 16 16 70

View File

@@ -80,6 +80,18 @@ Total:
- 1 Diamond
- 13 Glass
### Early EU machines
Get the following:
- Plate Bending Machine
- Singularity Compressor
- Induction Furnace
- Rotary Macerator
Also needed:
- Alloy Furnace for brass
For more details see [here](./calculations/early_machines.md)
### Early Necessary MF Machines
- MV Consumer
- Energy Bridge
@@ -98,7 +110,7 @@ Total:
- ~3 Farms needed at the end
### Autospawner Mob Farm
**Wichtige Mobs**
**Important Mobs**
- Ghast (for Safari Nets, find the small ghasts in the twilight forest, take magic map, icon is the cactus-looking white symbol)
- Enderman
- Witch (get by transformation powder on skeleton druid in the twilight forest)
@@ -114,19 +126,22 @@ Total:
### ME Automation
**5x5x5 Crafter**:
- 44 Containment Walls
- 54 Heat Vents
- 18 Crafting CPUs
- 9 Pattern Provider
**4x4x5 ME crafting cube**
- 6 pattern provider
- 6 crafting cpus
- 32 heat vent
- 36 containment walls
*probably balance more towards more crafting CPUs, fewer pattern providers*
**Total resources**:
- 96 quartz
- 56 quartz dust (32 for silicone -> 12 adv. + 20. basic circuits)
- 164 gold
- 12 diamonds
**Total**:
- 160 Quartz
- 96 Quartz Dust
- 27 Diamonds
- 235 Gold
- 416 iron
- 176 redstone
- 12 glowstone
- 48 glass
### Blast Furnace
34x Blocks
@@ -144,6 +159,8 @@ total 32x Blast Furnaces, 4x2x4:
### Power Upgrade
- +1 stack geothermal generators
For details see [here](./calculations/geothermial_power.md).
### Plate-Bender setups:
- 4x Iron plates, limit 2048
- 2x Steel plates, limit 512
@@ -172,7 +189,7 @@ to run per layer (32 boilers):
- 4 bioreactors
- produce 5600EU/t
In 3x3 Chunk Fläche:
In 3x3 Chunk Area:
- 2 x 16 boilers per layer
- ~4 layers -> 128 boilers
@@ -200,39 +217,51 @@ In 3x3 Chunk Fläche:
## Mid Game
### Lava centrifuges
At some point, start building centrifuges for lava producing copper and tin! Start with 32 or 64, then expand later.
For more details [see here](./calculations/lava_calcs.md).
### Frame Quarry
- 144 Support Frames (+32-64 later)
This material list is optimized for running in a eternal day, Meadow single biome, flat Mystcraft world.
It's not protected against falling gravel or flowing liquids from above.
- 128 Support Frames
- 120 Redstone Tube Frames
- 16 Tube Frames
**Other Mats**:
48 Mining Wells
24 Deployer
80 Block Breaker
8 Item Tesseracts
8 Energy Tesseracts
64 Red Alloy Wire
2 Repeater
1 Timer
2 Frame Motors
9 Solar Panels
1 Battery Box
1 Wireless Receiver
1 Wireless Transmitter
20 Jacketed Wire
1 Ender Chest
3 Control Tracks
- 48 Mining Wells
- 16 Deployer
- 81 Block Breaker
- 9 Item Tesseracts
- 9 Energy Tesseracts
- 64 Red Alloy Wire
- 3 Repeater
- 1 Timer
- 1 Lever
- 2 Frame Motors
- 8 Solar Panels
- 1 Battery Box
- 17 Jacketed Wire
- ca. 128 Cobblestone Panel
- ca. 128 Cobblestone Cover
- 2 Cobblestone Cover Strip
- 1 Ender Chest / Item Tesseract
- 1 Chunk Loader
- 1 Screwdriver
### Industrial Blast
- 34x Reinforced Machine Casings (54x Steel (plates), 9x Advanced Machine Blocks, 18x Advanced Circuits)
- 2x Lava inside
End setup: 4 Stacked on top of each other
End setup: 3 Stacked on top of each other
- 4x Titanium
- 7x Chrome (keep an eye on balancing, logistic pipes?)
- 4x Tungsten (need 16x kanthal heating coils, no nichrome)
- 1x Aluminium (if using aluminium for the mixed metal ingots, otherwise 1 is fine)
- 4x Chrome
- 1x Tungsten (need 4x kanthal heating coils, no nichrome) (only 30 total tungsten are needed, 1 IBF takes less than an hour to make those)
- 3x Aluminium (if using aluminium for the mixed metal ingots, otherwise 1 is fine)
### Drop Mob Farms
@@ -271,37 +300,90 @@ Keep enough for Assemblers making Data Control Circuits etc.
## End Game
### For Chrome (need 498)
4 Electrolyzers on ruby dust -> chrome dust
2+ stacks centrifuges for redstone -> ruby dust
### For Iridium (need 200)
- Mine 5-6 stacks of Sheldonite Ore
- 2 Grinders for Sheldonite and Ferrous with Mercury Cells
- 1 stack of centrifuges for platinum dust
- Keep ~300 platinum for circuit boards for the fusion
### For Titanium (need 252)
16 Electrolyzers on bauxite dust
More details [here](./calculations/iridium_calcs.md)
### For Beryllium (need 256)
4 Electrolyzers on ender pearl dust
### For Chrome (need 526)
- 4 IBFs for chrome dust -> chrome ingots
- 4 electrolyzers on ruby dust -> chrome dust
- 3 stacks centrifuges for redstone -> ruby dust
### For Helium (need 63)
16 Centrifuges on end stone dust (make with tome of alkahest)
More details [here](./calculations/chrome_calcs.md)
### For Titanium (need 280)
- 16 electrolyzers on bauxite dust
More details [here](./calculations/titanium_calcs.md)
### For Beryllium (need 264)
- 4 electrolyzers on ender pearl dust
### For Helium (need 45)
- 16 centrifuges on end stone dust (make with tome of alkahest)
## Items for Fusion:
33 Fusion Coils:
157 Energy Flow Circuits
132 Chrome Plates
132 Titanium Plates
66 Chrome Ingots
- 132 Energy Flow Circuits
- 33 Superconductors
- 132 Chrome Plates
- 66 Chrome Ingots
- 132 Titanium Plates
- 33 Iridium Plates
- 264 Beryllium Cells
- 1056 Dense Copper Plates
- 4224 Coal Dust
- 4224 Tin Dust
120 Advanced Machine Casings (32 (below) + 30 (above) + 24 (inner) + 34 (outer)):
- 60 Data Control Circuits
- 300 Chrome Plates
- 120 Titanium Plates
1 Fusion Control Computer (not including the fusion coil):
- 4 Data Orbs
- 10 Energy Flow Circuits
4 Fusion Energy Injectors
- 24 Superconductors
- 32 Energy Flow Circuits
- 16 Chrome Plates
- 16 Titanium Plates
- 2 Iridium Plates
- 16 Lapotron Crystals
2 Fusion Material Injectors
- 6 Energy Flow Circuits
- 8 Chrome Plates
- 8 Titanium Plates
1 Fusion Material Extractor
- 3 Energy Flow Circuits
- 4 Chrome Plates
- 4 Titanium Plates
Total of 57 Superconductors required (15 recipes of 4):
- 45 Helium cells
- 30 Tungsten Plates
- 15 Iridium Plates
- 45 Energy Flow Circuits
120 Advanced Machine Casings:
60 Data Control Circuits
300 Chrome Plates
120 Titanium Plates
**Important Base Material Totals**:
- 228 Energy Flow Circuits -> 228 Lapotron Crystals, 228 Platinum, 9576 Redstone (including redstone to lapis), 2052 Copper, 4104 Rubber
- 526 Chrome
- 280 Titanium
- 50 Iridium Plates / 200 Iridium Ingots -> Maximum of 360 or ~6 Stacks of Sheldonite necessary!!
- 264 Beryllium Cells
- 1056 Dense Copper Plates
- 289 Platinum Plates (including the ones for energy flow circuits)
Other compos:
60 Energy Flow Circuit
4 Data Orb
63 Helium Cells
## Charging the Reactor:
- Assuming full throughput, the 4 Energy Injectors can accept 32768EU/t, taking about 1 minute to fully charge the required 40 million EU.
- This would require 64 boiler pairs (4 layers) with at least partially charged MFSUs, or 85 boiler pairs without any buffer dedicated to the charging.

View File

@@ -0,0 +1,49 @@
# Chrome Production Calculations
**526 total chrome needed**
## Chrome Ingots from Chrome Dust
1 chrome dust in an IBF takes 40 seconds. For 526 chrome that would take ~5:50h. 4 IBF (one circle around a casing) take 1:27h.
Power consumption is 128EU/t per IBF.
## Chrome Dust from Ruby Dust
9 ruby dust make 1 chrome dust in an electrolyzer in 25 seconds. For 526 chrome dust, 4734 ruby dust are necessary. In one electrolyzer, this would take ~3:39h. 4 electrolyzers need 55 minutes.
Power consumption is 50EU/t per electrolyzer.
## Ruby Dust from Redstone Dust
10 redstone dust make 1 ruby dust in a centrifuge in 350 seconds. A stack of centrifuges produces 1 ruby dust every 5.47s or 0.183 ruby dust per second. For 4734 ruby dust, a stack of centrifuges needs 7:11h. Two stacks need 3:36h, 3 stacks 2:24h, 4 stacks 1:48h, 5 stacks 1:26h.
Note that extra rubies will be found by the mining turtles/quarry.
Each stack of centrifuges consumes 1.8 redstone per second or 110 redstone per minute. For the entire 526 chrome, 47.34k redstone are necessary.
Power consumption is 320EU/t per stack of centrifuges.
## Suggestion
- 4 IBFs on chrome -> 1:27h, 512EU/t
- 4 electrolyzers -> 0:55h, 200EU/t
- 3 stacks of redstone centrifuges -> 2:24h, 1280EU/t
In 1:27h, the centrifuges would produce 2865 ruby dust, so quarries would need to supplement 1868.
Total power: ~2000EU/t, needs about 10 boilers
## Centrifuge cost
| Item | For 1 Centrifuge | For 1 Stack | For 3 Stacks |
---|---|---|---
refined iron | 31 | 1984 | 5952
redstone | 14 | 896 | 2688
copper | 9 | 576 | 1728
rubber | 18 | 1152 | 3456
glowstone | 4 | 256 | 768
lapis | 4 | 256 | 768
advanced alloys | 4 | 256 | 768
coal dust (for carbon plates) | 32 | 2048 | 6144
planks | 20 | 1280 | 3840

View File

@@ -0,0 +1,26 @@
# Early EU machines
Assuming a geothermal generator already exists
## Suggested Crafting order:
### First
- Craft 9 electronic circuits, one of them to advanced
- Craft 1 battery
- Craft 7 machine blocks
- Craft 3 compressors
- Craft plate bending machine
### Second
- Use leftover cable to connect compressor and plate bending machine to power
- Make invar through dust mixing (2 iron + 1 nickel/ferrous)
- Make brass in alloy furnace (3 copper ingots + 1 tin ingot)
- Make 6 mixed metal ingots from 3 invar plates + 3 brass plates + 3 tin plates
- Make 6 carbon plates from 48 coal dust
### Third
- Take the compressor
- Craft singularity compressor
- Craft rotary macerator
- Craft induction furnace
- Put levers on them

View File

@@ -0,0 +1,31 @@
# Power from lava in geothermial generators
## Production
1 Geothermal Generator produces 20EU/t with lava and consumes 1 bucket of lava in 50s at max capacity. 32 Generators produce 640EU/t and 64 produce 1280EU/t.
## Cost
1 Geothermal Generator needs:
- 10 refined iron
- 6 tin
- 4 glass
- 2 redstone
- 1/2 copper
- 1 rubber
32 need:
- 5 stacks of iron (320)
- 3 stacks of tin (192)
- 2 stacks of glass (128)
- 1 stack of redstone (64)
- 18 copper -> 36x cable
- 36 rubber -> 36x cable
64 need:
- 10 stacks of iron (640)
- 6 stacks of tin (384)
- 4 stacks of glass (256)
- 2 stacks of redstone (128)
- 33 copper -> 66x cable
- 66 rubber -> 66x cable

View File

@@ -0,0 +1,31 @@
# Iridium Production Calculations
**200 total iridium ingots needed**
## Making Plates
*No iridium is needed in ingot form, everything can be converted to plates!*
50 Plates are needed for the Fusion Reactor. Nothing needed for anything else!
An Implosion Compressor makes 1 plate per second from Iridium Alloy Ingots. That takes a minute for all Iridium Plates needed in the run, using 32EU/t. Basically completely irrelevant other than having to place the machine once.
For 50 Iridium Plates, 400 Industrial TNT are needed.
## Making Iridium Alloy Ingots
Make in a rolling machine using 4 Iridium Ingots, 4 Advanced Alloys and 1 Diamond Dust. Takes 5 seconds per Plate. For 50 Plates that is about 4 minutes. Uses MJ.
## Making Ingots
From Ore: Compress 1 ore to 1 ingot.
From Sheldonite: Grind Sheldonite with mercury cells in the Industrial Grinder. Takes 5s per ore and 128EU/t. Produces 2 Iridium Nuggets and 3 Platinum Dust per ore. Platinum Dust can be centrifuged to Iridium Nuggets 1:1, so in total that is 5/9 Iridium Ingots per Sheldonite Ore. Compress the nuggets into ingots.
From Ferrous Ore: Grind Ferrous with mercury cells in the Industrial Grinder. Takes 5s per ore and 128EU/t. Produces 1 Platinum Dust per ore.
## Centrifuging Platinum Dust
1 Centrifuge takes 1 Platinum Dust (no cells) and makes 1 Iridium Nugget (and 1 tiny pile of Nickel Dust) in 150s using 5EU/t.
One stack of centrifuges produces 0.427 Iridium Nuggets per second, which is 0.047 Iridium Ingots per second or 2.84 Iridium Ingots per Minute.

View File

@@ -0,0 +1,29 @@
# Lava centrifuging to Copper and Tin
## Production
One centrifuge converts 16 Lava buckets to 4 Copper Ingots, 2 Tin Ingots, 1 Electrum Ingot and 2 tiny piles of Tungsten in 500 seconds, using 5EU/t.
| Item | 1 centrifuge | 64 | 128 | 192 | 256 | 6 stacks | 8 stacks | 10 stacks |
|------|--------------|----|-----|-----|-----|----------|----------|-----------|
| Lava per Minute | 1.92 | 123 | 246 | 369 | 492 | 737 | 983 | 1229 |
| Copper per Minute | 0.48 | 31 | 61 | 92 | 123 | 184 | 246 | 307 |
| Tin per Minute | 0.24 | 15 | 31 | 46 | 61 | 92 | 123 | 154 |
| Electrum per Minute | 0.12 | 7.7 | 15 | 23 | 31 | 46 | 61 | 77 |
| EU/t | 5 | 320 | 640 | 960 | 1280 | 1920 | 2560 | 3200 |
Roughly one pair of boilers needed per stack of centrifuges, or 16 Geothermal Generators.
## Centrifuge cost
| Item | For 1 Centrifuge | For 1 Stack | For 3 Stacks |
---|---|---|---
refined iron | 31 | 1984 | 5952
redstone | 14 | 896 | 2688
copper | 9 | 576 | 1728
rubber | 18 | 1152 | 3456
glowstone | 4 | 256 | 768
lapis | 4 | 256 | 768
advanced alloys | 4 | 256 | 768
coal dust (for carbon plates) | 32 | 2048 | 6144
planks | 20 | 1280 | 3840

View File

@@ -0,0 +1,17 @@
# Titanium Production Calculations
**280 total titanium needed**
## Titanium Ingots from Titanium Dust
1 titanium dust in an IBF takes 50 seconds. For 280 titanium that would take 3:53h. 4 IBF (one circle around a casing) take 58.3 minutes.
Power consumption is 128EU/t per IBF.
## Titanium Dust from Bauxite Dust
12 Bauxite Dust make 0.5 (2 small piles) Titanium Dust in an electrolyzer in 100 seconds using 128EU/t. For 280 Titanium, 6720 Bauxite Dust are necessary. In one electrolyzer, this would take 15:33h. 4 electrolyzers take 3:53h, 16 electrolyzers take 58.3 minutes.
## Bauxite Dust from Bauxite Ore
1 Bauxite Ore can be macerated into 4 Bauxite Dust, so 1680 Bauxite Ore are needed.

BIN
images/boiler_turtle_required_items.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
images/boiler_turtle_resupply_station.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
images/boiler_turtle_station_setup.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
images/centrifuge_turtle_setup.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
images/ibf_setup.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
images/mining_setup.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
images/mining_turtle_compare_blocks.png (Stored with Git LFS) Normal file

Binary file not shown.

6
original_code/README.md Normal file
View File

@@ -0,0 +1,6 @@
# Original Programs
The code in this directory is not written by me and only here for reference.
## quarry program
`quarry -oreQuarry true -enderChest 16 -doRefuel false -dumpCompareItems false -invert false -rednet false -dim 16 16 70`

View File

@@ -0,0 +1,21 @@
spawners,redstone,glowstone,sugar,sticks,bottles,gunpowder,eyes
1,134,128,175,324,135,149,170
2,313,339,333,575,339,322,279
3,466,468,506,940,469,504,463
4,627,620,599,1171,558,644,601
5,773,710,791,1451,736,782,741
6,768,815,800,1735,863,889,854
7,976,890,963,2054,966,951,916
8,997,977,1015,2102,1024,1071,1078
9,1089,1053,1112,2137,1093,1057,1052
10,1084,1052,1108,2226,1143,1128,1128
11,1154,1152,1223,2342,1194,1150,1130
12,1232,1188,1151,2236,1215,1190,1135
13,1292,1232,1273,2432,1264,1273,1223
14,1358,1308,1360,2536,1284,1350,1357
15,1251,1356,1236,2742,1233,1334,1263
16,1321,1395,1393,2768,1345,1440,1346
17,1495,1379,1472,2764,1440,1456,1408
18,1506,1496,1382,2829,1450,1528,1416
19,1526,1314,1455,2988,1574,1453,1469
20,1559,1602,1471,2942,1531,1577,1531
1 spawners redstone glowstone sugar sticks bottles gunpowder eyes
2 1 134 128 175 324 135 149 170
3 2 313 339 333 575 339 322 279
4 3 466 468 506 940 469 504 463
5 4 627 620 599 1171 558 644 601
6 5 773 710 791 1451 736 782 741
7 6 768 815 800 1735 863 889 854
8 7 976 890 963 2054 966 951 916
9 8 997 977 1015 2102 1024 1071 1078
10 9 1089 1053 1112 2137 1093 1057 1052
11 10 1084 1052 1108 2226 1143 1128 1128
12 11 1154 1152 1223 2342 1194 1150 1130
13 12 1232 1188 1151 2236 1215 1190 1135
14 13 1292 1232 1273 2432 1264 1273 1223
15 14 1358 1308 1360 2536 1284 1350 1357
16 15 1251 1356 1236 2742 1233 1334 1263
17 16 1321 1395 1393 2768 1345 1440 1346
18 17 1495 1379 1472 2764 1440 1456 1408
19 18 1506 1496 1382 2829 1450 1528 1416
20 19 1526 1314 1455 2988 1574 1453 1469
21 20 1559 1602 1471 2942 1531 1577 1531

BIN
soulcage_statistics/individual_items_rates.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/individual_items_rates.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/item_ratios.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/item_ratios.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/items_per_tower.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/items_per_tower.png (Stored with Git LFS) Normal file

Binary file not shown.

105
soulcage_statistics/main.jl Normal file
View File

@@ -0,0 +1,105 @@
using Plots
using CSV
using DataFrames
df = CSV.read("data.csv", DataFrame)
@. df.total = (df.redstone + df.glowstone + df.sugar + df.sticks + df.bottles + df.gunpowder + df.eyes)
@. df.total_rate = df.total / 5
scatter(
df.spawners,
df.total_rate,
title="Total items per minute",
label="Single drop tower",
xlabel="Spawners",
ylabel="Items per Minute",
ylim=(0, :auto),
xticks=[1, 4, 8, 12, 16, 20]
)
savefig("total.pdf")
savefig("total.png")
@. df.per_spawner = df.total_rate / df.spawners
scatter(
df.spawners,
df.per_spawner,
title="Items per minute per spawner",
label="Single drop tower",
xlabel="Spawners",
ylabel="Items per Minute",
ylim=(0, :auto),
xticks=[1, 4, 8, 12, 16, 20]
)
savefig("per_spawner.pdf")
savefig("per_spawner.png")
@. df.redstone_rate_per_spawner = df.redstone / df.spawners / 5
@. df.glowstone_rate_per_spawner = df.glowstone / df.spawners / 5
@. df.bottles_rate_per_spawner = df.bottles / df.spawners / 5
@. df.sugar_rate_per_spawner = df.sugar / df.spawners / 5
@. df.gunpowder_rate_per_spawner = df.gunpowder / df.spawners / 5
@. df.sticks_rate_per_spawner = df.sticks / df.spawners / 5
@. df.eyes_rate_per_spawner = df.eyes / df.spawners / 5
scatter(
df.spawners,
[df.redstone_rate_per_spawner df.glowstone_rate_per_spawner df.bottles_rate_per_spawner df.sugar_rate_per_spawner df.gunpowder_rate_per_spawner df.sticks_rate_per_spawner df.eyes_rate_per_spawner],
title="Individual items per minute per spawner",
label=["Redstone" "Glowstone" "Bottles" "Sugar" "Gunpowder" "Sticks" "Eyes"],
xlabel="Spawners",
ylabel="Items per minute per spawner",
ylim=(0, :auto),
xticks=[1, 4, 8, 12, 16, 20]
)
savefig("individual_items_rates.pdf")
savefig("individual_items_rates.png")
@. df.redstone_ratio = df.redstone / df.total * 100
@. df.glowstone_ratio = df.glowstone / df.total * 100
@. df.bottles_ratio = df.bottles / df.total * 100
@. df.sugar_ratio = df.sugar / df.total * 100
@. df.gunpowder_ratio = df.gunpowder / df.total * 100
@. df.sticks_ratio = df.sticks / df.total * 100
@. df.eyes_ratio = df.eyes / df.total * 100
scatter(
df.spawners,
[df.redstone_ratio df.glowstone_ratio df.bottles_ratio df.sugar_ratio df.gunpowder_ratio df.sticks_ratio df.eyes_ratio],
title="Item share",
label=["Redstone" "Glowstone" "Bottles" "Sugar" "Gunpowder" "Sticks" "Eyes"],
xlabel="Spawners",
ylabel="Percentage",
ylim=(0, :auto),
xticks=[1, 4, 8, 12, 16, 20]
)
savefig("item_ratios.pdf")
savefig("item_ratios.png")
@. df.redstone_rate = df.redstone / 5
@. df.glowstone_rate = df.glowstone / 5
@. df.bottles_rate = df.bottles / 5
@. df.sugar_rate = df.sugar / 5
@. df.gunpowder_rate = df.gunpowder / 5
@. df.sticks_rate = df.sticks / 5
@. df.eyes_rate = df.eyes / 5
@. df.low_rate_items_rate = (df.redstone_rate + df.glowstone_rate + df.bottles_rate + df.sugar_rate + df.gunpowder_rate + df.eyes_rate) / 6
@. df.high_rate_items_rate = df.sticks_rate
scatter(
df.spawners,
[df.low_rate_items_rate df.high_rate_items_rate],
title="Items per tower",
label=["Low rate items" "High rate items"],
xlabel="Spawners",
ylabel="Items per minute per tower",
ylim=(0, :auto),
xticks=[1, 4, 8, 12, 16, 20]
)
savefig("items_per_tower.pdf")
savefig("items_per_tower.png")

BIN
soulcage_statistics/per_spawner.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/per_spawner.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/total.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
soulcage_statistics/total.png (Stored with Git LFS) Normal file

Binary file not shown.

4
splits.md Normal file
View File

@@ -0,0 +1,4 @@
- Grind Stone
- Minimum Stone
- 4 Turtles Running
- ME System

82
turtle_code/README.md Normal file
View File

@@ -0,0 +1,82 @@
## grindstone turtle
Place an engineering turtle (turtle with crescent hammer, 3 iron + 1 silver) facing the crank of a grindstone
**execute commands**:
- `pastebin get pRPJkvnv startup`
- `startup`
same for the killing turtles in xp farm
## lava refuel setup
- place at edge of lava lake in the nether
- place 1 bucket of lava in first slot
**execute commands**:
- `label set <name>`
- `pastebin get nFSUKiYE lava`
- `refuel`
- `lava 10`
## miner setup
- place one ender chest, then 4 turtles facing away from it around it, with fuel and preferably labels set, like this:
![Mining Turtle Setup](../images/mining_setup.png)
- give each turtle compare blocks before starting the program like this
![Mining Turtle Compare Blocks](../images/mining_turtle_compare_blocks.png)
**execute commands**:
- `pastebin get gGy2HWcF mine`
- `mine`
## boiler builder
- **give the turtle fuel beforehand**
- give the turtle a **resupply module on its right side**
- place turtle infront (facing away) from a resupply station like this:
![Boiler Turtle Station Setup](../images/boiler_turtle_station_setup.png)
- the boilers are built infront of the turtle to the right, make sure the ground is even and is at least 2 blocks deep for the water
- provide low pressure boilers, liquid fueled fireboxes and liquiducts in the resupply station like this:
![Boiler Turtle Resupply Station](../images/boiler_turtle_resupply_station.png)
- follow the instructions of the turtle after placing it and starting the program, required items will look like this:
![Boiler Turtle Required Items](../images/boiler_turtle_required_items.png)
**execute commands**:
- `pastebin get ZJt5uwjW boiler`
- `boiler`
## IBF distribution turtle
- **give the turtle fuel beforehand**
- place above me interface, set the interface to keep 4 dust (titanium/chrome/tungsten)
Like this:
![IBF Setup](../images/ibf_setup.png)
**execute commands**:
- `pastebin get iq0Xe2KF ibf`
- `ibf`
## centrifuge turtle
Place a turtle with an **inventory module** connected on the right like in the following image:
![Centrifuge Turtle Setup](../images/centrifuge_turtle_setup.png)
The leftmost interface should have a stack of cells, the middle one a stack of ingredients, e.g., redstone dust, and the rightmost should be empty.
This program **does not** survive reboots/unloading! Keep it chunk-loaded and do not restart the server after starting the turtle.
Make sure the turtle always has enough resources to keep going. If it has to wait too long, it will break eventually!! If this happens, manually take out all products from the centrifuges to fix it.
**execute commands**:
- `pastebin get 1reqCa4x cent` (for **redstone**)
- `pastebin get 793PtXnD cent` (for **platinum**)
- `cent`

View File

@@ -97,7 +97,7 @@ function forcePlace()
while not turtle.place() do
turtle.dig()
turtle.attack()
enda
end
end
function forcePlaceDown()

View File

@@ -0,0 +1,425 @@
xRelPos = 0 -- "positive = forward"
yRelPos = 0 -- "positive = right"
zRelPos = 0 -- "positive = upwards"
facing = {
x = 1,
y = 0
}
cells_drop = 0
slot_cells_min = 0
slot_cells_max = 0
slot_cells_cur = 0
input_drop = 0
slot_input_min = 0
slot_input_max = 0
slot_input_cur = 0
output_1_take = 0
slot_output_1_min = 0
slot_output_1_max = 0
slot_output_1_cur = 0
output_2_take = 0
slot_output_2_min = 0
slot_output_2_max = 0
slot_output_2_cur = 0
output_3_take = 0
slot_output_3_min = 0
slot_output_3_max = 0
slot_output_3_cur = 0
output_4_take = 0
slot_output_4_min = 0
slot_output_4_max = 0
slot_output_4_cur = 0
function printPos()
print("At (", xRelPos, ", ", yRelPos, ", ", zRelPos, ") facing (", facing.x, ", ", facing.y, ")")
end
-- helper functions for movement
function forward()
xRelPos = xRelPos + facing.x
yRelPos = yRelPos + facing.y
if turtle.forward() then
return true
end
xRelPos = xRelPos - facing.x
yRelPos = yRelPos - facing.y
turtle.dig()
turtle.attack()
return false
end
function forceForward()
-- try moving forward until it works
while not forward() do end
end
function upwards()
zRelPos = zRelPos + 1
if turtle.up() then
return true
end
zRelPos = zRelPos - 1
turtle.digUp()
turtle.attackUp()
return false
end
function forceUpwards()
-- try moving upwards until it works
while not upwards() do end
end
function downwards()
zRelPos = zRelPos - 1
if turtle.down() then
return true
end
zRelPos = zRelPos + 1
turtle.digDown()
turtle.attackDown()
return false
end
function forceDownwards()
-- try moving upwards until it works
while not downwards() do end
end
function forcePlace()
-- try placing until it works
while not turtle.place() do
turtle.dig()
turtle.attack()
end
end
function forcePlaceDown()
-- try placing until it works
while not turtle.placeDown() do
turtle.digDown()
turtle.attackDown()
end
end
function forcePlaceUp()
-- try placing until it works
while not turtle.placeUp() do
turtle.digUp()
turtle.attackUp()
end
end
function turnRight()
if facing.x == 1 and facing.y == 0 then -- facing forward
facing.x = 0
facing.y = 1
elseif facing.x == 0 and facing.y == 1 then -- facing right
facing.x = -1
facing.y = 0
elseif facing.x == -1 and facing.y == 0 then -- facing backward
facing.x = 0
facing.y = -1
elseif facing.x == 0 and facing.y == -1 then -- facing left
facing.x = 1
facing.y = 0
else
print("turnRight: This should never happen")
end
turtle.turnRight()
end
function turnLeft()
if facing.x == 1 and facing.y == 0 then -- facing forward
facing.x = 0
facing.y = -1
elseif facing.x == 0 and facing.y == 1 then -- facing right
facing.x = 1
facing.y = 0
elseif facing.x == -1 and facing.y == 0 then -- facing backward
facing.x = 0
facing.y = 1
elseif facing.x == 0 and facing.y == -1 then -- facing left
facing.x = -1
facing.y = 0
else
print("turnLeft: This should never happen")
end
turtle.turnLeft()
end
function faceTo(x, y)
if (x == facing.x) and (y == facing.y) then
return
end
if (x == 1 and facing.x == -1) or (x == -1 and facing.x == 1) or (y == 1 and facing.y == -1) or (y == -1 and facing.y == 1) then
turnRight()
turnRight()
elseif (facing.y == -1 and x == 1) or (facing.y == 1 and x == -1) or (facing.x == 1 and y == 1) or (facing.x == -1 and y == -1) then
turnRight()
elseif (facing.y == -1 and x == -1) or (facing.y == 1 and x == 1) or (facing.x == 1 and y == -1) or (facing.x == -1 and y == 1) then
turnLeft()
else
print("faceTo: This should never happen")
end
end
function moveTo(x, y)
if (yRelPos > y) then
faceTo(0, -1)
while yRelPos > y do
forward()
end
elseif (yRelPos < y) then
faceTo(0, 1)
while yRelPos < y do
forward()
end
end
if (xRelPos > x) then
faceTo(-1, 0)
while xRelPos > x do
forward()
end
elseif (xRelPos < x) then
faceTo(1, 0)
while xRelPos < x do
forward()
end
end
end
function resupplyItem(slot, num)
module = peripheral.wrap("right")
turtle.select(slot)
items = turtle.getItemCount(slot)
while (items < num) do
module.suckSneaky(1, num - items)
sleep(1)
items = turtle.getItemCount(slot)
end
end
function resupplyAll()
-- reset current slot numbers
slot_output_1_cur = slot_output_1_min
slot_output_2_cur = slot_output_2_min
slot_output_3_cur = slot_output_3_min
slot_output_4_cur = slot_output_4_min
-- clean entire inventory
moveTo(0, 2); faceTo(-1, 0)
for i = 1, 16 do
while turtle.getItemCount(i) > 0 do
turtle.select(i)
turtle.drop()
end
end
-- get ingredient
moveTo(0, 1); faceTo(-1, 0)
slot_input_cur = slot_input_min
for i = slot_input_min, slot_input_max do
if (turtle.getItemCount(i) < 64) then
resupplyItem(i, 64)
end
end
-- get cells
moveTo(0, 0); faceTo(-1, 0)
slot_cells_cur = slot_cells_min
for i = slot_cells_min, slot_cells_max do
if (turtle.getItemCount(i) < 64) then
resupplyItem(i, 64)
end
end
end
function supplyCentrifuge()
module = peripheral.wrap("right")
-- drop cells from below (side 0)
if (cells_drop > 0) then
turtle.select(slot_cells_cur)
drop = cells_drop
if (turtle.getItemCount(slot_cells_cur) < drop) then
drop = drop - turtle.getItemCount(slot_cells_cur)
module.dropSneakyUp(0)
slot_cells_cur = slot_cells_cur + 1
turtle.select(slot_cells_cur)
end
module.dropSneakyUp(0, drop)
end
-- drop input from above (side 1)
turtle.select(slot_input_cur)
drop = input_drop
if (turtle.getItemCount(slot_input_cur) < drop) then
drop = drop - turtle.getItemCount(slot_input_cur)
module.dropSneakyUp(1)
slot_input_cur = slot_input_cur + 1
turtle.select(slot_input_cur)
end
module.dropSneakyUp(1, drop)
end
function emptyCentrifuge()
module = peripheral.wrap("right")
-- get output 1
turtle.select(slot_output_1_cur)
take = output_1_take
if (turtle.getItemCount(slot_output_1_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_1_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_1_cur = slot_output_1_cur + 1
turtle.select(slot_output_1_cur)
end
-- if no input is ready, move on immediately
if module.suckSneakyUp(2, take) == false then
return
end
-- get output 2
turtle.select(slot_output_2_cur)
take = output_2_take
if (turtle.getItemCount(slot_output_2_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_2_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_2_cur = slot_output_2_cur + 1
turtle.select(slot_output_2_cur)
end
module.suckSneakyUp(2, take)
-- get output 3
turtle.select(slot_output_3_cur)
take = output_3_take
if (turtle.getItemCount(slot_output_3_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_3_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_3_cur = slot_output_3_cur + 1
turtle.select(slot_output_3_cur)
end
module.suckSneakyUp(2, take)
-- get output 4
turtle.select(slot_output_4_cur)
take = output_4_take
if (turtle.getItemCount(slot_output_4_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_4_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_4_cur = slot_output_4_cur + 1
turtle.select(slot_output_4_cur)
end
module.suckSneakyUp(2, take)
end
-- sets up slot numbers with <cells> slots for cells and <input> slots for input ingredient, and output 1 through 4 numbers of slots
function setupSlots(cells, input, output_1, output_2, output_3, output_4)
slot_cells_min = 1
slot_cells_max = cells
slot_cells_cur = slot_cells_min
cells_drop = cells
slot_input_min = slot_cells_max + 1
slot_input_max = slot_input_min + input - 1
slot_input_cur = slot_input_min
input_drop = input
slot_output_1_min = 1
slot_output_1_max = output_1
slot_output_1_cur = slot_output_1_min
output_1_take = output_1
slot_output_2_min = slot_output_1_max + 1
slot_output_2_max = slot_output_2_min + output_2 - 1
slot_output_2_cur = slot_output_2_min
output_2_take = output_2
slot_output_3_min = slot_output_2_max + 1
slot_output_3_max = slot_output_3_min + output_3 - 1
slot_output_3_cur = slot_output_3_min
output_3_take = output_3
slot_output_4_min = slot_output_3_max + 1
slot_output_4_max = slot_output_4_min + output_4 - 1
slot_output_4_cur = slot_output_4_min
output_4_take = output_4
end
function enterSupplyLoop()
module = peripheral.wrap("right")
while true do
print("Resupplying...")
resupplyAll()
-- go to first centrifuge and wait to start (by checking ingredient)
moveTo(1, 0)
turtle.select(16)
while module.suckSneakyUp(1, input_drop) do
putBack = turtle.getItemCount(16)
sleep(1)
module.dropSneakyUp(1, putBack)
sleep(5)
end
print("Putting cells and ingredient in the centrifuges...")
-- putting in ingredients on the way there
for i = 1, 7, 2 do
for j = 0, 7, 1 do -- moving right
moveTo(i, j)
supplyCentrifuge()
end
for j = 7, 0, -1 do -- moving left
moveTo(i + 1, j)
supplyCentrifuge()
end
end
sleep(5)
-- wait a little so all centrifuges are ready for having their outputs taken
print("Getting outputs from the centrifuges...")
-- getting outputs out on the way back
for i = 7, 1, -2 do
for j = 0, 7, 1 do -- moving right
moveTo(i + 1, j)
emptyCentrifuge()
end
for j = 7, 0, -1 do -- moving left
moveTo(i, j)
emptyCentrifuge()
end
end
end
end
function platinumLoop()
print("Supplying Platinum Dust Centrifuges")
setupSlots(0, 1, 1, 1, 0, 0) -- 0 slots cells, 1 slot platinum dust
print("Starting in 5s...")
sleep(5)
enterSupplyLoop()
end
print("Centrifuges even item distribution program")
redstoneLoop()

View File

@@ -0,0 +1,425 @@
xRelPos = 0 -- "positive = forward"
yRelPos = 0 -- "positive = right"
zRelPos = 0 -- "positive = upwards"
facing = {
x = 1,
y = 0
}
cells_drop = 0
slot_cells_min = 0
slot_cells_max = 0
slot_cells_cur = 0
input_drop = 0
slot_input_min = 0
slot_input_max = 0
slot_input_cur = 0
output_1_take = 0
slot_output_1_min = 0
slot_output_1_max = 0
slot_output_1_cur = 0
output_2_take = 0
slot_output_2_min = 0
slot_output_2_max = 0
slot_output_2_cur = 0
output_3_take = 0
slot_output_3_min = 0
slot_output_3_max = 0
slot_output_3_cur = 0
output_4_take = 0
slot_output_4_min = 0
slot_output_4_max = 0
slot_output_4_cur = 0
function printPos()
print("At (", xRelPos, ", ", yRelPos, ", ", zRelPos, ") facing (", facing.x, ", ", facing.y, ")")
end
-- helper functions for movement
function forward()
xRelPos = xRelPos + facing.x
yRelPos = yRelPos + facing.y
if turtle.forward() then
return true
end
xRelPos = xRelPos - facing.x
yRelPos = yRelPos - facing.y
turtle.dig()
turtle.attack()
return false
end
function forceForward()
-- try moving forward until it works
while not forward() do end
end
function upwards()
zRelPos = zRelPos + 1
if turtle.up() then
return true
end
zRelPos = zRelPos - 1
turtle.digUp()
turtle.attackUp()
return false
end
function forceUpwards()
-- try moving upwards until it works
while not upwards() do end
end
function downwards()
zRelPos = zRelPos - 1
if turtle.down() then
return true
end
zRelPos = zRelPos + 1
turtle.digDown()
turtle.attackDown()
return false
end
function forceDownwards()
-- try moving upwards until it works
while not downwards() do end
end
function forcePlace()
-- try placing until it works
while not turtle.place() do
turtle.dig()
turtle.attack()
end
end
function forcePlaceDown()
-- try placing until it works
while not turtle.placeDown() do
turtle.digDown()
turtle.attackDown()
end
end
function forcePlaceUp()
-- try placing until it works
while not turtle.placeUp() do
turtle.digUp()
turtle.attackUp()
end
end
function turnRight()
if facing.x == 1 and facing.y == 0 then -- facing forward
facing.x = 0
facing.y = 1
elseif facing.x == 0 and facing.y == 1 then -- facing right
facing.x = -1
facing.y = 0
elseif facing.x == -1 and facing.y == 0 then -- facing backward
facing.x = 0
facing.y = -1
elseif facing.x == 0 and facing.y == -1 then -- facing left
facing.x = 1
facing.y = 0
else
print("turnRight: This should never happen")
end
turtle.turnRight()
end
function turnLeft()
if facing.x == 1 and facing.y == 0 then -- facing forward
facing.x = 0
facing.y = -1
elseif facing.x == 0 and facing.y == 1 then -- facing right
facing.x = 1
facing.y = 0
elseif facing.x == -1 and facing.y == 0 then -- facing backward
facing.x = 0
facing.y = 1
elseif facing.x == 0 and facing.y == -1 then -- facing left
facing.x = -1
facing.y = 0
else
print("turnLeft: This should never happen")
end
turtle.turnLeft()
end
function faceTo(x, y)
if (x == facing.x) and (y == facing.y) then
return
end
if (x == 1 and facing.x == -1) or (x == -1 and facing.x == 1) or (y == 1 and facing.y == -1) or (y == -1 and facing.y == 1) then
turnRight()
turnRight()
elseif (facing.y == -1 and x == 1) or (facing.y == 1 and x == -1) or (facing.x == 1 and y == 1) or (facing.x == -1 and y == -1) then
turnRight()
elseif (facing.y == -1 and x == -1) or (facing.y == 1 and x == 1) or (facing.x == 1 and y == -1) or (facing.x == -1 and y == 1) then
turnLeft()
else
print("faceTo: This should never happen")
end
end
function moveTo(x, y)
if (yRelPos > y) then
faceTo(0, -1)
while yRelPos > y do
forward()
end
elseif (yRelPos < y) then
faceTo(0, 1)
while yRelPos < y do
forward()
end
end
if (xRelPos > x) then
faceTo(-1, 0)
while xRelPos > x do
forward()
end
elseif (xRelPos < x) then
faceTo(1, 0)
while xRelPos < x do
forward()
end
end
end
function resupplyItem(slot, num)
module = peripheral.wrap("right")
turtle.select(slot)
items = turtle.getItemCount(slot)
while (items < num) do
module.suckSneaky(1, num - items)
sleep(1)
items = turtle.getItemCount(slot)
end
end
function resupplyAll()
-- reset current slot numbers
slot_output_1_cur = slot_output_1_min
slot_output_2_cur = slot_output_2_min
slot_output_3_cur = slot_output_3_min
slot_output_4_cur = slot_output_4_min
-- clean entire inventory
moveTo(0, 2); faceTo(-1, 0)
for i = 1, 16 do
while turtle.getItemCount(i) > 0 do
turtle.select(i)
turtle.drop()
end
end
-- get ingredient
moveTo(0, 1); faceTo(-1, 0)
slot_input_cur = slot_input_min
for i = slot_input_min, slot_input_max do
if (turtle.getItemCount(i) < 64) then
resupplyItem(i, 64)
end
end
-- get cells
moveTo(0, 0); faceTo(-1, 0)
slot_cells_cur = slot_cells_min
for i = slot_cells_min, slot_cells_max do
if (turtle.getItemCount(i) < 64) then
resupplyItem(i, 64)
end
end
end
function supplyCentrifuge()
module = peripheral.wrap("right")
-- drop cells from below (side 0)
if (cells_drop > 0) then
turtle.select(slot_cells_cur)
drop = cells_drop
if (turtle.getItemCount(slot_cells_cur) < drop) then
drop = drop - turtle.getItemCount(slot_cells_cur)
module.dropSneakyUp(0)
slot_cells_cur = slot_cells_cur + 1
turtle.select(slot_cells_cur)
end
module.dropSneakyUp(0, drop)
end
-- drop input from above (side 1)
turtle.select(slot_input_cur)
drop = input_drop
if (turtle.getItemCount(slot_input_cur) < drop) then
drop = drop - turtle.getItemCount(slot_input_cur)
module.dropSneakyUp(1)
slot_input_cur = slot_input_cur + 1
turtle.select(slot_input_cur)
end
module.dropSneakyUp(1, drop)
end
function emptyCentrifuge()
module = peripheral.wrap("right")
-- get output 1
turtle.select(slot_output_1_cur)
take = output_1_take
if (turtle.getItemCount(slot_output_1_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_1_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_1_cur = slot_output_1_cur + 1
turtle.select(slot_output_1_cur)
end
-- if no input is ready, move on immediately
if module.suckSneakyUp(2, take) == false then
return
end
-- get output 2
turtle.select(slot_output_2_cur)
take = output_2_take
if (turtle.getItemCount(slot_output_2_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_2_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_2_cur = slot_output_2_cur + 1
turtle.select(slot_output_2_cur)
end
module.suckSneakyUp(2, take)
-- get output 3
turtle.select(slot_output_3_cur)
take = output_3_take
if (turtle.getItemCount(slot_output_3_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_3_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_3_cur = slot_output_3_cur + 1
turtle.select(slot_output_3_cur)
end
module.suckSneakyUp(2, take)
-- get output 4
turtle.select(slot_output_4_cur)
take = output_4_take
if (turtle.getItemCount(slot_output_4_cur) + take > 64) then
take_now = 64 - turtle.getItemCount(slot_output_4_cur)
take = take - take_now
module.suckSneakyUp(2, take_now)
slot_output_4_cur = slot_output_4_cur + 1
turtle.select(slot_output_4_cur)
end
module.suckSneakyUp(2, take)
end
-- sets up slot numbers with <cells> slots for cells and <input> slots for input ingredient, and output 1 through 4 numbers of slots
function setupSlots(cells, input, output_1, output_2, output_3, output_4)
slot_cells_min = 1
slot_cells_max = cells
slot_cells_cur = slot_cells_min
cells_drop = cells
slot_input_min = slot_cells_max + 1
slot_input_max = slot_input_min + input - 1
slot_input_cur = slot_input_min
input_drop = input
slot_output_1_min = 1
slot_output_1_max = output_1
slot_output_1_cur = slot_output_1_min
output_1_take = output_1
slot_output_2_min = slot_output_1_max + 1
slot_output_2_max = slot_output_2_min + output_2 - 1
slot_output_2_cur = slot_output_2_min
output_2_take = output_2
slot_output_3_min = slot_output_2_max + 1
slot_output_3_max = slot_output_3_min + output_3 - 1
slot_output_3_cur = slot_output_3_min
output_3_take = output_3
slot_output_4_min = slot_output_3_max + 1
slot_output_4_max = slot_output_4_min + output_4 - 1
slot_output_4_cur = slot_output_4_min
output_4_take = output_4
end
function enterSupplyLoop()
module = peripheral.wrap("right")
while true do
print("Resupplying...")
resupplyAll()
-- go to first centrifuge and wait to start (by checking ingredient)
moveTo(1, 0)
turtle.select(16)
while module.suckSneakyUp(1, input_drop) do
putBack = turtle.getItemCount(16)
sleep(1)
module.dropSneakyUp(1, putBack)
sleep(5)
end
print("Putting cells and ingredient in the centrifuges...")
-- putting in ingredients on the way there
for i = 1, 7, 2 do
for j = 0, 7, 1 do -- moving right
moveTo(i, j)
supplyCentrifuge()
end
for j = 7, 0, -1 do -- moving left
moveTo(i + 1, j)
supplyCentrifuge()
end
end
sleep(5)
-- wait a little so all centrifuges are ready for having their outputs taken
print("Getting outputs from the centrifuges...")
-- getting outputs out on the way back
for i = 7, 1, -2 do
for j = 0, 7, 1 do -- moving right
moveTo(i + 1, j)
emptyCentrifuge()
end
for j = 7, 0, -1 do -- moving left
moveTo(i, j)
emptyCentrifuge()
end
end
end
end
function redstoneLoop()
print("Supplying Redstone Centrifuges")
setupSlots(4, 10, 1, 5, 1, 3) -- 4 slots cells, 10 slots redstone
print("Starting in 5s...")
sleep(5)
enterSupplyLoop()
end
print("Centrifuges even item distribution program")
redstoneLoop()

206
turtle_code/ibf.lua Normal file
View File

@@ -0,0 +1,206 @@
xRelPos = 0 -- "positive = forward"
yRelPos = 0 -- "positive = right"
zRelPos = 0 -- "positive = upwards"
facing = {
x = 1,
y = 0
}
slot_dust = 1
slot_empty = 2
num_dust = 4
function printPos()
print("At (", xRelPos, ", ", yRelPos, ", ", zRelPos, ") facing (", facing.x, ", ", facing.y, ")")
end
-- helper functions for movement
function forward()
xRelPos = xRelPos + facing.x
yRelPos = yRelPos + facing.y
if turtle.forward() then
return true
end
xRelPos = xRelPos - facing.x
yRelPos = yRelPos - facing.y
turtle.dig()
turtle.attack()
return false
end
function forceForward()
-- try moving forward until it works
while not forward() do end
end
function upwards()
zRelPos = zRelPos + 1
if turtle.up() then
return true
end
zRelPos = zRelPos - 1
turtle.digUp()
turtle.attackUp()
return false
end
function forceUpwards()
-- try moving upwards until it works
while not upwards() do end
end
function downwards()
zRelPos = zRelPos - 1
if turtle.down() then
return true
end
zRelPos = zRelPos + 1
turtle.digDown()
turtle.attackDown()
return false
end
function forceDownwards()
-- try moving upwards until it works
while not downwards() do end
end
function forcePlace()
-- try placing until it works
while not turtle.place() do
turtle.dig()
turtle.attack()
end
end
function forcePlaceDown()
-- try placing until it works
while not turtle.placeDown() do
turtle.digDown()
turtle.attackDown()
end
end
function forcePlaceUp()
-- try placing until it works
while not turtle.placeUp() do
turtle.digUp()
turtle.attackUp()
end
end
function turnRight()
if facing.x == 1 and facing.y == 0 then -- facing forward
facing.x = 0
facing.y = 1
elseif facing.x == 0 and facing.y == 1 then -- facing right
facing.x = -1
facing.y = 0
elseif facing.x == -1 and facing.y == 0 then -- facing backward
facing.x = 0
facing.y = -1
elseif facing.x == 0 and facing.y == -1 then -- facing left
facing.x = 1
facing.y = 0
else
print("turnRight: This should never happen")
end
turtle.turnRight()
end
function turnLeft()
if facing.x == 1 and facing.y == 0 then -- facing forward
facing.x = 0
facing.y = -1
elseif facing.x == 0 and facing.y == 1 then -- facing right
facing.x = 1
facing.y = 0
elseif facing.x == -1 and facing.y == 0 then -- facing backward
facing.x = 0
facing.y = 1
elseif facing.x == 0 and facing.y == -1 then -- facing left
facing.x = -1
facing.y = 0
else
print("turnLeft: This should never happen")
end
turtle.turnLeft()
end
function faceTo(x, y)
if (x == facing.x) and (y == facing.y) then
return
end
if (x == 1 and facing.x == -1) or (x == -1 and facing.x == 1) or (y == 1 and facing.y == -1) or (y == -1 and facing.y == 1) then
turnRight()
turnRight()
elseif (facing.y == -1 and x == 1) or (facing.y == 1 and x == -1) or (facing.x == 1 and y == 1) or (facing.x == -1 and y == -1) then
turnRight()
elseif (facing.y == -1 and x == -1) or (facing.y == 1 and x == 1) or (facing.x == 1 and y == -1) or (facing.x == -1 and y == 1) then
turnLeft()
else
print("faceTo: This should never happen")
end
end
function moveTo(x, y)
if (yRelPos > y) then
faceTo(0, -1)
while yRelPos > y do
forward()
end
elseif (yRelPos < y) then
faceTo(0, 1)
while yRelPos < y do
forward()
end
end
if (xRelPos > x) then
faceTo(-1, 0)
while xRelPos > x do
forward()
end
elseif (xRelPos < x) then
faceTo(1, 0)
while xRelPos < x do
forward()
end
end
end
function resupplyItem(slot, num)
turtle.select(slot)
while (turtle.getItemCount(slot) < num) do
sleep(1)
turtle.suckDown(num - turtle.getItemCount(slot))
end
end
print("Industrial Blast Furnace even item distribution program")
while true do
resupplyItem(slot_dust, num_dust)
for i = 1, 4 do
forceForward(); forceForward()
-- check if anything is still in the furnace
-- use different slot than dust slot since the item type may have changed
turtle.select(slot_empty)
while turtle.suckDown() do
turtle.dropDown()
sleep(5)
end
turtle.select(slot_dust)
turtle.dropDown(1)
forceForward(); forceForward()
turnLeft()
end
end