From a9e321fa620e425e55b61e50a0b24d13cd85f49d Mon Sep 17 00:00:00 2001 From: Izaya Date: Sun, 23 Apr 2017 10:37:53 +1000 Subject: [PATCH] Cleansing. --- modules/bcstart.lua | 1 - modules/counter.lua | 4 --- modules/{ => debug}/evout.lua | 0 modules/net.lua | 56 ----------------------------------- modules/pev.lua | 8 ----- modules/ping.lua | 8 ----- modules/reptest.lua | 3 -- modules/simplefs.lua | 1 - 8 files changed, 81 deletions(-) delete mode 100644 modules/bcstart.lua delete mode 100644 modules/counter.lua rename modules/{ => debug}/evout.lua (100%) delete mode 100644 modules/net.lua delete mode 100644 modules/pev.lua delete mode 100644 modules/ping.lua delete mode 100644 modules/reptest.lua delete mode 100644 modules/simplefs.lua diff --git a/modules/bcstart.lua b/modules/bcstart.lua deleted file mode 100644 index 4a9c9b6..0000000 --- a/modules/bcstart.lua +++ /dev/null @@ -1 +0,0 @@ -ns(01,computer.address()) diff --git a/modules/counter.lua b/modules/counter.lua deleted file mode 100644 index a6a0f6c..0000000 --- a/modules/counter.lua +++ /dev/null @@ -1,4 +0,0 @@ -function count() - for i = 1, 10 do print(i) C.yield() end -end -s("counter",count) diff --git a/modules/evout.lua b/modules/debug/evout.lua similarity index 100% rename from modules/evout.lua rename to modules/debug/evout.lua diff --git a/modules/net.lua b/modules/net.lua deleted file mode 100644 index 9245d5a..0000000 --- a/modules/net.lua +++ /dev/null @@ -1,56 +0,0 @@ -tMn, tMs, tTs, CT, CO = {},{},{},component,computer -for m in CT.list("modem") do - T.insert(tMs,CT.proxy(m)) - tMs[#tMs].open(4096) -end -for m in CT.list("tunnel") do - T.insert(tTs,CT.proxy(m)) - tTs[#tTs].open(4096) -end - -function ncs(n) - for k,v in ipairs(tMn) do - if v == n then return true end - end -end -function grn() - repeat - mn=math.random(-65536,65535) - until not ncs(mn) - return mn -end -function rns(...) - for k,m in ipairs(tMs) do - m.broadcast(4096,...) - end - for m in ipairs(tTs) do - m.send(4096,...) - end -end -function ns(to,msg) - if msg:len() > 4096 then - msg=msg:sub(1,4096) - end - rns(grn(),to,CO.address(),msg) -end -function netrecv() - CO.beep() - while true do - evtype,_,_,_,_,mn,to,from,msg=l() - if evtype == "modem_message" then - ns("Debug 1",mn,to,from,msg) - if not ncs(mn) then - if to == CO.address() then - h("net_msg",from,msg) - CO.beep() - else - rns(mn,to,from,msg) - end - end - end - C.yield() - end -end -s("netrecv",function() - while true do ns(pcall(netrecv)) end -end) diff --git a/modules/pev.lua b/modules/pev.lua deleted file mode 100644 index fd1bc80..0000000 --- a/modules/pev.lua +++ /dev/null @@ -1,8 +0,0 @@ -function pev() - for i = 1, 10 do - te=l() - print(T.unpack(te)) - C.yield() - end -end -s("evprint",pev) diff --git a/modules/ping.lua b/modules/ping.lua deleted file mode 100644 index bb29b6e..0000000 --- a/modules/ping.lua +++ /dev/null @@ -1,8 +0,0 @@ -s("pingd",function() - while true do - local evt={l()} - if evt[1] == "net_msg" then - ns(evt[2],CO.address,"Ping!") - end - end -end) diff --git a/modules/reptest.lua b/modules/reptest.lua deleted file mode 100644 index b288b9a..0000000 --- a/modules/reptest.lua +++ /dev/null @@ -1,3 +0,0 @@ ---[[this is test 1]] ---[[this is test 2]] -this is not test 3 --[[this is test 3]] this is also not test 3 diff --git a/modules/simplefs.lua b/modules/simplefs.lua deleted file mode 100644 index e41287f..0000000 --- a/modules/simplefs.lua +++ /dev/null @@ -1 +0,0 @@ -fs=component.proxy(computer.tmpAddress())