repo
stringclasses
341 values
file_path
stringlengths
29
173
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.66M
tokens
int64
2
598k
bohraz/Arch
bohraz-Arch-bdfc450/Packages/_Index/roblox_testez@0.4.1/testez/testez-cli/src/test-runner.lua
luau
.lua
--[[ This test runner is invoked in all the environments that we want to test our project in. TestEZ's CLI targets Lemur, Roblox Studio, and Roblox-CLI. Assumes TestEZ is put into ReplicatedStorage and that test roots have a "TestEZTestRoot" CollectionService tag attached to them. ]] -- luacheck: globals game s...
443
bohraz/Arch
bohraz-Arch-bdfc450/Packages/_Index/roblox_testez@0.4.1/testez/tests/e2e/init.lua
luau
.lua
local TestEZ = require(script.Parent.Parent.TestEZ) local noOptReporter = { report = function() end, } return { ["run expect-extend e2e"] = function() TestEZ.run(script:FindFirstChild("expect-extend"), function(results) assert(#results.errors == 0, "Expected no errors, got " .. tostring(results.errors[1])...
725
bohraz/Arch
bohraz-Arch-bdfc450/Packages/_Index/roblox_testez@0.4.1/testez/tests/e2e/lifecycle/completeLifecycleOrderTests.lua
luau
.lua
-- Shared test cases asserting lifecycle hooks are firing in the correct order return function() describe("full example", function() beforeAll(function(context) context.globalState = {} table.insert(context.globalState, "beforeAll") expect(table.find(context.globalState, "beforeAll")).to.equal(1) end) ...
353
bohraz/Arch
bohraz-Arch-bdfc450/Packages/janitor.lua
luau
.lua
return require(script.Parent._Index["howmanysmall_janitor@1.15.6"]["janitor"])
24
bohraz/Arch
bohraz-Arch-bdfc450/Packages/sift.lua
luau
.lua
return require(script.Parent._Index["csqrl_sift@0.0.8"]["sift"])
22
bohraz/Arch
bohraz-Arch-bdfc450/Packages/signal.lua
luau
.lua
return require(script.Parent._Index["sleitnick_signal@2.0.1"]["signal"])
21
bohraz/Arch
bohraz-Arch-bdfc450/Packages/testez.lua
luau
.lua
return require(script.Parent._Index["roblox_testez@0.4.1"]["testez"])
21
bohraz/Arch
bohraz-Arch-bdfc450/src/Check.luau
luau
.luau
local check = {} function check.isDescendant(state1, state2) if not state2 then return function(item, index) return check.isDescendant(item, state1) end end local parent = state1.parent while parent do if parent == state2 then return true end parent = parent.parent end return false end functi...
146
bohraz/Arch
bohraz-Arch-bdfc450/src/Transition.luau
luau
.luau
local Sift = require(script.Parent.Parent.sift) local Check = require(script.Parent.Check) local function getProperAncestors(state1, state2) local orderedAncestors = {} local parent = state1.parent while parent do table.insert(orderedAncestors, parent) parent = parent.parent end return orderedAncestors end ...
2,170
bohraz/Arch
bohraz-Arch-bdfc450/src/Types.luau
luau
.luau
--[=[ @class Arch This is the Arch class ]=] --[=[ @type Context { janitor: any, event: string, Send: (string, any) -> (), target: string?, any: any, } @within Arch ]=] --[=[ @type Options { id: string, context: { any }?, actions: { string: (Context, any) -> () }?, guards: { string: (Context, any) -> boolean }?, maxL...
949
bohraz/Arch
bohraz-Arch-bdfc450/src/directTranslation.luau
luau
.luau
local function exitInterpreter() end local function microstep(enabledTransitions) end local function executeTransitionContent(enabledTransitions) end local function isInFinalState(s) end local function getProperAncestors(state1, state2) local orderedAncestors = {} local parent = state1.parent repeat table.ins...
2,448
bohraz/Arch
bohraz-Arch-bdfc450/src/init.luau
luau
.luau
local Sift = require(script.Parent.sift) local Signal = require(script.Parent.signal) local Janitor = require(script.Parent.janitor) local Transition = require(script.Transition) local Check = require(script.Check) local function createContext(machine, context) context.Sift = Sift function context.Send(eventName, ....
2,862
bohraz/Arch
bohraz-Arch-bdfc450/tests/server.server.luau
luau
.luau
local TestEZ = require(script.Parent.Packages.testez) local Arch = require(script.Parent.Packages.Arch) TestEZ.TestBootstrap:run({ script.Parent["Arch.spec"] })
37
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/AutoComplete@1.13.3.luau
luau
.luau
--!strict local RunService = game:GetService("RunService") local ServerStorage = game:GetService("ServerStorage") local CollectionService = game:GetService("CollectionService") local ServerScriptService = game:GetService("ServerScriptService") local ScriptEditorService = game:GetService("ScriptEditorService") if not ...
5,939
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/Components/Dropper.luau
luau
.luau
--!strict local Types = require(script.Parent.Parent.Parent.Types) local pluginGlobalIndex: Types.pluginGlobalIndex = _G["AutoComplete+"] local module = {} function module.setupDropper(DropperButton: TextButton, DropperOptionTemplate: TextButton, SettingName: string): () local DropperOptions: { TextButton } = {} ...
343
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/Transformers.luau
luau
.luau
--!strict local Types = require(script.Parent.Types) local pluginGlobalIndex: Types.pluginGlobalIndex = _G["AutoComplete+"] local module = {} local blacklistedCharacters: { [string]: true } = {} for _, character in { " ", "-", "+", ",", ".", "/", "%", "$", "£", "&", "*", "(", ")", "'", "[", "]", "{", "}", "#", "?",...
1,324
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/Types.luau
luau
.luau
--!strict local module = {} export type ImportStyle = "PascalCase" | "camelCase" | "snake_case" export type pluginGlobalIndex = { ["ServiceImportStyle"]: ImportStyle, ["ModuleImportStyle"]: ImportStyle, ["InstanceImportStyle"]: ImportStyle, ["SuggestionCharacter"]: string?, ["SnippetCharacter"]: string?, ["Co...
307
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/UI.luau
luau
.luau
--!strict local Types = require(script.Parent.Types) local Dropper = require(script.Components.Dropper) local DropperOptionTemplate = script.Templates.DropperOptionTemplate local pluginGlobalIndex: Types.pluginGlobalIndex = _G["AutoComplete+"] local module = {} function module.Setup(): () local DockWidgetPluginGu...
534
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Badges/init.luau
luau
.luau
--[=[ Utilities for checking and awarding Roblox badges with save-table support. @class Badges ]=] local Badges = {} -- Constants local SERIALS_DATASTORE_NAME = "Praxis.Badges.Serials" local SERIALS_KEY_PREFIX = "Badge_" -- Services local BadgeService = game:GetService("BadgeService") local RunService = gam...
1,194
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Bezier/init.luau
luau
.luau
--[=[ @class Bezier A utility module for working with Bezier curves. ]=] local Bezier = {} -- Imports local Packages = script:FindFirstChild("roblox_packages") or script:FindFirstChild("Packages") or script.Parent local ValuePacker = require(Packages.ValuePacker) local function LerpComponentValues(StartCompone...
2,719
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Binder/init.luau
luau
.luau
--[=[ Binds OOP classes to Roblox instances through CollectionService tags. @class Binder ]=] local Binder = {} Binder.__index = Binder -- Services local CollectionService = game:GetService("CollectionService") -- Imports local Packages = script:FindFirstChild("roblox_packages") or script:FindFirstChild("P...
1,174
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Bucket/init.luau
luau
.luau
--[=[ Used for cleanup of various data types and instances. @class Bucket ]=] local Bucket = {} Bucket.__index = Bucket -- Types export type Bucket = typeof(setmetatable({}, Bucket)) & { CleanupQueue: {[any]: (any) -> nil}, IsCleaning: boolean, } -- Constants local TABLE_CLEANUP_METHODS = { "Destroy", "Discon...
1,437
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Child/init.luau
luau
.luau
--[=[ @class Child Finds children of an instance by path. This is useful for finding deeply nested children without having to write a long chain of `:FindFirstChild()` or `:WaitForChild()` calls. ]=] local Child = {} --[=[ @param root Instance -- The root instance to start searching from. @param path...
425
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/DataStore/init.luau
luau
.luau
--[=[ DataStore wrapper with serialized table saves and reconciliation support. @class DataStore ]=] local DataStore = {} -- Constants local DEFAULT_MAX_RETRIES = 5 local DEFAULT_RETRY_DELAY_SECONDS = 1 -- Services local RunService = game:GetService("RunService") local DataStoreService = game:GetService("Da...
1,625
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/EffectPlayer/init.luau
luau
.luau
--[=[ @class EffectPlayer Allows you to play visual effects created by standard visual effect plugins. This supports playing: * ParticleEmitters * Sounds * Tween and bezier animations * ModuleScripts * Beams * Trails ]=] local EffectPlayer = {} -- Services local RunService = game:GetS...
2,473
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Initializer/init.luau
luau
.luau
--[=[ Safely initializes modules, either ordered or unordered. @class Initializer ]=] local Initializer = {} -- Constants local INITIALIZED_TAG_INDEX = "__HAS_INITIALIZED" Initializer.Config = { InitializeFunctionName = "Init", ShowLoadDebug = true, ThrownWarnings = { NoInitFunction = t...
979
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Input/Gamepad.luau
luau
.luau
--[=[ Gamepad input capturer. @class Gamepad ]=] local Gamepad = {} Gamepad.__index = Gamepad -- Services local GuiService = game:GetService("GuiService") local HapticService = game:GetService("HapticService") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInpu...
2,320
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Input/Keyboard.luau
luau
.luau
--[=[ Keyboard input capturer. @class Keyboard ]=] local Keyboard = {} Keyboard.__index = Keyboard -- Services local UserInputService = game:GetService("UserInputService") -- Imports local Packages = script.Parent:FindFirstChild("roblox_packages") or script.Parent:FindFirstChild("Packages") or script.Pare...
449
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Input/Mouse.luau
luau
.luau
--[=[ Mouse input capturer. @class Mouse ]=] local Mouse = {} Mouse.__index = Mouse -- Constants local RAY_DISTANCE = 1000 -- Services local UserInputService = game:GetService("UserInputService") -- Imports local Packages = script.Parent:FindFirstChild("roblox_packages") or script.Parent:FindFirstChild("P...
1,250
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Input/PreferredInput.luau
luau
.luau
--[=[ A helper library for observing the preferred user input of the player. @class PreferredInput ]=] local PreferredInput = {} -- Services local UserInputService = game:GetService("UserInputService") function PreferredInput.observe(Callback : (Preferred : Enum.PreferredInput) -> (() -> ())?) local Cle...
284
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Input/Touch.luau
luau
.luau
--[=[ Touch input capturer. @class Touch ]=] local Touch = {} Touch.__index = Touch -- Services local UserInputService = game:GetService("UserInputService") -- Imports local Packages = script.Parent:FindFirstChild("roblox_packages") or script.Parent:FindFirstChild("Packages") or script.Parent.Parent loca...
588
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Input/init.luau
luau
.luau
--[=[ The Input package provides access to various user input classes. Based on the Input library from sleitnick. @class Input ]=] local Input = { PreferredInput = require(script.PreferredInput), Mouse = require(script.Mouse), Keyboard = require(script.Keyboard), Touch = require(script.Touch),...
79
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Optional/init.luau
luau
.luau
--[=[ @class Optional Calls `require` on object or path, returning nil if it does not exist. ]=] local Optional = {} --[=[ @param object Instance | string -- The object or path to require. @return any? -- The module if it exists, or nil if it does not. ```lua local Module = Optional.Get("Mod...
134
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/ProgressionUtils/Boosters.luau
luau
.luau
local Boosters = {} -- Types type BoosterDataCore = { ScoreId : string, BoostMultiplier : number, StackMethod : "AddTime" | "Separate", TotalTime : number, } type BoosterDataInput = BoosterDataCore & { BoosterId : string, } export type BoosterData = BoosterDataInput & { StartingTime : number,...
919
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/ProgressionUtils/Inventory.luau
luau
.luau
local Inventory = {} -- Types type ItemDataInput = { ItemId : string, [string] : any, } export type ItemData = ItemDataInput & { Quantity : number, } export type InventoryData = { Items : {ItemData} } -- Services local HttpService = game:GetService("HttpService") -- Imports local Packages = script....
592
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/ProgressionUtils/Quests.luau
luau
.luau
local Quests = {} -- Services local HttpService = game:GetService("HttpService") -- Imports local Packages = script.Parent:FindFirstChild("roblox_packages") or script.Parent:FindFirstChild("Packages") or script.Parent.Parent local Signal = require(Packages.Signal) local Types = require(script.Parent.Types) -- Type...
1,380
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/ProgressionUtils/Scores.luau
luau
.luau
local Scores = {} -- Imports local Packages = script.Parent:FindFirstChild("roblox_packages") or script.Parent:FindFirstChild("Packages") or script.Parent.Parent local Signal = require(Packages.Signal) local Typer = require(Packages.Typer) local Boosters = require(script.Parent.Boosters) Scores.OnScoreAdded = Signa...
696
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/ProgressionUtils/init.luau
luau
.luau
--[=[ A collection of utilities for progression-related development. @class ProgressionUtils ]=] local ProgressionUtils = {} -- Imports local Quests = require(script.Quests) local Scores = require(script.Scores) local Boosters = require(script.Boosters) local Inventory = require(script.Inventory) --[=[ ...
2,376
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/RateLimiter/init.luau
luau
.luau
--[=[ @class RateLimiter A simple OOP class for rate limiting. ]=] local RateLimiter = {} RateLimiter.__index = RateLimiter -- Types type RateLimiter = typeof(setmetatable({}, RateLimiter)) & { LastTrigger : number, Cooldown : number, } --[=[ @param cooldown number -- The cooldown time in second...
371
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/SeamStoryUtils/init.luau
luau
.luau
--[=[ Utilities for hooking up Seam to UI Labs for UI stories. @class SeamStoryUtils ]=] local SeamStoryUtils = {} --Types type BaseState<T> = { Value : T, } type ValueInstance<T> = { Changed : RBXScriptSignal, } & BaseState<T> type SpringInstance<T> = { Velocity : T, Target : T } & BaseSta...
868
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Select/init.luau
luau
.luau
--[=[ @class Select Used to select singular values from a list of arguments. ]=] local Select = {} --[=[ @param index number -- The index of the value to select @param ... any -- The values to select from @return any? -- The selected value Selects the value at the given index. ```lua ...
418
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/SerDes/init.luau
luau
.luau
--[=[ Serialization and deserialization utilities using ValuePacker with buffer support. @class SerDes ]=] local SerDes = {} -- Services local HttpService = game:GetService("HttpService") -- Imports local Packages = script:FindFirstChild("roblox_packages") or script:FindFirstChild("Packages") or script.Pa...
1,168
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Symbol/init.luau
luau
.luau
-- Author: iGottic --[=[ @class Symbol Blank userdata that can be converted into a string. ]=] local Symbol = {} -- Types export type Symbol = typeof(newproxy(true)) --[=[ Creates a blank userdata that can be converted into a string. @param Name string -- The string representing the symbol @return Symbol ]=]...
197
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/TagUtils/init.luau
luau
.luau
--[=[ @class TagUtils Wrapper for collection service to make it easier to work with tags. ]=] local TagUtils = {} -- Services local CollectionService = game:GetService("CollectionService") --[=[ @param tag string -- The tag to listen for. @param callback (instance: Instance) -> () -- The callback to...
252
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Time/init.luau
luau
.luau
--[=[ Utilities related to time, including for daily rewards. @class Time ]=] local Time = {} -- Constants local SECONDS_PER_DAY = 24 * 60 * 60 local function GetDateTimeUTC(unixTimestamp : number?) : DateTime if unixTimestamp == nil then return DateTime.now():ToUniversalTime() end retu...
1,033
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/TracebackUtils/init.luau
luau
.luau
--[=[ A collection of utilities related to debug library on Roblox. @class TracebackUtils ]=] local TracebackUtils = {} --[=[ Returns the memory id of the function a level above. ```lua local function TestFunction() print(TracebackUtils.GetCallingFunctionId()) -- Prints the memory ID of Init() end local f...
315
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/Typer/init.luau
luau
.luau
--[=[ @class Typer Strict typechecking in runtime implementation for Roblox. ]=] local Typer = {} --[=[ Wraps a function so that all parameters and return values are matched to the correct types. ```lua local ExampleStaticFunction = Typer.Static(function(Foo : number, Bar : string) return `{Foo} and {Bar}`, ...
1,688
MiaGobble/Praxis
MiaGobble-Praxis-d7d0499/src/Packages/ValuePacker/init.luau
luau
.luau
-- Author: iGottic -- Based on UnpackType and PackType from Elttob --[=[ @class ValuePacker Unpacks and packs values of various types into a table of numbers. This is useful for storing values in a format that can be easily serialized or transmitted. ]=] local ValuePacker = {} -- Types type UnpackedValue = ...
1,916
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/bench/bench.luau
luau
.luau
--!native --!optimize 2 local aptint = require(game.ReplicatedStorage.AptInt) type AptInt = aptint.AptInt local clock: () -> number = os.clock local random: (number?, number?) -> number = math.random local insert = table.insert local MAX: number = 2^24-1 local LOG2_10: number = 3.32192809489 local digits: {number}...
612
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/bench/thresholds.luau
luau
.luau
--!native --!strict --!optimize 2 --> THIS IS VERY UGLY CODE!!! I ONLY USE THIS FOR WHEN BENCHMARKING ALGORITHM THRESHOLDS local aptint = require(game.ReplicatedStorage.AptInt.AptInt) type AptInt = aptint.AptInt local clock: () -> number = os.clock local random: (number?, number?) -> number = math.random local inse...
425
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Constants.luau
luau
.luau
const constants = { BASE = 2^24, BASE_MASK = 16777215, -- BASE - 1 (=0xffffff) RADIX_LEN_CONST = 7.224719895935548, -- log10(BASE) RADIX_CHUNK_SIZE = 10^8, RADIX_CHUNK_POW = 8, MAX_TONUMBER_LEN = 43, -- min{k | BASE^k > 2^1024-1} ALLOC_MIN_SIZE = 17, ALLOC_POOL_SIZE = 32, --> algorithm thresholds (size in...
207
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Add.luau
luau
.luau
--!native --!strict --!optimize 2 local Add = {} local Constants = require("../Constants") local Utils = require("./Utils") const abs: (number) -> number = math.abs const tclone: ({number}) -> {number} = table.clone const tinsert: ({number}, number) -> () = table.insert const tmove: ({number}, number, number, numbe...
595
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Cmp.luau
luau
.luau
--!native --!strict --!optimize 2 local Cmp = {} local Utils = require("./Utils") local Constants = require("../Constants") function Cmp.LowerThan(x: {number}, y: {number}): boolean local xLen: number, yLen: number = #x, #y if xLen < yLen then return true elseif xLen > yLen then return false end for i: ...
490
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Mul.luau
luau
.luau
--!native --!strict --!optimize 2 local Mul = {} local Utils = require("./Utils") local Constants = require("../Constants") local Add = require("./Add") local Sub = require("./Sub") local Cmp = require("./Cmp") -- ================================ --> OPTIMIAZTION FUNCTION CONSTANTS -- ===============================...
2,171
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Pow.luau
luau
.luau
--!native --!strict --!optimize 2 local Pow = {} local Utils = require("./Utils") local Constants = require("../Constants") local Mul = require("./Mul") local Div = require("./Div") function Pow.PowByInt(limbs: {number}, exp: number): {number} local result: {number} = {1} while exp > 0 do if exp % 2 == 1 then ...
256
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Radix.luau
luau
.luau
--!native --!strict --!optimize 2 local Radix = {} local Constants = require("../Constants") local Utils = require("./Utils") local Add = require("./Add") local Mul = require("./Mul") local Div = require("./Div") local Pow = require("./Pow") --> FUNCTION CONSTANTS const tcreate: <V>(number, V?) -> {V} = table.create...
1,406
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Sqrt.luau
luau
.luau
--!native --!strict --!optimize 2 local Sqrt = {} local Utils = require("./Utils") local Constants = require("../Constants") local Add = require("./Add") local Sub = require("./Sub") local Mul = require("./Mul") local Div = require("./Div") local Cmp = require("./Cmp") -- ================================ --> OPTIMIA...
1,512
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Sub.luau
luau
.luau
--!native --!strict --!optimize 2 local Sub = {} local Utils = require("./Utils") local Constants = require("../Constants") const tclone: ({number}) -> {number} = table.clone const BASE: number = Constants.BASE function Sub.SubByInt(self: {number}, num: number, inPlace: boolean?): {number} local result: {number} ...
375
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Modules/Utils.luau
luau
.luau
--!native --!strict --!optimize 2 local Utils = {} local Constants = require("../Constants") const ceil: (number) -> number = math.ceil const max: (number, number) -> number = math.max const abs: (number) -> number = math.abs const tinsert: ({{number}}, {number}) -> () = table.insert const tcreate: (number, number...
1,169
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/src/Type.luau
luau
.luau
export type AptIntMetatable = { read __index: AptInt, read __unm: (num: AptInt) -> AptInt, read __add: (a: ValidMetamethodArgument, b: ValidMetamethodArgument) -> AptInt, read __sub: (a: ValidMetamethodArgument, b: ValidMetamethodArgument) -> AptInt, read __mul: (a: ValidMetamethodArgument, b: ValidMetamethodArgum...
734
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/tests/add.luau
luau
.luau
--!native --!optimize 2 local bigint= require(game.ReplicatedStorage.BigInteger) local random = math.random local function testRandomAddition() --> init vars local int1: string = math.random(1, 2) == 1 and "-" or "" local int2: string = math.random(1, 2) == 1 and "-" or "" for i = 1, 6 do int1 ..= tostring(r...
792
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/tests/mod.luau
luau
.luau
--!native --!optimize 2 local aptint = require(game.ReplicatedStorage.AptInt) local random = math.random local function testRandomModulo() --> init vars local int1: string = random(1, 2) == 1 and "-" or "" local int2: string = random(1, 2) == 1 and "-" or "" for i = 1, math.random(1, 7) do int1 ..= random(1, ...
276
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/tests/mul.luau
luau
.luau
--!native --!optimize 2 local bigint = require(game.ReplicatedStorage.BigInteger) local random = math.random local function testRandomMultiplication() --> init vars local int1: string = math.random(1, 2) == 1 and "-" or "" local int2: string = math.random(1, 2) == 1 and "-" or "" for i = 1, 6 do int1 ..= tos...
247
fosterchild1/AptInt
fosterchild1-AptInt-70d973c/tests/sub.luau
luau
.luau
--!native --!optimize 2 local bigint = require(game.ReplicatedStorage.BigInteger) local random = math.random local function testRandomSubtraction() --> init vars local int1: string = math.random(1, 2) == 1 and "-" or "" local int2: string = math.random(1, 2) == 1 and "-" or "" for i = 1, math.random(1, 12) do ...
255
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/Simulation.server.luau
luau
.luau
--!native -- really basic simulation logic -- for the humanoid and world -- but, i advise you to make your own!! assert(not workspace.StreamingEnabled, "this simulation script assumes StreamingEnabled = false") local Pausing = false local HZ = 60 local ContextActionService = game:GetService("ContextActionService") ...
984
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-humanoid/Humanoid.luau
luau
.luau
--!strict -- Modern humanoid physics reimplementation -- in lua local LuauPhysics = require("../luau-physics") local World = LuauPhysics.World export type RaycastResult = LuauPhysics.RaycastResult local UPDATE_HZ = 480 local VEC_Y_FLIP = Vector3.new(1, -1, 1) local VEC_XZ = Vector3.new(1, 0, 1) local CAST_POINTS ...
3,632
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-humanoid/init.luau
luau
.luau
-- luau humanoid reaction :3 -- magicoal_nerb local Humanoid = require("@self/Humanoid") export type Humanoid = Humanoid.Humanoid export type State = Humanoid.State return { -- main humanoid Humanoid = require("@self/Humanoid"), -- states Freefall = require("@self/states/Freefall"), Climbing = require("@self/...
117
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-humanoid/states/Climbing.luau
luau
.luau
--!strict local Humanoid = require("../Humanoid") local Climbing = {} :: Humanoid.State function Climbing.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3 -- return the torques so far return self:computeBalanceTorque(dt) end function Climbing.calculateForce(self: Humanoid.Humanoid, dt: number): Vector...
255
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-humanoid/states/Freefall.luau
luau
.luau
--!strict local Humanoid = require("../Humanoid") local Freefall = {} :: Humanoid.State function Freefall.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3 -- return the torques so far return self:computeBalanceTorque(dt) + self:computeOrientTorque(dt) end function Freefall.calculateForce(self: Huma...
277
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-humanoid/states/Jumping.luau
luau
.luau
--!strict local Humanoid = require("../Humanoid") local JUMP_THRESHOLD = 5.0 local VEC_XZ = Vector3.new(1.0, 0.0, 1.0) local Jumping = {} :: Humanoid.State function Jumping.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3 -- return the torques so far return self:computeBalanceTorque(dt) + self:comp...
609
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-humanoid/states/Running.luau
luau
.luau
--!strict local Humanoid = require("../Humanoid") local COYOTE_HEIGHT = 0.05 local COYOTE_TIMER = 0.1 local Running = {} :: Humanoid.State function Running.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3 -- return the torques so far return self:computeBalanceTorque(dt) + self:computeOrientTorque(dt...
402
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/Body.luau
luau
.luau
--!strict local GRAVITY = 196.2 local Hull = require("./narrowphase/Hull") local Mat3 = require("./Mat3") local Body = {} Body.__index = Body export type Hull = Hull.Hull export type Mat3 = Mat3.Mat3 export type Body = { -- body part: BasePart, hull: Hull, -- sleep sleep: number, flags: number, -- querie...
1,590
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/Mat3.luau
luau
.luau
--!strict --!native -- used to do matrix operations local Mat3 = {} Mat3.__index = Mat3 export type Mat3 = typeof(setmetatable({} :: {{ number }}, Mat3)) Mat3.zero = setmetatable({ {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, }, Mat3) Mat3.identity = setmetatable({ {1, 0, 0}, {0, 1, 0}, {0, 0, 1}, }, Mat3) function Mat...
2,281
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/broadphase/Bvh.luau
luau
.luau
--!strict local BvhBonsaiPrune = require("./builders/BvhBonsaiPrune") local BvhBinnedSah = require("./builders/BvhBinnedSah") local Queue = require("./Queue") local VEC_INF = Vector3.one * math.huge local FAT_AABB = Vector3.one -- Truthfully we only care if a node's id -- is solely FLAG_BRANCH, because that is an i...
5,087
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/broadphase/Queue.luau
luau
.luau
--!strict -- Queue.lua -- Handles the queue stuff i guess local Queue = {} Queue.__index = Queue export type Queue<T> = typeof(setmetatable({} :: { left: number, right: number, count: number, mask: number, data: { T }, }, Queue)) function Queue.new<T>(capacityPow: number, initial: T): Queue<T> local mask = b...
331
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/broadphase/builders/BvhBinnedSah.luau
luau
.luau
--!strict -- binned sah builder ejemplo local VEC_INF = Vector3.one * math.huge local BINS = 8 export type Bin = Node & { count: number } export type Node = { center: Vector3, min: Vector3, max: Vector3, } local BvhSahAxes: { Vector3 } = table.freeze({ Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0...
1,008
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/broadphase/builders/BvhBonsaiPrune.luau
luau
.luau
--!strict -- optimization phase during construction -- where we just rotate through the entire tree -- and make pruned mini trees. good for static stuff local Queue = require("../Queue") local FLAG_LEAF = 0x2 export type Box = { flag: number, center: Vector3, min: Vector3, max: Vector3, free: number, left: nu...
625
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/broadphase/builders/BvhSweepSah.luau
luau
.luau
--!strict -- sweep sah has a nlogn penality because of -- sorting the data. however, it minimizes costs the most -- using bonsai prune local VEC_INF = Vector3.one * math.huge export type Node = { center: Vector3, min: Vector3, max: Vector3, } local function sah(delta: Vector3): number -- the main cost function ...
952
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/init.luau
luau
.luau
local World = require("@self/World") export type Support = World.Support export type World = World.World export type Body = World.Body export type Bvh = World.Bvh return { World = require("@self/World"), }
51
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Arbiter.luau
luau
.luau
--!native --!strict local Body = require("../Body") local SupportArbiter = require("./hulls/SupportArbiter") local MeshArbiter = require("./hulls/MeshArbiter") local Arbiter = {} type Body = Body.Body export type Arbiter = { -- abstract base class :3 new: (Body, Body) -> Arbiter?, update: (Arbiter, number) -> A...
175
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Contact.luau
luau
.luau
--!native --!strict local Body = require("../Body") --[[ The high level overview of what I'm doing here is basically making our old state vector[ie. the previous velocities of A and B] no longer violate a constraint. A constraint is satisfied when it is 0, or if it is a conditional constraint, when that condition...
2,618
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Hull.luau
luau
.luau
--!strict local SupportHull = require("./hulls/SupportHull") local MeshHull = require("./hulls/MeshHull") export type Hull = { -- Hull abstract base class :3 new: (...any) -> Hull, update: (Hull, CFrame, Vector3) -> (), raycast: (Hull, Vector3, Vector3) -> (number, Vector3, Vector3), -- fields support: (Vecto...
178
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Mpr.luau
luau
.luau
--!strict --[[ MPR attempts to find a closest shape that collides with a ray. ie, like a GJK which is biased on hitting a ray. In essence, we are raycasting through the minkowski sum of an entire shape, so think of the way Quake derived games do a "box trace," which in reality, is just a raycast through an infla...
1,686
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/areHullsColliding.luau
luau
.luau
--!native --!strict --[[ This uses Casey's GJK shortcut which is optimized for yes/no intersection tests. This gives pretty poor closest point simplexes though. Works on both types of hulls. ]] local MAX_GJK_ITRS = 8 export type Support = (direction: Vector3) -> Vector3 local function tripleProduct( a: Vecto...
870
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/clipHullFaces.luau
luau
.luau
--!native --!strict --[[ Utility to clip faces to generate a proper contact manifold. This is used for the GJK/SAT hybrid, and the main SAT callback. Moreover, this optimizes our clipped verticies to only include 4 points who maximize the area of the contact manifold. This is to improve stability ]] local Hull ...
1,390
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/extractCoordinates.luau
luau
.luau
--!strict --[[ Used to get the world space offsets of feature points in the GJK/EPA subroutines ]] local EPSILON = 1e-3 export type Feature = { pA: Vector3, pB: Vector3, delta: Vector3, } local function saturate(x: number): number -- Helper clamp function return math.clamp(x, 0.0, 1.0) end local function ca...
1,059
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/getContactEpa.luau
luau
.luau
--!strict --[[ The EPA algorithm is an addition to the GJK algorithm where we can extract the minimal translation vector from a terminating GJK simplex. This is possible because(in my case atleast) GJK enclosing a point results in the simplex being a tetrahedron. The job of the EPA algorithm is to keep on sampli...
1,669
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/getContactManifold.luau
luau
.luau
--!native --!strict --[[ Gets a one-shot contact manifold between different shapes by using the separating axis theorem. ]] local Hull = require("../Hull") local clipHullFaces = require("./clipHullFaces") local COLLISION_SLOP = 1e-2 local EPSILON = 1e-3 export type MeshHull = Hull.MeshHull export type Support = ...
2,203
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/getContactPersistent.luau
luau
.luau
--!strict local EPSILON = 1e-3 local GJK_MAX_ITRS = 20 local MARGIN = 0.05 local Hull = require("../Hull") local clipHullFaces = require("./clipHullFaces") --[[ The incremental strategy here is to just keep on holding onto the current normal until we can't clip anymore. From testing, this just straight up yields...
589
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/MeshArbiter.luau
luau
.luau
--!native --!strict local EPSILON = 1e-2 local getContactPersistent = require("../collision/getContactPersistent") local getContactManifold = require("../collision/getContactManifold") local areHullsColliding = require("../collision/areHullsColliding") local MeshHull = require("./MeshHull") local Contact = require("...
1,290
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/MeshHull.luau
luau
.luau
--!native --!strict --[[ Hull based off of a wavefront During collision, this uses the SAT method for stable contact manifolds ]] local EPSILON = 1e-3 local Mat3 = require("../../Mat3") local MeshHull = {} MeshHull.__index = MeshHull type Mat3 = Mat3.Mat3 -- canonical inertia tensor local INERTIA_CANONICAL = M...
3,129
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/SupportArbiter.luau
luau
.luau
--!native --!strict local getContactGjk = require("../collision/getContactGjk") local getContactEpa = require("../collision/getContactEpa") local Contact = require("../Contact") local Body = require("../../Body") export type Contact = Contact.Contact export type Body = Body.Body local SupportArbiter = {} SupportArb...
604
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/SupportHull.luau
luau
.luau
--!native --!strict --[[ Hull that uses support points instead of mesh stuff. Uses EPA/GJK internally. TODO: adapt the inertia tensor and volume calculations algorithms through support points! Could possibly sample the convex hull of the support points, then construct from there. ]] local Mpr = require("../Mpr...
840
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/shapes/CornerWedge.luau
luau
.luau
return [[ v 0.500000 -0.500000 0.500000 v 0.500000 -0.500000 0.500000 v -0.500000 -0.500000 0.500000 v -0.500000 -0.500000 0.500000 v 0.500000 -0.500000 -0.500000 v 0.500000 0.500000 -0.500000 v -0.500000 -0.500000 -0.500000 v -0.500000 -0.500000 -0.500000 vn -0.0000 1.0000 -0.0000 vn -0.0000 -0.0000 -1.0000 ...
418
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/shapes/Cube.luau
luau
.luau
return [[ v 0.500000 0.500000 -0.500000 v 0.500000 -0.500000 -0.500000 v 0.500000 0.500000 0.500000 v 0.500000 -0.500000 0.500000 v -0.500000 0.500000 -0.500000 v -0.500000 -0.500000 -0.500000 v -0.500000 0.500000 0.500000 v -0.500000 -0.500000 0.500000 vn 0.0000 1.0000 0.0000 vn 0.0000 0.0000 1.0000 vn -1.0...
404
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/shapes/Wedge.luau
luau
.luau
return [[ v -0.500000 -0.500000 0.500000 v -0.500000 0.500000 0.500000 v -0.500000 -0.500000 -0.500000 v 0.500000 -0.500000 0.500000 v 0.500000 0.500000 0.500000 v 0.500000 -0.500000 -0.500000 vn -1.0000 -0.0000 -0.0000 vn 1.0000 -0.0000 -0.0000 vn -0.0000 -0.0000 1.0000 vn -0.0000 -1.0000 -0.0000 vn -0.0000...
314
welcomestohell/boba
welcomestohell-boba-878f9ab/.lune/lib/comment-region.luau
luau
.luau
local CommentRegion = {} CommentRegion.__index = CommentRegion export type CommentRegion = typeof(setmetatable({} :: { label: string }, CommentRegion)) function CommentRegion.new(label: string): CommentRegion return setmetatable({ label = label }, CommentRegion) end function CommentRegion.pattern(self: CommentRegio...
152
welcomestohell/boba
welcomestohell-boba-878f9ab/.lune/rbxgen.luau
luau
.luau
local fs = require("@lune/fs") local roblox = require("@lune/roblox") local CommentRegion = require("@lib/comment-region") local PATH = "./packages/boba-roblox/src/init.luau" local REGION_DATA_TYPES = CommentRegion.new("roblox data types codegen") local REGION_INSTANCES = CommentRegion.new("roblox instances typegen")...
594
welcomestohell/boba
welcomestohell-boba-878f9ab/packages/boba/init.luau
luau
.luau
--!strict --!optimize 2 --[[ ▄ █ ▀█▀ █ ▄ Welcome To Hell @ wthrblx.com █▀█ █ █▀█ (c) Team Fireworks 2024-2026. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Pe...
2,960
depthso/Roblox-ImGUI
depthso-Roblox-ImGUI-876b997/ImGui.lua
luau
.lua
--// Written by depso --// MIT License --// Copyright (c) 2024 Depso local ImGui = { Animations = { Buttons = { MouseEnter = { BackgroundTransparency = 0.5, }, MouseLeave = { BackgroundTransparency = 0.7, } }, Tabs = { MouseEnter = { BackgroundTransparency = 0.5, }, MouseLeave ...
11,395