1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 10:38:05 +11:00

minified it a bit more

This commit is contained in:
Izaya 2018-03-18 12:16:31 +11:00
parent 4656df51b7
commit 53d362afbe
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
_G.net={} _G.net={}
do do
local M,packetQueue,pC,rC,C={},{},{},{},computer local M,pQ,pC,rC,C={},{},{},{},computer
net.port,net.hostname,net.route=4096,C.address():sub(1,8),true net.port,net.hostname,net.route=4096,C.address():sub(1,8),true
for a in component.list("modem") do for a in component.list("modem") do
M[a]=component.proxy(a) M[a]=component.proxy(a)
@ -25,7 +25,7 @@ end
end end
function net.send(T,vP,D,pT,pID) function net.send(T,vP,D,pT,pID)
pT,pID=pT or 1,pID or gP() pT,pID=pT or 1,pID or gP()
packetQueue[pID]={pT,T,vP,D,0} pQ[pID]={pT,T,vP,D,0}
sP(pID,pT,T,vP,D) sP(pID,pT,T,vP,D)
end end
local function cC(pID) local function cC(pID)
@ -58,14 +58,14 @@ if eT[7]==1 then
sP(gP(),2,eT[9],eT[10],eT[6]) sP(gP(),2,eT[9],eT[10],eT[6])
end end
else else
packetQueue[eT[11]]=nil pQ[eT[11]]=nil
end end
elseif net.route and cC(eT[6]) then elseif net.route and cC(eT[6]) then
sP(eT[6],eT[7],eT[8],eT[9],eT[10],eT[11]) sP(eT[6],eT[7],eT[8],eT[9],eT[10],eT[11])
end end
pC[eT[6]]=C.uptime() pC[eT[6]]=C.uptime()
end end
for k,v in pairs(packetQueue) do for k,v in pairs(pQ) do
if C.uptime()>v[5] then if C.uptime()>v[5] then
sP(k,table.unpack(v)) sP(k,table.unpack(v))
v[5]=C.uptime()+30 v[5]=C.uptime()+30

View File

@ -15,6 +15,7 @@ sed -i -e 's/packetCache/pC/g' microtel-3-mini.lua
sed -i -e 's/checkCache/cC/g' microtel-3-mini.lua sed -i -e 's/checkCache/cC/g' microtel-3-mini.lua
sed -i -e 's/routeCache/rC/g' microtel-3-mini.lua sed -i -e 's/routeCache/rC/g' microtel-3-mini.lua
sed -i -e 's/realComputerPullSignal/rCPE/g' microtel-3-mini.lua sed -i -e 's/realComputerPullSignal/rCPE/g' microtel-3-mini.lua
sed -i -e 's/packetQueue/pQ/g' microtel-3-mini.lua
sed -i -e 's/computer/C/g' microtel-3-mini.lua sed -i -e 's/computer/C/g' microtel-3-mini.lua
sed -i -e 's/NOTCOMPUTER/computer/g' microtel-3-mini.lua sed -i -e 's/NOTCOMPUTER/computer/g' microtel-3-mini.lua
lua strip.lua microtel-3-mini.lua microtel-3-mini.lua lua strip.lua microtel-3-mini.lua microtel-3-mini.lua