Skip to content

Instantly share code, notes, and snippets.

View michlbro's full-sized avatar

Michael michlbro

  • United Kingdom
  • 10:29 (UTC +01:00)
View GitHub Profile
@michlbro
michlbro / Profiler.lua
Created August 27, 2023 18:28
Profiler for Lua
local Profiler = {}
function Profiler:AddTask(taskName, func)
self.task[taskName] = {func}
end
function Profiler:RunTasks(repeats, count)
local results = {}
for taskName, task in self.task do
@michlbro
michlbro / CGoLModule.lua
Created August 3, 2023 01:18
Conway's Game Of Life.
--[[
Conway's Game Of Life.
Created by michlbro.
Mechanics:
1. Underpopulation: less than 2 neighbour cells.
2. Overpopulation: more than 3 neighbour cells.
3. Lives: 2 or 3 neighbour cells.
4. Reproduction: 3 neighbour cells.
@michlbro
michlbro / ModuleInitialiser.lua
Created August 2, 2023 23:42
My custom module initialiser made for Roblox. Helps to make scripting easier by providing a framework for scripts.
--[=[
Module initialiser created by michlbro
USAGE:
-- Table: module
local module = {}
-- initialiser binds the globalenvironment (Core), Print Debug (Print), tool (tool), AddClass (AddClass), GetClass (GetClass)
function module.Init() -- Initialise
[18:37:54] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[18:37:54] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[18:37:54] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[18:37:54] [main/INFO]: Forge Mod Loader version 14.23.5.2860 for Minecraft 1.12.2 loading
[18:37:54] [main/INFO]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_312, running on Windows 10:amd64:10.0, installed at C:\Users\Konou\AppData\Roaming\gdlauncher_next\java\1.8.0_312-b07
[18:37:54] [main/INFO]: Searching C:\Users\Konou\AppData\Roaming\gdlauncher_next\instances\Industrial renewal test\..\..\instances\Industrial renewal test\mods for mods
[18:37:54] [main/INFO]: Searching C:\Users\Konou\AppData\Roaming\gdlauncher_next\instances\Industrial renewal test\..\..\instances\Industrial renewal test\mods\1.12.2 for mods
[18:37:54] [main/INFO]: Loading tweaker codechicken.asm.internal.Tweaker from ChickenASM-1.12-1.0.2.
@michlbro
michlbro / filesorter.py
Last active February 25, 2023 17:04
File sorter made in python.
import os, shutil
# "filePathType": r"/filepath"
filePaths = {
"video": r"/videos",
"picture": r"/pictures",
"sound": r"/sounds",
"document": r"/documents",
"jar": r"/jars",
"apk": r"/apks",
--[[
Created by michlbro#0414
USAGE:
local FractalGenerator = require(<path to this module>)
local fractal = FractalGenerator.new(seed: number?, fractalProperties: table?)
fractalProperties = {
amplitude = number?,
--[[
31/12/2022
03:17AM
o Created by XxprofessgamerxX cause I am lazy (michlbro#0414)
o Contributions:
capetaanal#1984
]]--
local colourMethods = {}
local Lighting = game:GetService("Lighting")
local colour = require(script.ColourModule)
local config = require(script.Config)
-- CONFIG Is a module
--[[
return {
Camera = {
CFrame = CFrame.new(-78.37872314453125, 7.211678504943848, -20.33516502380371) * CFrame.fromOrientation(-0.18555288016796112, 2.489468812942505, -0),
--[[
Created by XxprofessgamerxX
25/12/2022.
- Pulls out every single script in game and puts them in a folder.
- Basically using this to find out what scripts exist and just to have an empty map that I can sort out.
- Also deletes the scripts along with its constituents
]]
local pathScriptDump = workspace -- Path
local scriptDumpName = "ScriptsPulled" -- Name
local function GetIndexFromNode(nodedIndex, node)
return nodedIndex[node]
end
local function GetNodeFromIndex(indexedNodes, index)
return indexedNodes[index]
end
--[[