Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Main Duper Controller
- local protocol = "TNTDUPER";
- rednet.open("back");
- local enderAddress;
- local singularityAddress;
- local tntAddress;
- while true do
- enderAddress = rednet.lookup(protocol, "ender_dust");
- singularityAddress = rednet.lookup(protocol, "singularity");
- tntAddress = rednet.lookup(protocol, "duper");
- if enderAddress ~= nil and singularityAddress ~= nil and tntAddress ~= nil then break; end
- sleep(0);
- end
- term.clear();
- term.setCursorPos(1,1);
- function getDispenserStatus(dispenser)
- local dispenserAddress = rednet.lookup(protocol, dispenser);
- if dispenserAddress == nil then return false; end
- rednet.send(dispenserAddress, "hasItem", protocol);
- local from, has = rednet.receive(protocol, 1);
- if has == nil then has = false; end
- return has;
- end
- function activateDispensers()
- rednet.send(enderAddress, "triggerDispenser", protocol);
- rednet.send(singularityAddress, "triggerDispenser", protocol);
- end
- function activateTNT()
- rednet.send(tntAddress, "activate", protocol);
- end
- function server()
- while true do
- if getDispenserStatus("ender_dust") and getDispenserStatus("singularity") and redstone.getInput("front") == false then
- activateTNT();
- sleep(3);
- activateDispensers();
- sleep(3);
- end
- sleep(0);
- end
- end
- server();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement