repo
stringclasses
302 values
file_path
stringlengths
18
241
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
76
697k
tokens
int64
10
271k
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/count.luau
luau
.luau
--!strict local Util = require("../Util") --[=[ @function count @within Set @param set { [T]: boolean } -- The set to count. @param predicate? (item: T, set: { [T]: boolean }) -> boolean? -- The predicate to use to count. @return number -- The number of items in the set. Counts the number of items in a s...
248
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/difference.luau
luau
.luau
--!strict local T = require("../Types") --[=[ @function difference @within Set @param set Set<V> -- The set to compare. @param ... ...Set<V> -- The sets to compare against. @return Set<V> -- The difference between the sets. Returns a set of values that are in the first set, but not in the other sets. ...
225
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/differenceSymmetric.luau
luau
.luau
--!strict local T = require("../Types") --[=[ @function differenceSymmetric @within Set @param set Set<V> -- The set to compare. @param ... ...Set<V> -- The sets to compare against. @return Set<V> -- The symmetric difference between the sets. Returns a set of values that are in the first set, but not in ...
283
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/filter.luau
luau
.luau
--!strict local Util = require("../Util") --[=[ @function filter @within Set @param set { [T]: boolean } -- The set to filter. @param predicate? (item: T, set: { [T]: boolean }) -> any -- The function to filter the set with. @return { [T]: boolean } -- The filtered set. Filters a set using a predicate. A...
253
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/fromArray.luau
luau
.luau
--!strict --[=[ @function fromArray @within Set @param array {T} -- The array to convert to a set. @return {[T]: boolean} -- The set. Converts an array to a set, where each item is mapped to true. Duplicate items are discarded. Aliases: `fromList` ```lua local array = { "hello", "world", "hello" }...
172
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/init.luau
luau
.luau
--!strict --[=[ @class Set Sets are a collection of values. They are used to store unique values. They are essentially a dictionary, but each value is stored as a boolean. This means that a value can only be in a set once. ```lua local set = { hello = true } local newSet = Add(set, "world") -- { hello = true,...
255
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Set/isSuperset.luau
luau
.luau
--!strict local isSubset = require("./isSubset") --[=[ @function isSuperset @within Set @param superset { [any]: boolean } -- The superset to check. @param subset { [any]: boolean } -- The subset to check against. @return boolean -- Whether the superset is a superset of the subset. Checks whether a set i...
180
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Types.luau
luau
.luau
--selene: allow(unused_variable) local None = require("./None") --[=[ @type None None @within Sift ]=] export type None = typeof(None) export type Dictionary<K, V> = { [K]: V } export type Array<T> = Dictionary<number, T> export type Set<T> = Dictionary<T, boolean> export type Table = Dictionary<any, any> export ...
97
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Util/equalObjects.luau
luau
.luau
--!strict local _T = require("../Types") --[=[ @function equalObjects @within Sift @param ... ...table -- The tables to compare. @return boolean -- Whether or not the tables are equal. Compares two or more tables to see if they are equal. ```lua local a = { hello = "world" } local b = { hello = "world" } ...
167
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Util/init.luau
luau
.luau
return { equalObjects = require("@self/equalObjects"), func = require("@self/func"), isEmpty = require("@self/isEmpty"), }
31
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/sift/Util/isEmpty.luau
luau
.luau
--!strict local _T = require("../Types") --[=[ @function isEmpty @within Sift @since v0.0.1 @param table table -- The table to check. @return boolean -- Whether or not the table is empty. Checks whether or not a table is empty. ```lua local a = {} local b = { hello = "world" } local value = isE...
136
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/signal.luau
luau
.luau
-- ----------------------------------------------------------------------------- -- Batched Yield-Safe Signal Implementation -- -- This is a Signal class which has effectively identical behavior to a -- -- normal RBXScriptSignal, with the only difference being a couple extra ...
2,865
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/tableUtil.luau
luau
.luau
--!strict -- TableUtil -- Stephen Leitnick -- September 13, 2017 --[=[ @class TableUtil A collection of helpful table utility functions. Many of these functions are carried over from JavaScript or Python that are not present in Lua. Tables that only work specifically with arrays or dictionaries are marked as su...
6,836
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/trove.luau
luau
.luau
--!strict local RunService = game:GetService("RunService") export type Trove = { Extend: (self: Trove) -> Trove, Clone: <T>(self: Trove, instance: T & Instance) -> T, Construct: <T, A...>(self: Trove, class: Constructable<T, A...>, A...) -> T, Connect: (self: Trove, signal: SignalLike | RBXScriptSignal, fn: (...a...
4,033
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/modules/tween.luau
luau
.luau
return require("tween") :: { GetValue: ( self: Tween, alpha: number, easingStyle: Enum.EasingStyle, easingDirection: Enum.EasingDirection ) -> number, }
48
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/ar-create-element.luau
luau
.luau
-- Try and get the ar controller, throw an error if we don't find it using `assert`. local screen = assert(Network:GetPart("ARController"), "no ar controller connected") -- Clear the left over screen elements from the last time GUIs were loaded onto it. -- Note: If you utilise the `Instance.new` API instead, you do no...
616
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/configuring/changed-any-tracked.luau
luau
.luau
local function tabulateConfigurables(object: PilotObject, configuration: { [string]: any }) local changes = {} for _, configurableData in object:GetConfigurables() do local configurableName = configurableData.Name local configurableValue = object[configurableName] if configuration[configurableName] ~= configu...
231
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/configuring/changed-any.luau
luau
.luau
local function tabulateConfigurables(object: PilotObject, configuration: { [string]: any }) local changes = {} for _, configurableData in object:GetConfigurables() do local configurableName = configurableData.Name local configurableValue = object[configurableName] if configuration[configurableName] ~= configu...
200
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/configuring/changed-signal.luau
luau
.luau
local signal = require("signal") local function getInstanceConfigurableChangedSignal(object: PilotObject, configurable: string) local signal = signal.new() local previousConfiguration = object[configurable] object.Configured:Connect(function() local currentConfiguration = object[configurable] if currentConfig...
156
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/configuring/changed.luau
luau
.luau
local TRACKED_CONFIGURABLE = "Seek" local object = Network:GetPart("Gyro") local previousConfiguration = object[TRACKED_CONFIGURABLE] object.Configured:Connect(function() local currentConfiguration = object[TRACKED_CONFIGURABLE] if currentConfiguration == previousConfiguration then return end print( `{object...
106
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/disco-lights.luau
luau
.luau
local sift = require("sift") -- Grab this fancy library for manipulating tables provided by wos. -- Get all of the types of objects with a `:SetColor` method and merge them into one big table. local objects = sift.Array.merge( Network:GetParts("Light"), Network:GetParts("LightTube"), Network:GetParts("SpotLight"), ...
585
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/draggable-frames.luau
luau
.luau
-- Get the touch screen. local screen = assert(Network:GetPart("TouchScreen"), "expected touch screen to be connected") -- Initialise our lists of draggable frames and the currently dragged frames. local frames = {} local dragging = {} -- Create 100 random draggable frames. local canvasSize = screen:GetDimensions() f...
937
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/extractors/extractors-keyboard.luau
luau
.luau
-- define names of people who are allowed. local WHITELIST = { ArvidSilverlock = true, -- could also do `["ArvidSilverlock"] = true,` } local sift = require("sift") -- fancy module provided by wos to modify tables -- try and find the connected keyboard, throw an error if we don't find one local keyboard = assert(Ne...
249
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/extractors/extractors-mountain.luau
luau
.luau
-- Define the list of resources to cycle through local MOUNTAIN_RESOURCES = { "Stone", "Ruby", "Quartz", "Silicon", "Flint", "Sulfur", -- Remove the '--' if you also want to harvest these! -- "Ice", -- "Oil", -- "Helium", } -- how often we want to change what resource is being mined (in seconds) local UPDATE...
433
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/gyro-intersection.luau
luau
.luau
-- Given a list of gyros, you can estimate where they are all pointing. -- You don't have to understand it, you just have to use it! -- https://medium.com/data-science/intersect-multiple-3d-lines-closest-point-93e06b296f15 -- https://math.stackexchange.com/questions/61719 -- https://en.wikipedia.org/wiki/Skew_lines#Mor...
1,025
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/key-pressed.luau
luau
.luau
-- Get all of the necessary parts and throw a useful error if something isn't found. local anchor = assert(Network:GetPart("Anchor"), "no anchor connected") local thrusterSwitch = assert(Network:GetPart("Switch"), "no switch connected") local keyboard = assert(Network:GetPart("Keyboard"), "no keyboard connected") -- D...
364
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/lifesensor-intruder.luau
luau
.luau
-- Get access to the Waste of Space provided 'module' that lets us access player usernames if -- we provide it a `UserId`. local players = require("players") -- Create a whitelist of `UserId`s, it uses a 'dictionary' format, where the keys are the `UserId`s -- and the values are `true` so we can access whether someone...
1,140
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/polysilicon-spam.luau
luau
.luau
local polysilicons = GetParts("Polysilicon") while true do for _, polysilicon in polysilicons do polysilicon.PolysiliconMode = if math.random() < 0.01 then "FlipFlop" elseif math.random() > 0.5 then "Activate" else "Deactivate" polysilicon.Frequency = math.random(1, 10) polysilicon:Trigger() end tas...
111
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/reactor.luau
luau
.luau
local DISPENSE_COOLDOWN = 1 for _, port in Network:GetPorts() do local subnet = Network:GetSubnet(port) local reactor = subnet:GetPart("Reactor") local dispenser = subnet:GetPart("Dispenser") if not reactor or not dispenser then warn("invalid port", reactor, dispenser) continue end local dispenseCooldown =...
190
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/screen-create-element.luau
luau
.luau
-- Try and get the screen part, throw an error if we don't find it using `assert`. local screen = assert(Network:GetPart("Screen"), "no screen connected") -- Clear the left over screen elements from the last time GUIs were loaded onto it. -- Note: If you utilise the `Instance.new` API instead, you do not need to do th...
227
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/screen-size.luau
luau
.luau
-- Try and get the screen part, throw an error if we don't find it using `assert`. local screen = assert(Network:GetPart("Screen"), "no screen connected") -- Store the current screen size. local previousScreenSize = screen:GetDimensions() -- Connect to the `Loop` event of the `Microcontroller` that is running the cod...
225
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/switch-flicker.luau
luau
.luau
local sift = require("sift") -- Grab this fancy library for manipulating tables provided by wos. -- Get all of the types of objects with a `SwitchValue` (save for `TemperatureGate`) configurable -- and merge them into one big table. local objects = sift.Array.merge( Network:GetParts("Switch"), Network:GetParts("Trig...
290
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/teleporter.luau
luau
.luau
local coordinate = require("coordinate") local teleporter = assert(Network:GetPart("Teleporter"), "expected teleporter to be connected") local keyboard = assert(Network:GetPart("Keyboard"), "expected keyboard to be connected") local FALSE_TELEPORTER_COORDINATES = coordinate.new(0, 0, 0, 0, false) keyboard.TextInputt...
111
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/documentation/programs/user-input.luau
luau
.luau
local UPDATES_PER_TICK = 16 -- How many times to rotate per tick, higher is smoother. local ANGLE_INCREMENT = 4 -- Every 1/UPDATES_PER_TICK seconds increment the servo angle by this. local SHIFT_HELD_MULTIPLIER = 0.25 -- When shift is held, multiply the angle increment by this. -- Who can rotate the servos. local WHIT...
1,071
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/modules/Hydrators.luau
luau
.luau
local documentation = require("../modules/PilotDocumentation") local Utility = require("../modules/Utility") local Hydrators = {} function Hydrators.object(className: string, class: any, vanilla: boolean?) local reformattedClass = Utility.deepClone(class) local hydrator = reformattedClass.hydrator reformattedClass...
1,281
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/modules/LuauType.luau
luau
.luau
local luauTypes = {} export type TypeStyle = "type" | "function" | "union" | "intersection" | "class" export type Context = { style: TypeStyle, isMethod: boolean, isNullable: boolean, isString: boolean, isOpenString: boolean, isArray: boolean, isSparseArray: boolean, } export type TypeGroup = { key: { string...
3,881
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/modules/MarkdownSnippet.luau
luau
.luau
local Snippet = require("./Snippet") local MarkdownSnippet = Snippet.new() :: any MarkdownSnippet.__index = MarkdownSnippet MarkdownSnippet.__tostring = Snippet.__tostring function MarkdownSnippet.new(title: string) local self = setmetatable({}, MarkdownSnippet) self.title = title self._lines = {} self._indent = ...
1,068
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/modules/PilotDocumentation.luau
luau
.luau
local fs = require("@lune/fs") local serde = require("@lune/serde") local luauTypes = require("../modules/LuauType") local documentation = serde.decode("yaml", fs.readFile("documentation/documentation.yaml")) :: any documentation.configurations = {} for className, class in documentation.classes do local hydrator =...
222
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Darklua.luau
luau
.luau
local fs = require("@lune/fs") local Utility = require("../modules/Utility") local Darklua = {} function Darklua.save(options, _generatedData) local darkluaConfig = { bundle = { require_mode = { name = "luau", use_luau_configuration = true, }, excludes = {}, }, rules = { "remove_types", ...
158
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Definition.luau
luau
.luau
local fs = require("@lune/fs") local luauTypes = require("../modules/LuauType") local Snippet = require("../modules/Snippet") local hydrators = require("../modules/Hydrators") local documentation = require("../modules/PilotDocumentation") local Definition = {} local function writeTypeGroup(snippet, key: string, val...
534
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Documentation.luau
luau
.luau
local fs = require("@lune/fs") local serde = require("@lune/serde") local luauTypes = require("../modules/LuauType") local hydrators = require("../modules/Hydrators") local documentation = require("../modules/PilotDocumentation") local NO_PARAMETER_RESERVED = "__RESERVE__NO_PARAMETERS___RESERVE_" local NO_PARAMETER_R...
1,028
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Modules.luau
luau
.luau
local fs = require("@lune/fs") local Utility = require("../modules/Utility") local MODULE_SOURCE_DIRECTORY = "./documentation/modules" local Modules = {} function Modules.save(options) local outputDirectory, typesDirectory = options.o, options["types-dir"] local modulesDirectory = `{outputDirectory}/{typesDirecto...
269
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Selene.luau
luau
.luau
local serde = require("@lune/serde") local fs = require("@lune/fs") local documentation = require("../modules/PilotDocumentation") local Utility = require("../modules/Utility") local luauTypes = require("../modules/LuauType") local hydrators = require("../modules/Hydrators") local Snippet = require("../modules/Snippet...
992
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/VSCode.luau
luau
.luau
local Utility = require("../modules/Utility") local EXTENSIONS = { luaulsp = "JohnnyMorganz.luau-lsp", selene = "Kampfkarren.selene-vscode", } -- group 1 is a prefix of characters to apply a case transformation to, you insert a space between group 2 & 3 local SPLIT_PASCAL_REGEX = "(.*?)([a-z]|[0-9](?=[a-z]|[A-Z])|[...
1,088
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/DetermineIndefiniteArticle.luau
luau
.luau
-- Hardcoded indefinite articles for all uses. This is to avoid non-phonetic spellings messing with the articles. local indefiniteArticles = { json = "a", range = "a", network = "a", port = "a", random = "a", callback = "a", event = "an", file = "a", arcursor = "an", blade = "a", boolean = "a", canvas = "a"...
431
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/EscapeMarkdown.luau
luau
.luau
local function escapeMarkdown(text) local markdownCharacters = [[\`*_{}[%]()#+-.!|<>]] return (text:gsub("([" .. markdownCharacters .. "])", "\\%1")) end return escapeMarkdown
47
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/FindPossibleSizes.luau
luau
.luau
local sizes = {} function sizes.formatSize(x, y, z) return (string.format("%.2fx%.2fx%.2f", x, y, z):gsub("%.00", ""):gsub("(%.%d)0*", "%1")) end -- This finds all possible sizes that multiply to the given malleability, -- with each dimension being at most 2048 and an integer. function sizes.findPossibleSizes(mallea...
259
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/LuauTypeStrings.luau
luau
.luau
local luauTypes = require("../../modules/LuauType") local Snippet = require("../../modules/Snippet") local escapeMarkdown = require("./EscapeMarkdown") local LuauTypeStrings = {} function LuauTypeStrings.getType(value) local output = Snippet.new() luauTypes.write(output, value, { isRoot = true, context = "type", d...
156
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/NumberToOrdinalWord.luau
luau
.luau
-- stylua: ignore start local UNITS = { "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth" } local TEENS = { "eleventh", "twelfth", "thirteenth", "fourteenth", "fifteenth", "sixteenth", "seventeenth", "eighteenth", "nineteenth" } local TENS = { "tenth", "twentieth", "thirtieth", "forti...
322
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/SortedIterate.luau
luau
.luau
local function sortedIterate<T>(dictionary: { [string]: T }, deprioritizeDeprecated: boolean?): () -> (string, T) local primary, secondary = {}, {} for key, value in dictionary do if typeof(value) == "table" and deprioritizeDeprecated and value.documentation and value.documentation.deprecated then ...
165
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/UrlEncode.luau
luau
.luau
-- Not actually real URL encoding, but this seems to work for docusaurus links, at least for the limited subset of symbols in the link names. local function urlEncode(url: string) return url:gsub(" ", "%%20") end return urlEncode
55
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/Write/AppendDocumentation.luau
luau
.luau
local fs = require("@lune/fs") local serde = require("@lune/serde") local MarkdownSnippet = require("../../../modules/MarkdownSnippet") local rawPartData = serde.decode("json", fs.readFile("documentation/partdata.json")) :: any local CodeSamples = require("./CodeSamples") local sortedIterate = require("../SortedIter...
1,360
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/Write/CodeSamples.luau
luau
.luau
local fs = require("@lune/fs") local CodeSamples = {} function CodeSamples.addIndividualCodeSample(output, codeSample) if not codeSample then return end output:Push("\n```lua\n") local source = if codeSample:match("^.-%.luau$") then fs.readFile(`documentation/programs/{codeSample}`) else codeSample local...
211
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/Write/Objects.luau
luau
.luau
local fs = require("@lune/fs") local serde = require("@lune/serde") local MarkdownSnippet = require("../../../modules/MarkdownSnippet") local LuauTypeStrings = require("../LuauTypeStrings") local escapeMarkdown = require("../EscapeMarkdown") local determineIndefiniteArticle = require("../DetermineIndefiniteArticle") ...
2,594
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/Write/Parameters.luau
luau
.luau
local luauTypes = require("../../../modules/LuauType") local MarkdownSnippet = require("../../../modules/MarkdownSnippet") local numberToOrdinalWord = require("../NumberToOrdinalWord") local determineIndefiniteArticle = require("../DetermineIndefiniteArticle") local sortedIterate = require("../SortedIterate") local L...
1,199
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/Write/Types.luau
luau
.luau
local luauTypes = require("../../../modules/LuauType") local MarkdownSnippet = require("../../../modules/MarkdownSnippet") local appendDocumentation = require("./AppendDocumentation") local writeParameters = require("./Parameters") local sortedIterate = require("../SortedIterate") local urlEncode = require("../UrlEnco...
2,031
ArvidSilverlock/Pilot.lua-Luau-LSP
ArvidSilverlock-Pilot.lua-Luau-LSP-7d31f35/source/outputs/Wiki/init.luau
luau
.luau
local fs = require("@lune/fs") local MarkdownSnippet = require("./../modules/MarkdownSnippet") local partDocumentation = require("./../modules/PilotDocumentation") local WIKI_DIRECTORY = "./wiki/docs/" local generateTypePage = require("@self/Write/Types") local generateObjectPage = require("@self/Write/Objects") l...
676
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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-b5795fb/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-b5795fb/src/Constants.luau
luau
.luau
return { BASE_POW = 24, BASE = 2^24, BASE_MASK = 16777215, -- BASE - 1 (=0xffffff) RADIX_LEN_CONST = 7.224719895935548, -- BASE_POW * log10(2) RADIX_CHUNK_SIZE = 10^8, RADIX_CHUNK_POW = 8, MAX_TONUMBER_LEN = 43, -- min{k | BASE^k > 2^1024-1} --> algorithm thresholds (size in limbs) MIN_MINADD_OFFSET = 20, ...
194
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/src/Modules/Add.luau
luau
.luau
--!native --!strict --!optimize 2 local Add = {} local Constants = require("../Constants") local abs: (number) -> number = math.abs local tclone: ({number}) -> {number} = table.clone local tinsert: ({number}, number) -> () = table.insert local BASE: number = Constants.BASE local MIN_MINADD_OFFSET: number = Constan...
698
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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: ...
487
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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 -- ===============================...
1,962
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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 ...
252
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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") --> FUNCTION CONSTANTS local tcreate: <V>(number, V) -> {V} = table.create local tclone: ({number}) -> {number} = table.clone local t...
1,225
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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,380
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/src/Modules/Sub.luau
luau
.luau
--!native --!strict --!optimize 2 local Sub = {} local Utils = require("./Utils") local Constants = require("../Constants") local tclone: ({number}) -> {number} = table.clone local BASE: number = Constants.BASE function Sub.SubByInt(self: {number}, num: number, inPlace: boolean?): {number} local result: {number} ...
368
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/src/Modules/Utils.luau
luau
.luau
--!native --!strict --!optimize 2 local Utils = {} local Constants = require("../Constants") local tinsert: ({number}, number) -> () = table.insert local tcreate: (number, number) -> {number} = table.create local tclone: ({number}) -> {number} = table.clone local tmove: ({number}, number, number, number, {number}) -...
499
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/src/Type.luau
luau
.luau
export type AptIntMetatable = { __index: AptInt, __unm: (num: AptInt) -> AptInt, __add: (a: ValidMetamethodArgument, b: ValidMetamethodArgument) -> AptInt, __sub: (a: ValidMetamethodArgument, b: ValidMetamethodArgument) -> AptInt, __mul: (a: ValidMetamethodArgument, b: ValidMetamethodArgument) -> AptInt, __div: (...
686
fosterchild1/AptInt
fosterchild1-AptInt-b5795fb/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-b5795fb/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-b5795fb/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-b5795fb/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
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/APU.luau
luau
.luau
--!native --!nocheck --!optimize 2 local ASSETS = { pulse_12_5 = 'rbxassetid://137987182789405', pulse_25 = 'rbxassetid://108267815293395', pulse_50 = 'rbxassetid://74193770330344', pulse_75 = 'rbxassetid://100273244108902', triangle = 'rbxassetid://135072236414372', noise_mix = 'rbxassetid://137650960613979', }...
15,483
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Base.luau
luau
.luau
--!optimize 2 --!native --!strict export type MapperConfig = { id: number, fourScreen: boolean, initialMirroring: number, prgBanks16: number, chrBanks8: number, prgSize: number, chrSize: number, chrIsRam: boolean, prgRamSize: number, hasBattery: boolean, submapper: number?, prgRam: buffer?, chr: buffer?, ...
260
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Homebrew.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'./Base' type MapperConfig = Base.MapperConfig local atLeastOne = Base.atLeastOne local wrapBank = Base.wrapBank --// MAPPER_030 local function UNROM512(config: MapperConfig) local prg_banks_16k = atLeastOne(config.prgSize // 0x4000) local chr_banks_8k = atLea...
747
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Konami.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'./Base' type MapperConfig = Base.MapperConfig local atLeastOne = Base.atLeastOne local wrapBank = Base.wrapBank local normalizeOffset = Base.normalizeOffset type VrcIrqState = { reloadValue: number, counter: number, prescaler: number, enabled: boolean, ena...
12,102
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Namco.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'./Base' type MapperConfig = Base.MapperConfig local atLeastOne = Base.atLeastOne local normalizeOffset = Base.normalizeOffset local wrapBank = Base.wrapBank local function read_buffer_u8(buf: buffer?, len: number, offset: number): number if buf ~= nil and offs...
7,000
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Nintendo.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'./Base' type MapperConfig = Base.MapperConfig local atLeastOne = Base.atLeastOne local wrapBank = Base.wrapBank local normalizeOffset = Base.normalizeOffset --// MAPPER_000 local function NROM(config: MapperConfig) local prg_banks_16k = atLeastOne(config.prgSi...
25,233
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Sunsoft.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'./Base' type MapperConfig = Base.MapperConfig local atLeastOne = Base.atLeastOne local wrapBank = Base.wrapBank local normalizeOffset = Base.normalizeOffset local function read_buffer_u8(buf: buffer?, len: number, offset: number): number if buf ~= nil and offs...
8,043
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/Unlicensed.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'./Base' type MapperConfig = Base.MapperConfig local atLeastOne = Base.atLeastOne local wrapBank = Base.wrapBank local normalizeOffset = Base.normalizeOffset --// MAPPER_116 local function Huang116(config: MapperConfig) local submapper = config.submapper or 0 ...
9,226
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/Mappers/init.luau
luau
.luau
--!optimize 2 --!native --!strict local Base = require'@self/Base' local Namco = require'@self/Namco' local Konami = require'@self/Konami' local Sunsoft = require'@self/Sunsoft' local Homebrew = require'@self/Homebrew' local Nintendo = require'@self/Nintendo' local Unlicensed = require'@self/Unlicensed' export type M...
611
vantoanvh/LuauNES
vantoanvh-LuauNES-e040170/LuauNES/init.luau
luau
.luau
--!native --!nocheck --!optimize 2 --// Modules local Mappers = require'@self/Mappers' local APU = require'@self/APU' --// Buffers and data local palette_rgba32 = buffer.create(256) local nes_rgba32 = buffer.create(256) local SPRITE_NORMAL_PIXEL = buffer.create(524288) local SPRITE_FLIP_PIXEL = buffer.create(52428...
33,035
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/DefaultData.luau
luau
.luau
return { -- Adds to default data. Examples: -- Points = 25 -- Adds "Points" to data and defaults to 25 -- Adds "Coins" to data and defaults to 0 Coins = 0, -- Example table for default data Inventory = { Pills = {}, -- [itemId] = {itemName = string, quantity = number} Elixirs = {}, -- [itemId] = {itemName...
186
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Client/Cache.luau
luau
.luau
--!strict export type CacheModule = { GetFromValueCache: (key: string) -> any?, SetInValueCache: (key: string, value: any) -> (), GetFromNestedCache: (path: string) -> any?, SetInNestedCache: (path: string, value: any) -> (), ClearAllCaches: () -> (), CleanupCache: () -> (), InvalidateForMutationPath: (path: {a...
927
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Client/Connection.luau
luau
.luau
--!strict export type ConnectionModule = { AddConnection: (connection: any) -> (), ScheduleCleanup: () -> (), } local function CreateConnectionModule(): ConnectionModule local activeConnections: {any} = {} local connectionCleanupScheduled = false local function ScheduleCleanup(): () if connectionCleanupSchedu...
197
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Client/Leaderboard.luau
luau
.luau
--!strict export type LeaderboardInfo = { rank: number?, score: number?, statName: string, } export type LeaderboardEntry = { userId: number, score: number, rank: number, } local Leaderboard = {} local function ToLeaderboardInfo(statName: string, statData: any): LeaderboardInfo? if typeof(statData) ~= "table...
462
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Client/PathCache.luau
luau
.luau
--!strict export type PathCacheModule = { GetPathKeys: (path: string) -> {string}, ClearCache: () -> (), } local function CreatePathCache(maxPathCacheSize: number): PathCacheModule local pathCache: {[string]: {string}} = {} local function GetPathKeys(path: string): {string} local cached = pathCache[path] if ...
274
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Client/Validation.luau
luau
.luau
--!strict local Validation = {} function Validation.ValidateReplica(replica: any?): boolean return replica ~= nil and replica:IsActive() end function Validation.WaitForData( dataReady: () -> boolean, validateReplica: (replica: any?) -> boolean, getReplica: () -> any?, readyEvent: BindableEvent? ): boolean if d...
169
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/Array.luau
luau
.luau
--!strict local Array = {} function Array.AddToArray(replica: any, pathKeys: {string}, item: any): (boolean, string?) local success, result = pcall(replica.TableInsert, replica, pathKeys, item) if not success then return false, result end return success, nil end function Array.RemoveFromArray(replica: any, pa...
206
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/Batch.luau
luau
.luau
--!strict export type BatchOperation = { path: string, value: any, } export type BatchModule = { ScheduleBatchOperation: (player: Player, operation: BatchOperation) -> (), ProcessBatchOperations: (player: Player) -> (), FlushBatch: (player: Player) -> (), ClearPlayerBatch: (player: Player) -> (), } local funct...
1,066
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/DataUtils.luau
luau
.luau
--!strict local DataUtils = {} local INT32_MAX = 2147483647 local INT32_MIN = -2147483648 local DEFAULT_RUNTIME_NON_PERSISTENT_ROOTS = { "session", "_LeaderboardRanks", "_Leaderboards", "_Leaderboard", } function DataUtils.GetAppropriateValueType(value: number): string if value % 1 ~= 0 then return "NumberVal...
1,763
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/DataWipe.luau
luau
.luau
--!strict local Players = game:GetService("Players") local DataUtils = require(script.Parent.DataUtils) local DataWipe = {} function DataWipe.WipePlayerData( player: Player, config: any, getProfile: (player: Player) -> any?, getReplica: (player: Player) -> any?, validatePlayer: (player: Player) -> boolean, val...
800
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/Dict.luau
luau
.luau
--!strict local Dict = {} local function getParentAndDictSlot(replicaData: any, pathKeys: {string}): (any?, string?) if #pathKeys == 0 then return nil, nil end local current = replicaData for i = 1, #pathKeys - 1 do local k = pathKeys[i] if typeof(current) ~= "table" then return nil, nil end current...
423
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/Leaderboard.luau
luau
.luau
--!strict local Players = game:GetService("Players") local DataStoreService = game:GetService("DataStoreService") local DataUtils = require(script.Parent.DataUtils) export type LeaderboardEntry = { userId: number, score: number, rank: number, } export type LeaderboardModule = { InitializeLeaderboards: () -> (), ...
3,290
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/Leaderstats.luau
luau
.luau
--!strict local Leaderstats = {} local INT32_MAX = 2147483647 local INT32_MIN = -2147483648 local function GetAppropriateValueType(value: number): string if value % 1 ~= 0 then return "NumberValue" elseif value > INT32_MAX or value < INT32_MIN then return "NumberValue" else return "IntValue" end end funct...
955
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/LegacyMigration.luau
luau
.luau
--!strict local DataStoreService = game:GetService("DataStoreService") local DataUtils = require(script.Parent.DataUtils) local LegacyMigration = {} export type MigrationResult = { applied: boolean, legacyFound: boolean, markerWritten: boolean, keyUsed: string?, strategy: string, markerPath: string, continuo...
2,906
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/OfflineData.luau
luau
.luau
--!strict local Players = game:GetService("Players") local DataUtils = require(script.Parent.DataUtils) local OfflineData = {} function OfflineData.GetOfflineData( userId: number, config: any, profileStore: any, getAllForPlayer: (player: Player) -> any? ): any? if not userId or userId == 0 then warn("[PlayerS...
788
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Server/Validation.luau
luau
.luau
--!strict local Players = game:GetService("Players") local Validation = {} function Validation.ValidatePlayer(player: Player): boolean return player and player.Parent == Players end function Validation.ValidateReplica(replica: any?): boolean return replica ~= nil and replica:IsActive() end function Validation.Va...
84
bellaouzo/PlayerState
bellaouzo-PlayerState-dd99119/src/Internal/Shared/PathCache.luau
luau
.luau
--!strict export type PathCacheModule = { GetPathKeys: (path: string) -> {string}, ClearCache: () -> (), } local function CreatePathCache(maxCacheSize: number): PathCacheModule local pathCache: {[string]: {string}} = {} local pathCacheSize: number = 0 local function GetPathKeys(path: string): {string} local c...
270