-
Notifications
You must be signed in to change notification settings - Fork 0
/
reload.lua
37 lines (33 loc) · 943 Bytes
/
reload.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
print("reloading")
local MOVE_SIDE = "front"
local SCREW_SIDE = "left"
local PLACE_SIDE = "right"
local ROTATE_SIDE = "back"
local PUSH_SIDE = "top"
local cannons = {peripheral.find("cbc_cannon_mount")}
local fncs = {}
for i, cannon in ipairs(cannons) do
fncs[i] = cannon.disassemble
end
parallel.waitForAll(table.unpack(fncs))
redstone.setOutput(SCREW_SIDE, true)
os.sleep(1)
redstone.setOutput(SCREW_SIDE, false)
redstone.setOutput(MOVE_SIDE, true)
os.sleep(1)
redstone.setOutput(MOVE_SIDE, false)
redstone.setOutput(PLACE_SIDE, true)
os.sleep(1)
redstone.setOutput(PLACE_SIDE, false)
redstone.setOutput(ROTATE_SIDE, true)
os.sleep(1)
redstone.setOutput(ROTATE_SIDE, false)
redstone.setOutput(PUSH_SIDE, true)
os.sleep(3)
redstone.setOutput(PUSH_SIDE, false)
redstone.setOutput(MOVE_SIDE, true)
os.sleep(1)
redstone.setOutput(MOVE_SIDE, false)
redstone.setOutput(SCREW_SIDE, true)
os.sleep(0.25)
redstone.setOutput(SCREW_SIDE, false)