diff --git a/Embedded/microtel/microtel-3.lua.min b/Embedded/microtel/microtel-3.lua.min index 97b4d6d..4f511f4 100644 --- a/Embedded/microtel/microtel-3.lua.min +++ b/Embedded/microtel/microtel-3.lua.min @@ -1,20 +1,20 @@ { {"eventTab","Z"}, {"modems","M"}, - {"qPacket","qP"}, - {"packetID","pID"}, - {"packetType","pT"}, + {"qPacket","A"}, + {"packetID","B"}, + {"packetType","E"}, {"to","T"}, - {"vport","vP"}, + {"vport","F"}, {"data","D"}, - {"rawSendPacket","rS"}, - {"sendPacket","sP"}, - {"genPacketID","gP"}, - {"packetCache","pC"}, - {"checkCache","cC"}, - {"routeCache","rC"}, - {"realComputerPullSignal","rCPE"}, - {"packetQueue","pQ"}, + {"rawSendPacket","G"}, + {"sendPacket","I"}, + {"genPacketID","J"}, + {"packetCache","L"}, + {"checkCache","N"}, + {"routeCache","O"}, + {"realComputerPullSignal","X"}, + {"packetQueue","P"}, {"computer","C"}, {"C.uptime","U"}, {"table.unpack","Y"}, diff --git a/Embedded/microtel/microtel-3.lua.min-old b/Embedded/microtel/microtel-3.lua.min-old new file mode 100644 index 0000000..97b4d6d --- /dev/null +++ b/Embedded/microtel/microtel-3.lua.min-old @@ -0,0 +1,24 @@ +{ + {"eventTab","Z"}, + {"modems","M"}, + {"qPacket","qP"}, + {"packetID","pID"}, + {"packetType","pT"}, + {"to","T"}, + {"vport","vP"}, + {"data","D"}, + {"rawSendPacket","rS"}, + {"sendPacket","sP"}, + {"genPacketID","gP"}, + {"packetCache","pC"}, + {"checkCache","cC"}, + {"routeCache","rC"}, + {"realComputerPullSignal","rCPE"}, + {"packetQueue","pQ"}, + {"computer","C"}, + {"C.uptime","U"}, + {"table.unpack","Y"}, + {"COMPUTER","computer"}, + {"UPTIME","C.uptime"}, + {"UNPACK","table.unpack"}, +} diff --git a/Embedded/microtel/microtel-5-core.lua b/Embedded/microtel/microtel-5-core.lua index 419befc..131093e 100644 --- a/Embedded/microtel/microtel-5-core.lua +++ b/Embedded/microtel/microtel-5-core.lua @@ -1,7 +1,7 @@ function net.socket(address, port, sclose) local conn, rb = {}, "" conn.state, conn.buffer, conn.port, conn.address = "o", "", tonumber(port), address - function conn.r(self,length) + function conn.r(self,l) rb=self.buffer:sub(1,l) self.buffer=self.buffer:sub(l+1) return rb diff --git a/Embedded/microtel/microtel-5-core.lua.min b/Embedded/microtel/microtel-5-core.lua.min index 3cc44fc..60da905 100644 --- a/Embedded/microtel/microtel-5-core.lua.min +++ b/Embedded/microtel/microtel-5-core.lua.min @@ -5,6 +5,9 @@ {"port","P"}, {"conn.state","conn.s"}, {"conn.buffer","conn.b"}, + {"self.buffer","self.b"}, + {"self.state","self.s"}, + {"self","s"}, {"conn","C"}, {"etype","E"}, {"from","F"}, diff --git a/Embedded/microtel/microtel-5-open.lua b/Embedded/microtel/microtel-5-open.lua index eaa24ae..b2f1a23 100644 --- a/Embedded/microtel/microtel-5-open.lua +++ b/Embedded/microtel/microtel-5-open.lua @@ -1,7 +1,7 @@ net.timeout = 60 function net.open(address,vport) local st,from,port,data=computer.uptime() - net.send(address,port,"openstream") + net.send(address,vport,"openstream") repeat _, from, port, data = computer.pullSignal(0.5) if computer.uptime() > st+net.timeout then return false end @@ -10,5 +10,5 @@ function net.open(address,vport) repeat _, from, port, data = computer.pullSignal(0.5) until from == address and port == vport - return socket(address,vport,data) + return net.socket(address,vport,data) end diff --git a/Embedded/minify.lua b/Embedded/minify.lua index 52a1578..fa95a28 100644 --- a/Embedded/minify.lua +++ b/Embedded/minify.lua @@ -31,6 +31,9 @@ local replacements={ {" %* ","*"}, {" \n","\n"}, {" %.%. ",".."}, +{"([%)%}])%s(%a)","%1%2"}, +{"(%d)%s([G-Zg-z])","%1%2"}, +{"([\"'])%s(%a)","%1%2"}, {"%-%-.-\n",""}, } diff --git a/Embedded/miniprompt.lua b/Embedded/miniprompt.lua new file mode 100644 index 0000000..bf7a3b3 --- /dev/null +++ b/Embedded/miniprompt.lua @@ -0,0 +1,35 @@ +local ga,sa = component.list("gpu")(),component.list("screen")() +GPU = component.proxy(ga) +GPU.bind(sa) + +write = vt100emu(GPU) +function print(...) + for k,v in pairs({...}) do + write(tostring(v).."\n") + end +end +function read() + local sBuffer = "" + repeat + local tSignal = {computer.pullSignal()} + if tSignal[1] == "key_down" then + if tSignal[3] > 31 and tSignal[3] < 127 then + write(string.char(tSignal[3])) + sBuffer = sBuffer .. string.char(tSignal[3]) + elseif tSignal[3] == 8 and tSignal[4] == 14 and S:len() > 0 then + write("\8 \8") + sBuffer = sBuffer:sub(1,-2) + end + end + until tSignal[1] == "key_down" and tSignal[3] == 13 and tSignal[4] == 28 + write("\n") + return sBuffer +end +--API +while true do + write(_VERSION.."> ") + tResult = {pcall(load(read()))} + for k,v in pairs(tResult) do + print(v) + end +end diff --git a/Embedded/miniprompt.lua.min b/Embedded/miniprompt.lua.min new file mode 100644 index 0000000..96e6892 --- /dev/null +++ b/Embedded/miniprompt.lua.min @@ -0,0 +1,12 @@ +{ + {"write","W"}, + {"print","P"}, + {"read","R"}, + {"tSignal","T"}, + {"sBuffer","S"}, + {"tResult","V"}, + {"GPU","B"}, + {"ga","N"}, + {"sa","M"}, + {"%-%-API","read,write,print=R,W,P"}, +} diff --git a/Embedded/nminiprompt.lua.min b/Embedded/nminiprompt.lua.min new file mode 100644 index 0000000..37bb2ae --- /dev/null +++ b/Embedded/nminiprompt.lua.min @@ -0,0 +1,3 @@ +{ + {"component","GC"}, +} diff --git a/Embedded/vt100.lua.min b/Embedded/vt100.lua.min index c017132..a88da70 100644 --- a/Embedded/vt100.lua.min +++ b/Embedded/vt100.lua.min @@ -16,4 +16,5 @@ {"my","H"}, {"sx","T"}, {"sy","U"}, + {"mode","M"}, }