This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- tty.lua | |
| -- | |
| -- Written by [aka]bomb, 2023 | |
| -- | |
| -- Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| -- this software and associated documentation files (the "Software"), to deal in | |
| -- the Software without restriction, including without limitation the rights to | |
| -- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local s,u=select,table.unpack or unpack debug.setmetatable(3,{__call=function(x,...)local n,t=s('#',...),{}for i=1,n do t[i]=x*s(i,...) end return u(t,1,n)end}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local oohsub = { o = 'e', O = 'E' } | |
| local function oo(m) | |
| return m:sub(1, -2) .. m:sub(-1):gsub("[Oo]", oohsub) | |
| end | |
| local function isupper(s) return s:upper() == s end | |
| local function dj(m) | |
| local wordc = m:sub(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- tserial.function.lua | |
| -- | |
| -- Written by [aka]bomb, 2022 | |
| -- | |
| -- Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| -- this software and associated documentation files (the "Software"), to deal in | |
| -- the Software without restriction, including without limitation the rights to | |
| -- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
| -- of the Software, and to permit persons to whom the Software is furnished to do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- printf.lua | |
| -- | |
| -- Written by [aka]bomb, 2022 | |
| -- | |
| -- Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| -- this software and associated documentation files (the "Software"), to deal in | |
| -- the Software without restriction, including without limitation the rights to | |
| -- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
| -- of the Software, and to permit persons to whom the Software is furnished to do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- hook.lua | |
| -- | |
| -- Written by [aka]bomb, 2022 | |
| -- | |
| -- Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| -- this software and associated documentation files (the "Software"), to deal in | |
| -- the Software without restriction, including without limitation the rights to | |
| -- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
| -- of the Software, and to permit persons to whom the Software is furnished to do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return function imean(m, v, i) | |
| return ((m * i) + v) / (i + 1) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local abs = math.abs | |
| return function (a, b, m) | |
| local diff = b - a | |
| local hm = m * 0.5 | |
| if diff > hm then | |
| return diff - m | |
| elseif diff < -hm then | |
| return m + diff | |
| end | |
| return diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- linf.lua | |
| -- | |
| -- Written by [aka]bomb, 2022 | |
| -- | |
| -- Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| -- this software and associated documentation files (the "Software"), to deal in | |
| -- the Software without restriction, including without limitation the rights to | |
| -- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
| -- of the Software, and to permit persons to whom the Software is furnished to do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local printDebug = { | |
| debug = false | |
| } | |
| --- Similar to printfln of C, but uses Lua's print (which usually appends a newline). | |
| function printDebug.printfln(fmt, ...) print(string.format(fmt, ...)) end | |
| --- Create a printfln and debugfln function for a named context. | |
| --- printfln message prefix: "[<ctx>] " | |
| --- debugfln message prefix: "[<ctx>-debug] " |
NewerOlder