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
#define NULL ((void*) 0) | |
__declspec(dllexport) int hydra5_client_connect_developer(void* _1, void* _2) { | |
return 1; | |
} | |
__declspec(dllexport) int hydra5_client_connect_steam(void* _1, void* _2) { | |
return 1; | |
} | |
__declspec(dllexport) void* hydra5_client_create(void* _1) { | |
return NULL; | |
} |
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
#pragma endian little | |
#include <std/io.pat> | |
#include <std/sys.pat> | |
struct vec_t { | |
float x; | |
float y; | |
float z; | |
} [[static, format("vec_str")]]; | |
fn vec_str(vec_t vec) { | |
return std::format("Vec({:.3g}, {:.3g}, {:.3g})", vec.x, vec.y, vec.z); |
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
--@client | |
local osk | |
do | |
osk = {} | |
local function enum(t_in) | |
local n = #t_in | |
local bits = 0 | |
repeat | |
bits = bits+1 |
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
--@name FTQ | |
local using = {} | |
if SERVER then | |
net.receive('usage', function(len, player) | |
net.start('usage') | |
net.writeEntity(player) | |
net.writeBool(net.readBool()) | |
net.send() | |
end) | |
return |
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
if CLIENT and player() ~= owner() then | |
return | |
end | |
local function test(desc, cond, err) | |
print((cond and "pass" or "FAIL")..(desc and ": "..desc or "")) | |
if not cond and err then print(err) end | |
end | |
local function test_eq(desc, a, b) | |
if a == b then | |
print("pass: "..desc) |
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
// Logic gate implementation in Source | |
// Usage: | |
// 1. Preprocess this file with cfgpp.lua (or use the preprocessed file below this one) and put it in your game's 'cfg' folder (which will be inside a folder with the name of the game, e.g. 'cstrike' for CS:S, or 'tf' for TF2) | |
// 2. Run the file by putting this in the developer console: 'exec circuit2' (replace "circuit2" with whatever name you gave the processed file) | |
// initialization (floating pins will break things) | |
alias 0 | |
alias 1 | |
alias a 0 | |
alias b 0 |
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
-- baseclass macro | |
baseclass = {} | |
function baseclass.Get(str) | |
return str | |
end | |
DEFINE_BASECLASS('DUMMY') | |
assert(BaseClass == 'DUMMY', "baseclass failed") | |
-- comparison operators | |
local a, b, c = 1, 2, false | |
if not ( a && b ) then error("and failed") 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
#!/usr/bin/env luajit | |
--jit.off() | |
local function host_hook(event, line) | |
print(string.format("host_hook: line no. %d", line or -1)) | |
end | |
local function guest_hook(event, line) | |
print(string.format("guest_hook: line no. %d", line or -1)) | |
end | |
local mask, count = 'l', 4 | |
local function test(realm, test_no) |
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
#!/usr/bin/env luajit | |
local argparse = require('argparse') | |
local parser = argparse("tdedecrypt", "Decrypt encrypted Teardown files") | |
parser:argument("input", "Input file(s)"):args("*") | |
parser:option("-o --output", "Output file") | |
local args = parser:parse() | |
if args.input[2] and args.output then | |
parser:error("cannot use output option with multiple input files") | |
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
--@name Crowbars! | |
--@client | |
setupPermissionRequest({'console.command'}, "Crowbars!", true) | |
local i, j = 0, 50 -- set j to how many times you want to do it | |
hook.add('tick', '', function() | |
if not hasPermission('console.command') then | |
return | |
end | |
for i=1, 2 do -- more than twice doesn't work right | |
concmd('gm_giveswep weapon_crowbar') |