Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mag = assert(peripheral.find("magnetic_card_manipulator"))
- local blockReader = assert(peripheral.find("blockReader"))
- local expect = require("cc.expect").expect
- local function deployerClick()
- local state = blockReader.getBlockData().State
- while state ~= "EXPANDING" do
- redstone.setAnalogOutput("top",15)
- sleep(0.05)
- state = blockReader.getBlockData().State
- end
- while state == "EXPANDING" do
- redstone.setAnalogOutput("top",15)
- sleep(0.05)
- state = blockReader.getBlockData().State
- end
- redstone.setAnalogOutput("top",0)
- end
- return function(cmd)
- expect(1,cmd,"string")
- local json = textutils.serialiseJSON({
- text=string.format("%x-%x-%x",math.random(16^6),math.random(16^2),math.random(16^5)),
- clickEvent={
- action="run_command",
- value=cmd
- }
- })
- while not mag.writeCard(json) do
- sleep(0.05)
- end
- sleep(0.25) --Wait for other deployer to click
- deployerClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment