Skip to content

Instantly share code, notes, and snippets.

-- Build placeables into map
-- agp8x
-- 08.05.2016
-- UserAttributes:
-- onCreate: <mapName>.onCreatePlaceable
-- xmlFile: <path-to-xml>
--[[
--original author [Bayn]
--Script reworked 2014-11-18 -JH
--Edit 2015-04-22 to Sun on every Time (north of Polarcircle) by böserlöwe
EventListener = {};
local dir = g_currentModDirectory;
function EventListener:loadMap(name)
local env = Environment:new(Utils.getFilename("sky/sky_day_night.i3d", dir), true, 8, true, true);
-- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.
-- agp8x
AdvertisingPlateMap = {};
local AdvertisingPlateMap_mt = Class(AdvertisingPlateMap);
function AdvertisingPlateMap:onCreate(id)
g_currentMission:addUpdateable(AdvertisingPlateMap:new(id))
end;
@agp8x
agp8x / SiloBaler.lua
Created March 7, 2016 19:21
BaleUtils:getBale problem
--[[output:
SiloBaler:createBale(): --call getBale()
BaleUtil:getBale(9, 1.2, 0.9, 2.4, 1.8, false)
BaleUtil:getBale(): --received
BaleUtil:getBale(1.2, 0.9, 2.4, 1.8, false, nil)
]]
local getBale_orig = BaleUtil.getBale
@agp8x
agp8x / money.py
Last active February 28, 2016 13:35
iterational solver for send+mony=money
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import itertools
orig_csp={
'm': (),
'o': ('s','m'),
'n': ('e','o'),
'e': ('n','r'),
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
G = {
'A': {
'Z': 75,
'S': 140,
'T': 118
@agp8x
agp8x / save_doc.sh
Last active August 29, 2015 14:22
Download FS15 script documentation and convert it to lua
#!/bin/bash
host="www.ls-mods.de/"
starturl=$host"scriptDocumentation.php?language=de"
extract_lua(){
file="$1"
out=${file%.*}
cat $file|grep "code-listing-code"|cut -d">" -f5-|sed s/'<[^>]\+>'//g|sed s/'&quot;'/'"'/g|sed s/'&gt;'/'>'/g|sed s/'&lt;'/'<'/g|sed s/'&amp;'/'&'/g > $out
grep -E '&.*;' --color -nH $out
}
iterate_classes(){