SHOW:
|
|
- or go back to the newest paste.
1 | - | local robot=require("robot") |
1 | + | --ReactorControll by SergOmarov |
2 | - | local c=require("component") |
2 | + | local robot=require("robot") |
3 | - | local craft=c.crafting |
3 | + | local c=require("component") |
4 | - | local rs=c.redstone |
4 | + | local craft=c.crafting |
5 | - | inv.select(1) |
5 | + | local rs=c.redstone |
6 | - | if(inv.getStackInInternalSlot(2).name~="minecraft:blockRedstone" or inv.getStackInInternalSlot(2).name~="minecraft:blockLapis")then |
6 | + | inv.select(1) |
7 | - | print("Пожалуйста, вставьте во второй слот блоки красной пыли или лазурита(в зависимости от ващих конденсаторов") |
7 | + | if(inv.getStackInInternalSlot(2).name~="minecraft:blockRedstone" or inv.getStackInInternalSlot(2).name~="minecraft:blockLapis")then |
8 | - | end |
8 | + | print("Пожалуйста, вставьте во второй слот блоки красной пыли или лазурита(в зависимости от ващих конденсаторов") |
9 | - | local inv=c.inventory_controller |
9 | + | end |
10 | - | local function repairItem(slot) |
10 | + | local inv=c.inventory_controller |
11 | - | inv.suckFromSlot(0,j) |
11 | + | local function repairItem(slot) |
12 | - | craft.craft() |
12 | + | inv.suckFromSlot(0,j) |
13 | - | inv.dropIntoSlot(0,j) |
13 | + | craft.craft() |
14 | - | end |
14 | + | inv.dropIntoSlot(0,j) |
15 | - | local slots={ |
15 | + | end |
16 | - | |
16 | + | local slots={ |
17 | - | } |
17 | + | |
18 | - | local i=true |
18 | + | } |
19 | - | while i do |
19 | + | local i=true |
20 | - | for j=1,#slots do |
20 | + | while i do |
21 | - | local item=inv.getStackInSlot(0,j) |
21 | + | for j=1,#slots do |
22 | - | if(item.damage/item.maxDamage>0.1)then |
22 | + | local item=inv.getStackInSlot(0,j) |
23 | - | repairItem(j) |
23 | + | if(item.damage/item.maxDamage>0.1)then |
24 | - | end |
24 | + | repairItem(j) |
25 | - | end |
25 | + | end |
26 | - | and |
26 | + | end |
27 | and | |
28 | rs.setOutput(3,1) |