View difference between Paste ID: Yz4CfHb9 and aAxRpLdX
SHOW: | | - or go back to the newest paste.
1-
--File: /cattech/comms.lua
1+
--File: /testCode
2
dofile("/cattech/common.lua")
3-
function initializeRednetModem()
3+
dofile("/cattech/comms.lua")
4-
    local sides = {"left", "right", "top", "bottom", "front", "back"}
4+
5-
    
5+
log("info","Running testCode")
6-
    for _, side in ipairs(sides) do
6+
7-
        if peripheral.isPresent(side) then
7+
local haveRednet = initializeRednetModem()
8-
            local peripheralType = peripheral.getType(side)
8+
9-
            if peripheralType == "modem" or peripheralType == "ender_modem" then
9+
while haveRednet do
10-
                rednet.open(side)  -- Initialize rednet on the modem
10+
	chunkload()
11-
                log("debug",peripheralType .. " available on " .. side .. ".  Rednet active.")
11+
12-
                return true
12+
	for i = 1, 12 do
13-
            else
13+
		rednet.broadcast("status zzz","worldServer")
14-
				log("debug","Peripheral found : " .. (peripheralType or "none"))
14+
		os.sleep(5)
15-
			end
15+
	end
16-
        end
16+