Skip to content

Instantly share code, notes, and snippets.

@Anaminus
Anaminus / rbxtype-proposal.md
Created October 8, 2014 05:34
Proposal to add function that returns internal value type

Proposal to add function that returns internal value type

ROBLOX provides many value types other than the Lua primitives, so it should be possible to distinguish these types beyond Lua userdata. Like the type function, a similar function which distinguishes these types should be implemented. Such a function could be used to enforce stricter typing of values, improving error detection and logging.

Function name

@Anaminus
Anaminus / b64fastenc.lua
Last active September 29, 2020 01:40
Lua - Base64 Fast Encode
local encodeByte = {
'A','B','C','D','E','F','G','H',
'I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X',
'Y','Z','a','b','c','d','e','f',
'g','h','i','j','k','l','m','n',
'o','p','q','r','s','t','u','v',
'w','x','y','z','0','1','2','3',
'4','5','6','7','8','9','-','_',
}
@Anaminus
Anaminus / splash-patch.lua
Created March 12, 2015 06:14
Replaces Roblox Studio's splash screen with another image.
-- Replaces Roblox Studio's splash screen with another image.
--
-- Usage:
--
-- lua splash-patch.lua [STUDIO_PATH] [IMAGE_PATH]
--
-- Specifying no options prompts for input.
-- First KB of original splash image file
@Anaminus
Anaminus / SolitaireRPG.md
Last active April 11, 2017 17:03
Solitaire RPG

Solitaire RPG

A game about battling monsters, using a standard deck of playing cards.

Character rolling

To roll a new character, select a level to begin. The default is level 8, though you may select any level, including level 0.

Draw a number of cards equal to your chosen level. These will be your

@Anaminus
Anaminus / BalanceCardGame.md
Last active August 29, 2015 14:22
Balance - Card Game

Balance - Card Game

  • 2 or more players.
  • 1 or more standard 52-card decks, each with 0-2 jokers.
  • Aces have a value of 1.
  • Face cards and jokers have a value of 10.
  • Everything else is face-value.

Play

Original:
<string name="Name">TEST</string>
Result Status:
pass file loads, property value is "TEST"
load file loads, property value is default value
fail file does not load, with an error message
@Anaminus
Anaminus / hist.go
Created September 15, 2015 11:23
HistoryStack
package hist
type Value interface{}
// Implements both an undo and redo stack using a circular buffer.
type HistoryStack struct {
buffer []Value
head, tail, cur int
ud, rd bool
}
@Anaminus
Anaminus / WoodReskewer.lua
Last active May 28, 2021 14:07
Some men just want to watch the wood burn.
-- LocalScript; Parent = ReplicatedFirst
-- Adornments not supported.
local WoodReviewerUserIDs = {
[102925343] = true,
}
if not WoodReviewerUserIDs[game:GetService("Players").LocalPlayer.UserId] then
return
@Anaminus
Anaminus / Brute.lua
Created September 25, 2016 20:45
Bruteforce Roblox members.
-- Brute.lua --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--[[
# Instructions
- Create Script in game.ServerStorage, named "Words".
- Fill it with any words that may be a potential instance or member name (one
word per line).
- Exclude words with 3 or less characters (these are generated automatically).
- Run this script via Execute Script.
@Anaminus
Anaminus / Signal.lua
Last active September 29, 2020 01:33
--[[
# Signal
API-compatible Roblox events.
Addresses two flaws in previous implementations:
- Held a reference to the last set of fired arguments.
- Arguments would be overridden if the signal was fired by a listener.