Describe the bug
A clear and concise description of what the bug is.
Provide the Debug-File you can generate with SMM.
To Reproduce
Steps to reproduce the behavior:
Build this computer ...
CPU
2 Ram
Network
Build this computer network ...
Server with the code below and then a sender the code is what I used to test the concept and it works
print("Server-Sender-v0.0.3")
SwitchServer = "DC73C2544A7BF761FB9BED8C695A5678"
Port = 3
netcard = component.proxy("ED0BD75940174E516F293F9EB4AECBC7")
netcard:open(POT)
Status = "IronPlates"
function SendToServer(Server, Port, Data, Print)
netcard:send(Server, Port, Data)
if Print == true then print("Data Sent: "..Server.." / "..Port) end
end
SendToServer(SwitchServer,Port,Status,true)
Configure the network this way...
Requester -> Server -> Switch
Use this code...
netcard = component.proxy("DC73C2544A7BF761FB9BED8C695A5678")
print("Switch Server for Ficsit Storage Manager 3030")
print("v-0.0.3")
print("Running....")
function sleep(x)
x = x * 1000
local millis = computer.millis()
while computer.millis() - millis < x do
computer.skip()
end
end
function EXT_Connection(Switch,State)
function Connection_GPwrSwitch()
Comp = component.proxy(component.findComponent(Switch)[1])
end -- END Connection_GPwrSwitch()
Connection_GPwrSwitch()
Comp.isSwitchOn = State
ReturnState = Comp.isBridgeActive
return ReturnState
end -- END EXT_Connection
function CheckNetwork()
--event.listen(netcard)
e, s, sender, port, message = event.pull()
if e == "NetworkMessage" then
sender = Factory_Names[port]
print(sender.." | " .. port.." | ".. message)
--if sender == "Copper Factory" then Factory_Copper = message end
if sender == "Storage" then
if message == "Error" then
computer.beep(1)
flag[1] = 1
end
if message == wire[1] then
EXT_Connection(wire[1],true)
end
if message == wire[1].." Full" then
EXT_Connection(wire[1],false)
end
end
end
end
while true do
CheckNetwork()
if flag[1] == 1 then
print("Flash Light")
print("[System] : Error at : "..Factory_Names[port])
end
sleep(0.1)
end
Do this...
Expected behavior
Server code above should receive the following Storage | 3 | IronRods and then switch the relevent switch on or off depending what it
receives.
Storage | 3 | IronRods = Switch On
Storage | 3 | IronRods Full = Switch Off
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Like version number (for in-dev versions state the build number and the branch)
Describe the bug A clear and concise description of what the bug is.
Provide the Debug-File you can generate with SMM.
To Reproduce Steps to reproduce the behavior:
Build this computer ... CPU 2 Ram Network
Build this computer network ... Server with the code below and then a sender the code is what I used to test the concept and it works
print("Server-Sender-v0.0.3") SwitchServer = "DC73C2544A7BF761FB9BED8C695A5678" Port = 3 netcard = component.proxy("ED0BD75940174E516F293F9EB4AECBC7") netcard:open(POT) Status = "IronPlates"
function SendToServer(Server, Port, Data, Print) netcard:send(Server, Port, Data) if Print == true then print("Data Sent: "..Server.." / "..Port) end end
SendToServer(SwitchServer,Port,Status,true)
Requester -> Server -> Switch
-- [3] Ficsit Storage Manager 3030
--for n=1,10 do netcard:open(3) --end
flag = {0,""}
Factory_Names = {"Main Hub ","Battery Storage","Storage","Main Storage"}
wire = {"IronPlates"}
print("Switch Server for Ficsit Storage Manager 3030") print("v-0.0.3") print("Running....")
function sleep(x) x = x * 1000 local millis = computer.millis() while computer.millis() - millis < x do computer.skip() end end
function EXT_Connection(Switch,State) function Connection_GPwrSwitch() Comp = component.proxy(component.findComponent(Switch)[1]) end -- END Connection_GPwrSwitch() Connection_GPwrSwitch() Comp.isSwitchOn = State ReturnState = Comp.isBridgeActive return ReturnState end -- END EXT_Connection
function CheckNetwork() --event.listen(netcard) e, s, sender, port, message = event.pull() if e == "NetworkMessage" then sender = Factory_Names[port] print(sender.." | " .. port.." | ".. message) --if sender == "Copper Factory" then Factory_Copper = message end if sender == "Storage" then if message == "Error" then computer.beep(1) flag[1] = 1 end if message == wire[1] then EXT_Connection(wire[1],true) end if message == wire[1].." Full" then EXT_Connection(wire[1],false) end end
end end
while true do CheckNetwork() if flag[1] == 1 then print("Flash Light") print("[System] : Error at : "..Factory_Names[port]) end sleep(0.1) end
Expected behavior Server code above should receive the following Storage | 3 | IronRods and then switch the relevent switch on or off depending what it receives. Storage | 3 | IronRods = Switch On Storage | 3 | IronRods Full = Switch Off
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here. Like version number (for in-dev versions state the build number and the branch)