function angle array:insert(Index, Value:angle) { return This:insertAngle(Index, Value) }
#ifdef array:insertAttachment(number, attachment)
function attachment array:insert(Index, Value:attachment) { return This:insertAttachment(Index, Value) }
#endif
function bone array:insert(Index, Value:bone) { return This:insertBone(Index, Value) }
#ifdef array:insertCollision(number, collision)
function collision array:insert(Index, Value:collision) { return This:insertCollision(Index, Value) }
#endif
function complex array:insert(Index, Value:complex) { return This:insertComplex(Index, Value) }
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
-- assuming Lua environment argument/local limit is 200 | |
local manual_select_impl = { | |
[0] = function() end; | |
--[1] = function(a1) return a1 end; | |
--[2] = function(_,a2) return a2 end; | |
--[3] = function(_,_,a3) return a3 end; | |
--[4] = function(_,_,_,a4) return a4 end; | |
--[5] = function(_,_,_,_,a5) return a5 end; | |
--[6] = function(_,_,_,_,_,a6) return a6 end; | |
--[7] = function(_,_,_,_,_,_,a7) return a7 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 manual_unpack_impl = { | |
-- return limit is variadic depending on Lua environment/version (usually 250 or 255) | |
[0] = function() end; -- no value | |
[1] = function(t) return t[1] end; | |
[2] = function(t) return t[1], t[2] end; | |
[3] = function(t) return t[1], t[2], t[3] end; | |
[4] = function(t) return t[1], t[2], t[3], t[4] end; | |
[5] = function(t) return t[1], t[2], t[3], t[4], t[5] end; | |
[6] = function(t) return t[1], t[2], t[3], t[4], t[5], t[6] end; | |
[7] = function(t) return t[1], t[2], t[3], t[4], t[5], t[6], t[7] 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
/** | |
* Emits a Lua continue statement. | |
* @internal | |
* @emits `continue` | |
*/ | |
declare function __continue(this: void): void; | |
/** | |
* Emits a Lua goto statement (requires Lua 5.2+ or JIT). | |
* @param label - The label name to jump to. |
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
-- Simple DFPWM player for CC:T | |
-- https://gist.github.com/Cheatoid/e798988c54b411e9d1b64e7aa7057d91 | |
local dfpwm = require("cc.audio.dfpwm") | |
local CHUNK_SIZE = 16 * 1024 | |
local unpack = unpack or table.unpack | |
--- Play DFPWM audio from a file or URL | |
---@param path string Path (or direct URL) of the file to play | |
---@param speakers? table (Optional) List of speaker peripherals to play audio to | |
local function play_dfpwm(path, speakers) | |
assert(type(path) == "string", "bad argument #1 (string expected, got " .. type(path) .. ")") |
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
-- Note: do use local(ization) for better performance when JIT is off | |
local pairs, ipairs, next, rawset, rawget, bit_bxor = pairs, ipairs, next, rawset, rawget, bit32 and bit32.bxor or bit.bxor | |
local Xor0 = function(t, k) | |
-- assume `t` and `k` are (non empty) byte arrays (sequential & numeric indexed Lua tables) | |
local x = {} | |
for i = 1, #t do | |
x[i] = bit_bxor(t[i], k[((i - 1) % #k) + 1]) | |
end | |
return x | |
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
-- Courtesy of /gh/Cheatoid | |
-- Updates: https://gist.github.com/d29fc5dd6ea9819295d2c87098b7bfb6 | |
-- Totally untested. But, it is supposed to let you hide players from SUI scoreboard (and cloak them) based on clientside actions. | |
-- Needless shall I have to tell you again, this *will* be abused by haxxors/skids... But, you will just need to live with that I guess. | |
-- Whenever you want to toggle the state, simply call the hax_ToggleCloak() function on clientside. | |
local PLAYER = FindMetaTable'Player' | |
AccessorFunc(PLAYER, 'm_bHideOnScoreboard', 'HideOnScoreboard', FORCE_BOOL) | |
local msgID = 'hax_togglecloak' |
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
--[[ | |
0. Assuming you can run clientside Lua (sv_allowcslua 1). | |
1. Spawn this code as a Starfall chip. | |
2. Aim on the Starfall chip! | |
3. Open ingame developer console (by default, press tilde key) and submit the following: | |
lua_run_cl LocalPlayer():GetEyeTrace().Entity.instance.env.vgui = _G.vgui | |
4. The above command will give unrestricted access to vgui library to the Starfall chip. | |
5. Be sure you trust chip's owner *before* using the above hack command on other player's SF chip!! | |
]] |
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
1st line | |
2nd line | |
3rd line |
# I needed an E2 function to...
# Reverse a sequential array-part of the given E2 table (using by-reference semantics, hence not returning a new table),
# but since there is no such builtin/official E2 function, I had to "invent" my own... Thanks to Wire for being lazy :D
# This is one of the most cancerous E2 functions ever. The reversing algorithm itself is pretty fast: O(n/2)
# The reason this code is soo big is basically because of how E2 tables work.
# We have to know the type of both values while performing a swap operation...
# (P.S. The code was fully auto-generated by my own tool.)
# (P.P.S. A sample test code can be found on the very bottom.)
# https://gist.github.com/b941df6ed2276fbeee17098c77410fee
NewerOlder