View difference between Paste ID: qCkfNvR4 and siPGggPx
SHOW: | | - or go back to the newest paste.
1-
--[[
1+
2-
WarpDrive Wireless Force Field Projector control.
2+
local wlan_channel = 14
3-
Listens on channel for Enable/Disable messages from Server.
3+
4-
Copyright InfiniteBlock. 2020 [THC]
4+
5-
]]--
5+
6
wlan.open(wlan_channel)
7-
local wlan_channel = 3
7+
8
print ('Awaiting Commands....')
9
while true do
10-
-- Find the Force Field's.
10+
11-
sides = peripheral.getNames()
11+
12-
forcefieldprojectors = {}
12+
  if string.match(msg,"WWCSON") then
13
    print("Woot Enabled")
14-
for _, side in pairs(sides) do
14+
	redstone.setAnalogOutput("back",10)
15-
  os.sleep(0)
15+
16-
  local componentType = peripheral.getType(side)
16+
  if string.match(msg,"WWCSOFF") then
17-
  if componentType == "warpdriveForceFieldProjector" then
17+
    print("Woot Disabled")
18-
    table.insert(forcefieldprojectors, peripheral.wrap(side))
18+
	redstone.setAnalogOutput("back",0)
19-
    print(componentType .. " Linked!")
19+
20
end