Skip to content

Instantly share code, notes, and snippets.

View Kruithne's full-sized avatar
🚀
Go as far as you can take it

Kruithne Kruithne

🚀
Go as far as you can take it
View GitHub Profile
@Kruithne
Kruithne / Tunnel.lua
Created June 20, 2014 01:59
Tunnel Script
function tunnel_start(data)
local p = Player:new(data["player"]);
p:clearInventory();
p:removePotionEffects();
end
registerHook("REGION_ENTER", "tunnel_start", "spawn-tunnel_start");
registerHook("REGION_LEAVE", "tunnel_start", "spawn-tunnel_start");
function tunnel_complete(data, ach)
@Kruithne
Kruithne / flint.lua
Created June 20, 2014 02:10
Flint Thingy
function flint_thing(data)
local p = Player:new(data["player"]);
p:sendEvent("achievement.deadbone");
end
registerHook("REGION_ENTER", "flint_thing", "spawn-some_region");
@Kruithne
Kruithne / winking.lua
Created June 20, 2014 02:32
Winking Creeper
local world = World:new('spawn');
local spot = Location:new(world, 30048.5, 82, 29986.5);
local minecartSpot = Location:new(world, 30063.5, 94, 29986.5);
local minecart = Entity:new(minecartSpot);
local openTimer = Timer:new("pub_close", 20 * 2);
local openBlocks = {
Location:new(world, 30059, 96, 29986),
Location:new(world, 30059, 95, 29986),
@Kruithne
Kruithne / loot.lua
Created June 20, 2014 02:34
Loot Game
local world = World:new('spawn');
local chestLocs = {
Location:new(world, 30018, 62, 29974),
Location:new(world, 30019, 62, 29974),
Location:new(world, 30020, 62, 29974),
Location:new(world, 30021, 62, 29974),
Location:new(world, 30018, 62, 29975),
Location:new(world, 30019, 62, 29975),
Location:new(world, 30020, 62, 29975),
function t_copy (t) -- shallow-copy a table
if type(t) ~= "table" then return t end
local meta = getmetatable(t)
local target = {}
for k, v in pairs(t) do target[k] = v end
setmetatable(target, meta)
return target
end
local world = World:new('survival_tournament');
<!DOCTYPE html>
<html>
<head>
<title>Result</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
</head>
<body>
<img src="http://bit.ly/NnVbxt"/>
</body>
</html>
@Kruithne
Kruithne / gist:3160045661a31a1d5d9d
Created June 21, 2014 20:12
GoneFishing confi
stepCount: 6
stepLength: 600
startingMessage: '&3The fishing tournament at spawn is starting in <time> minutes!'
startedMessage: '&aThe fishing tournament at spawn has started! The first player to
catch 30 Tastyfish at spawn will win!'
eventLength: 3600
concludeNoWinnerMessage: '&3The fishing tournament has ended with no winner!'
concludeMessage: <player> &ahas won the fishing tournament!
lootDropChance: 1
eventDropChance: 70
if (ogre.isItching())
{
if (ogre.getItchStage() == 0)
{
boolean done = true;
if (rightarm.rotateAngleX > -2.96706F)
{
done = false;
rightarm.rotateAngleX -= 0.1F;
}
@Kruithne
Kruithne / gist:10331f989f1a9b21279c
Created February 9, 2015 21:10
Last Man Standing
function t_copy (t) -- shallow-copy a table
if type(t) ~= "table" then return t end
local meta = getmetatable(t)
local target = {}
for k, v in pairs(t) do target[k] = v end
setmetatable(target, meta)
return target
end
local world = World:new('lms');
public static List<Map<String, Object>> serializeItemList(List<ConfigurationSerializable> list)
{
List<Map<String, Object>> map = new ArrayList<Map<String, Object>>();
for (ConfigurationSerializable configurationSerializable : list)
map.add(serialize(configurationSerializable));
return map;
}
public static Map<String, Object> serialize(ConfigurationSerializable configurationSerializable)