little programs for ComputerCraft:Tweaked (and emulators like CCEmuX and CraftOS-PC) often based on real-life command line utilities. trinkets can be:
- based on real-life command line utilities (such as
catorpwd) - original but helpful to the environment they're meant to be used in (such as a peripherals manager for emulators)
all trinkets showcased in this repository are made with three rules:
- the top two lines must be program info
- the program must fit in as little lines as possible even if it will sacrifice some code readability
- never use ai
to contribute, you can fork this and make a trinket, then submit a pull request. if it follows these rules and the guideline of what a trinket is, it will be added :3
for information on individual trinkets, visit the wiki :3
guidelines for making a trinket:
- choose a real-life command utility to be inspired by or to recreate the basic function of OR an idea on how to make a useful CraftOS-specific program
- the first line must follow this format:
<file name> by <your github user> for nepetafureel/trinkets on github and is subject to the terms of the MIT license - the second line must be a short sentence about what the trinket does.
- never leave space between blocks of code.
- NO!
local foo = "bar"
local bar = "foo"
print(bar,foo)
- YES!
local foo = "bar"
local bar = "foo"
print(bar,foo)
- avoid using properly-named variables if you can. use the 26 letters of the alphabet. two notable exceptions to this is collecting arguments, which can be properly named
argsor some variation, and complex programs (like implementations ofpushd/popd) in which you are welcome to throw simplicity and compression to the wind if it is too hard. - if your trinket makes http requests, please put
{ ["User-Agent"] = "<trinket name>/0.0" }in the "headers" argument. for more information, see ComputerCraft:Tweaked HTTP docs.