Skip to content

Instantly share code, notes, and snippets.

@Tyderion
Tyderion / slave.lua
Last active December 21, 2015 11:19
rednet.open("top")
config = {
}
registered = false
master = 0
pulseLengthInSec ={
["stack"] = 1.65,
["single-redstone"] = 6
}
rednet.open("right")
slaves = {}
rednet.broadcast("newmaster")
function dbjson(thing)
print(json.encodePretty(thing))
end
function compileResourceList()
@Tyderion
Tyderion / relay.lua
Last active December 21, 2015 11:18
modemside = "right"
master = 0
function checkModem()
if (not rednet.isOpen(modemside)) then rednet.open(modemside) end
end
function detectMaster()
checkModem()
print("looking for master")
if (master > 0 ) then return end
@Tyderion
Tyderion / cpm.lua
Last active December 21, 2015 10:59
Computercraf package Manager
-- Main Program taken from Computercraft mod
local upload_argument_name = "publish"
local install_argument_name = "install"
local update_argument_name = "update"
local list_argument_name = "list"
local program_name = fs.getName(shell.getRunningProgram()) -- "cpm"
local saveFileName = "listOfPrograms"
@Tyderion
Tyderion / Direction.lua
Created August 7, 2013 09:16
Directions for turtlebot within minecraft.
-- Directions
local Direction = {}
Direction.left = "left"
Direction.right = "right"
Direction.forward = "forward"
Direction.back = "back"
Direction.up = "up"
Direction.down = "down"
Direction.isValid = function(direction)
local dir = string.lower(direction)
@Tyderion
Tyderion / 000Readme.md
Last active December 20, 2015 17:58
Some Lua Stuff

##Closure / Table hybrid classes

Features:

  • Public/Private instance fields
  • Public/Private instance methods
  • public class methods/fields
  • inheritance (only 1 parent)

##Closure/table hybrid switch function

code-highlighter: http://softwaremaniacs.org/soft/highlight/en/
Host github-gist examples as homepage: http://bl.ocks.org/
@Tyderion
Tyderion / gist:5728783
Created June 7, 2013 12:03
Unicode Funny Stuff
Beer Mug: "\xF0\x9f\x8d\xba"
@Tyderion
Tyderion / gist:5684249
Created May 31, 2013 10:58
Tipps and Tricks
ADB
Only see browser log (console.log) in adb logcat: adb logcat browser:V *:S