Skip to content

Instantly share code, notes, and snippets.

View mkarneim's full-sized avatar

Michael Karneim mkarneim

  • Munich, Germany
View GitHub Profile
@mkarneim
mkarneim / basic-lib.lua
Last active May 14, 2017 10:24
Basic Lib
-- ( https://gist.github.com/mkarneim/a889319c844d68ca108c50bac53c4f10 )
require "gist.8500c7440543dfe1276caef9a82abfa5.Vec3"
require "gist.0c6e826dc55f2f0a0ac9a0f30b3930e2.Entity"
require "gist.18f8247ac3f12696469fd3095ce6dd6d.Player"
require "gist.5c93e4b3c29b1f088fece5cdda03a432.Spell"
--require "gist.01d4c8d83feb918898c4c9cc99539877.scribble"
OPPOSITE = {NORTH=SOUTH,EAST=WEST,SOUTH=NORTH,WEST=EAST,UP=DOWN,DOWN=UP,LEFT=RIGHT,RIGHT=LEFT,FORWARD=BACK,BACK=FORWARD}
ROTATE90CW = {NORTH=EAST,EAST=SOUTH,SOUTH=WEST,WEST=NORTH}
-- Extensions to Entity
function Entity:markLookPosition()
while true do
spell.pos = self.pos+vec3(0,self.eyeHeight,0)+self.lookVec*2
spell:execute("particle smoke "..spell.pos.x.." "..spell.pos.y.." "..spell.pos.z.." 0 0 0 0 0 force")
sleep(1)
end
end
-- Extensions to Player
function Player:clearInventory()
spell:execute("/clear %s", self.name)
end
@mkarneim
mkarneim / Vec3.lua
Last active April 11, 2017 20:14
aa
function Vec3.crossProduct(v1,v2)
check.Vec3(v1,1)
check.Vec3(v2,2)
return Vec3.from(
v1.y*v2.z - v1.z*v2.y,
v1.z*v2.x - v1.x*v2.z,
v1.x*v2.y - v1.y*v2.x
)
end
-- ^ operator
@mkarneim
mkarneim / Spell.lua
Last active April 21, 2017 14:57
aa
-- Spell
@mkarneim
mkarneim / scribble.lua
Last active September 6, 2017 15:07
aa
-- Some Personal Spells for MickKay
--( https://gist.github.com/mkarneim/01d4c8d83feb918898c4c9cc99539877 )
-- Require selection
-- ( https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f )
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
-- /give mickkay minecraft:written_book 1 0 {title:"lall", author:"mick", pages:["\"text\":\"bla\""]}
function xxx()
@mkarneim
mkarneim / Quaternion.lua
Last active April 13, 2017 17:30
Quaternion for doing 3d rotations
-- simple quaternion for doing vector rotations
-- ( https://gist.github.com/mkarneim/70b2ba363157c18266e20794db12b157 )
--[[
Original C Code from Phill Djonov,
http://vec3.ca/code/math/quaternions/
]]
quat = {}
@mkarneim
mkarneim / WizardsOfLua.lua
Last active June 15, 2017 16:08
Spells for the Wizards of Lua Server
-- Spell Book for the Wizards of Lua Server
-- ( https://gist.github.com/mkarneim/b84916f7a70f0a181a799fd527a03e72 )
-- Loading Basic Spell Book
-- https://gist.github.com/mkarneim/a889319c844d68ca108c50bac53c4f10
pcall(function() require("gist.a889319c844d68ca108c50bac53c4f10.basic-lib") end)
-- Loading The Architect's Spell Book
-- ( https://gist.github.com/mkarneim/cfd15dc4a8a6d4c5bd471b62a36a126d )
pcall(function() require("gist.cfd15dc4a8a6d4c5bd471b62a36a126d.architect") end)
@mkarneim
mkarneim / MickKay-WoL.lua
Last active August 1, 2017 15:18
MickKay's Common Spells for the Wizards Of Lua Server
-- MickKay's Common Spells for the Wizards Of Lua Server
-- ( https://gist.github.com/mkarneim/c94fa9589afadcd9ae345a599a0f31f8 )
-- gist.c94fa9589afadcd9ae345a599a0f31f8.MickKay-WoL
require "gist.a889319c844d68ca108c50bac53c4f10.basic-lib"
-- https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
mickkay = {
@mkarneim
mkarneim / architect.lua
Last active July 23, 2017 12:53
The Architect's Spell Book
-- The Architect's Spell Book
-- ( https://gist.github.com/mkarneim/cfd15dc4a8a6d4c5bd471b62a36a126d )
-- https://gist.github.com/mkarneim/a889319c844d68ca108c50bac53c4f10
require "gist.a889319c844d68ca108c50bac53c4f10.basic-lib"
-- https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
local STOP_SPELL = "architect.stop-spell"
local TAG = "architect-tag"