Skip to content

Instantly share code, notes, and snippets.

View juhdanad's full-sized avatar

Dániel Juhász juhdanad

View GitHub Profile
Sub ÁtlagHiba()
If Selection.Areas.Count > 1 Then
MsgBox "Cannot do this to a multiple selection."
Exit Sub
End If
' Get working area
Dim src As Range
Dim avg As Range
Dim err As Range
Dim res As Range
@juhdanad
juhdanad / init.lua
Created July 9, 2017 21:26
Dirt placer mod
local timer=0
minetest.register_globalstep(function(dtime)
timer=timer+dtime
if(timer>=0.1) then
timer=0;
p=minetest.get_player_by_name("singleplayer")
if(p ~= nil) then
if(p:get_wielded_item():get_name()=="default:dirt") then
local dir=p:get_look_dir()
-- Rough position of player camera
@juhdanad
juhdanad / init.lua
Created May 20, 2017 11:39
Wool mod with autocolor
-- This uses a trick: you can first define the recipes using all of the base
-- colors, and then some recipes using more specific colors for a few non-base
-- colors available. When crafting, the last recipes will be checked first.
local dyes = {
{"white", "White", "basecolor_white"},
{"grey", "Grey", "basecolor_grey"},
{"black", "Black", "basecolor_black"},
{"red", "Red", "basecolor_red"},
{"yellow", "Yellow", "basecolor_yellow"},
warningstream << "ServerEnv: Trying to store id = " << obj->getId()
<< " statically but block " << PP(blockpos)
<< " already contains "
<< block->m_static_objects.m_stored.size()
<< " objects."
<< " Forcing delete." << std::endl;
warningstream << "Already stored data:" << std::endl;
for (std::vector<StaticObject>::iterator it =
block->m_static_objects.m_stored.begin();
it != block->m_static_objects.m_stored.end(); ++it)
local fix = function(name, param)
local x, y, z = string.match(param, "(%d+) (%d+) (%d+)")
local pos
if x==nil or y==nil or z==nil then
local player = minetest.get_player_by_name(name)
if not player then
return false, "Player not found"
end
pos = player:getpos()
else