--Variables local side local inputSide local noSys local systemIds = {} local id local isChecked local message local event local RedstoneInput term.setCursorPos(1,1) -- Fixes the cursor position term.clear() write ("Please enter side of Input: ") inputSide = read() write ("Please enter side of Modem: ") side = read() write("\nPlease enter the amount of systems to check: ") noSys = read() noSys = tonumber(noSys) if (noSys <= 0) then write ("\nToo few systems, program restarting \n") else write("\nPlease enter the ID's of the systems \nFirst ID: " ) for i = 1, noSys do id = read() id = tonumber(id) table.insert(systemIds, i, id) if ( i ~= noSys) then write("\nNext ID: ") end end end while true do term.setCursorPos(1,1) -- Fixes the cursor position term.clear() RedstoneInput = false while (RedstoneInput ~= true) do write ("\nChecking for Begin Checking redstone input") RedstoneInput = rs.getInput(inputSide) sleep(3) end rs.setOutput("bottom", true) sleep (2) rs.setOutput("bottom", false) if (RedstoneInput == true) then rednet.open(side) write("|-----------------------------------------------|\n") for i = 1, noSys do isChecked = false while (isChecked == false) do rednet.send(systemIds[i], "Check System") write("\nSent Check System to ".. systemIds[i] .. "\n") write ("Testing ".. systemIds[i]) id, message = rednet.receive(2) write ("\nChecked for message\n") if (id == systemIds[i]) then isChecked = true rednet.send(systemIds[i], "received") write ("Sent recieved to client") write("\n".. message) end end end sleep(3) write ("|-----------------------------------------------|\n") end rednet.close(side) write ("\nPress any key to continue") while true do local sEvent = os.pullEvent("key") if (sEvent == "key") then break end end end end