Skip to content

Instantly share code, notes, and snippets.

View rubenwardy's full-sized avatar

rubenwardy rubenwardy

View GitHub Profile
@rubenwardy
rubenwardy / README.md
Last active January 4, 2016 18:46
Minetest Installer Script

Created by rubenwardy, based on a script by kaeza.

Your build directory should look like this:

  • minetest32/ (no games folder)
  • minetest64/ (no games folder)
  • games/
    • minetest_game/
    • minimal/
  • install.txt (included below)
@rubenwardy
rubenwardy / nbe_compile.sh
Last active October 31, 2022 02:27
One line install script for The-NodeBox-Generator.
sudo apt-get install git-core build-essential libirrlicht-dev cmake libpng12-dev libbz2-dev libjpeg8-dev libgl1-mesa-dev && git clone http://github.com/rubenwardy/nodeboxeditor && cd nodenoxeditor && cmake . && make -j2 && ./bin/nodeboxeditor
@rubenwardy
rubenwardy / mod_debug.lua
Last active January 3, 2022 08:56
Craft recipe checker for Minetest
-- Written by rubenwardy, WTFPL
-- To use:
-- * Save as mod_debug.lua in builtin/game
-- * add dofile(gamepath.."mod_debug.lua") to the last line of builtin/game/init.lua
-- OR
-- * Install as a mod. Needs to be run before any other mod.
local mod = {}
mod.recipes = {}
mod.aliases = {}
@rubenwardy
rubenwardy / init.lua
Created November 27, 2013 13:17
Minetest OS Mapgen
-- OS MAP READER
-- by rubenwardy
-- incomplete
-- CC BY SA
-- =================
osmapgen = {
_api = "http://maps.googleapis.com/maps/api/elevation/json?",
url = {},
data = {}
@rubenwardy
rubenwardy / login.bat
Created April 24, 2014 19:17
Batch login system, for fun
REM To set up, create a text file called users.txt
REM in the same directory as this batch file
REM with this content (without the REM)
REM 1,user1,password,staff
REM 2,user2,password,pupil
@ECHO OFF
SETLOCAL EnableDelayedExpansion
GOTO main
@rubenwardy
rubenwardy / init.lua
Last active August 29, 2015 14:01
code golf minetest mod 1
_=minetest;h={"get_objects_inside_radius","get_player_name","set_hp","get_hp","remove_node"};_.register_node("t:s",{});_.register_abm({nodenames={"t:s"},interval=0.2,chance=1,action=function(p) local o=_.env[h[1]](_.env,p,2);for k,b in pairs(o) do if b and b[h[2]] and b[h[2]](b)~=nil then b[h[3]](b,b[h[4]](b)-30); for d=-5,5 do for c=-5,5 do for a=-5,5 do if d*d+c*c+a*a<=30 then _.env[h[5]](_.env,{x=p.x+d,y=p.y+c,z=p.z+a}) end end end end _.env[h[5]](_.env,p);break; end end end })
@rubenwardy
rubenwardy / form1.cs
Last active August 29, 2015 14:01
Clever browser opener in C#
/*
Made this script to automatically open a web page in the correct browser.
I use multiple browsers at the same time, so I don't want to keep changing my file associations.
(Firefox used to have association, so if I am creating a game in Chrome and open a link in IRC,
firefox is opened. With this, it will be chrome because it is the only one open)
It priorities Firefox over Chrome, but you can change that.
(I use Firefox for browsing, Chrome for HTML5 games.
I use both of these and IE for web site development).
@rubenwardy
rubenwardy / noob_gen.py
Last active August 29, 2015 14:02
Python Noob Generator
# Python Noob Generator by rubenwardy
# License: WTFPL
# See IRC bot using this: https://gist.github.com/rubenwardy/8863c20a75e4faad3562
# Example:
### a random team mate shot your mum also dat enemy scouted a
### random gun and a random gun covered a random gun but also your
### mum nuked dat arsehole also a random thingy ran it like a arsehole blew up a kid
@rubenwardy
rubenwardy / bot
Created June 6, 2014 18:17
IRC bot for Python Noob Generator
# Based on http://linuxclues.blogspot.co.uk/2011/03/simple-python-irc-bot.html
# Requires https://gist.github.com/rubenwardy/4cb29fedb7952e5a4cdf
import socket
import re
import os
from noob_gen import *
import time
class Bot():
@rubenwardy
rubenwardy / run_lua.lua
Last active August 29, 2015 14:07
Chat command to run lua code in Minetest
minetest.register_chatcommand("l", {
params = "lua code",
description = "Run lua code",
func = function(name, param)
f = loadstring("minetest.chat_send_player(\"" .. name .. "\", \"Result: \" .. dump("..param.."))")
f()
end
})