33 tick = 2100 ,
44 timestamp = 0 ,
55 sent = {},
6- sep = {},
76}
87
9- queue .exec = function (cmds )
8+ queue .exec = function (cmds , grouped )
109 queue .append (cmds )
1110 queue .send ()
1211end
1615queue .discard = function ()
1716 queue .queue = {}
1817end
19- queue .append = function (cmds )
20- for k ,v in pairs (cmds ) do
21- table.insert (queue .queue ,v )
18+ queue .append = function (cmds ,grouped )
19+ if grouped then
20+ table.insert (queue .queue ,cmds )
21+ else
22+ for k ,v in pairs (cmds ) do
23+ table.insert (queue .queue ,{v })
24+ end
2225 end
2326end
2427queue .sort = function (fisrt ,second )
@@ -30,7 +33,7 @@ queue.full=function()
3033 table.insert (queue .sent ,ts )
3134 end
3235end
33- queue .send = function ()
36+ queue .clean = function ()
3437 local ts = Milliseconds ()
3538 table.sort (queue .sent ,queue .sort )
3639 local newsent = {}
@@ -40,14 +43,21 @@ queue.send=function()
4043 end
4144 end
4245 queue .sent = newsent
46+ end
47+ queue .send = function ()
48+ queue .clean ()
4349 while # queue .queue ~= 0 and # queue .sent < queue .limit () do
44- local cmd = table.remove (queue .queue ,1 )
45- local ts = Milliseconds ()
46- table.insert (queue .sent ,ts )
47- SendNoEcho (cmd )
48- if queue .sep [cmd ] then
50+ local cmds = queue .queue [1 ]
51+ if queue .limit ()-# queue .sent <# cmds then
4952 queue .full ()
50- return
53+ return
54+ end
55+ table.remove (queue .queue ,1 )
56+ for k ,v in pairs (cmds ) do
57+ local ts = Milliseconds ()
58+ table.insert (queue .sent ,ts )
59+ SendNoEcho (v )
60+ if walkecho == true then Note (v ) end
5161 end
5262 end
5363end
0 commit comments