This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{_ is this a duplicate of the previous value? _} | |
{set duplicate to [ | |
"source": event.source = state.sc_last_message_source, | |
"from": event.from = state.sc_last_message_from, | |
"message": event.message = state.sc_last_message_message | |
]} | |
{SetState('sc_last_message_source', event.source)} | |
{SetState('sc_last_message_from', event.from)} | |
{SetState('sc_last_message_message', event.message)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Elite Dangerous: old forum URL redirector - frontier.co.uk | |
// @namespace rimspace.net | |
// @match *://forums.frontier.co.uk/showthread.php/* | |
// @grant none | |
// @run-at document-start | |
// @version 1.0 | |
// @author Daniel Pittman <[email protected]> | |
// @description when you land on an old forum URL, instead redirect to the "modern" equivalent. | |
// does not try and rewrite the URL before you hit the 404 page, though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PrintUnlockableTechTrees: cmk.NMS.Script.QueryClass { | |
protected override void Execute() { | |
var Unlockable = Game.ExtractMbin<GcUnlockableTrees>("METADATA/REALITY/TABLES/UNLOCKABLEITEMTREES.MBIN"); | |
foreach (var tree in Enum.GetValues<UnlockableItemTreeEnum>()) { | |
Log.AddHeading(Enum.GetName<UnlockableItemTreeEnum>(tree)); | |
PrintTree(Unlockable.Trees[(int)tree]); | |
} | |
} | |
string Translate(string id) => Game.FindLanguageData(id)?.Text ?? id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Freighter_Containerh_Sceneref: SCModClass { | |
protected override void Execute() { | |
Log.AddInformation("Trying to fix the freighter bug where destroying a cargo container changes the entire section..."); | |
var scene = ExtractMbin<TkSceneNodeData>("MODELS/COMMON/SPACECRAFT/INDUSTRIAL/CARGO/CARGOLARGEA.SCENE.MBIN"); | |
// 1. find the bit where the cargo container children are at; a LOCATOR above their MESH data, in this case. | |
var container = scene | |
.Children | |
.Flatten(node => node.Children) | |
.Where(node => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static void OnAfterExecute(NMS.Script.ModFiles modfiles, CancellationToken cancel) { | |
// gather all the warnings and above from the log | |
var alerts = modfiles.ExecuteLog | |
.Where(item => item.Type == LogItemType.Warning || item.Type == LogItemType.Failure) | |
.ToList(); | |
if (alerts.Any()) { | |
int warnings = alerts.Where(item => item.Type == LogItemType.Warning).Count(); | |
int errors = alerts.Where(item => item.Type == LogItemType.Failure).Count(); | |
var heading = new StringBuilder("—————< "); | |
if (warnings > 0) heading.AppendFormat("{0} WARNINGS", warnings); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WTF, why there no kitchen? | |
[HarmonyPatch(typeof(RoomRoleWorker_Kitchen), "GetScore")] | |
internal static class RoomRoleWorker_Kitchen__HandleDesignationCategoryChanges { | |
public static IEnumerable<CodeInstruction> Transpiler( | |
IEnumerable<CodeInstruction> code, | |
ILGenerator generator, | |
MethodBase original | |
) { | |
string name = original.ShortDescription(); | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Patch> | |
<Operation Class="XmlExtensions.Conditional"> | |
<xpath>Defs/ThingDef[defName="VFEA_AncientChemfuelPoweredGenerator"]</xpath> | |
<caseTrue> | |
<Operation Class="XmlExtensions.PatchOperationSafeAdd"> | |
<xpath>Defs/ThingDef[defName="VFEA_AncientChemfuelPoweredGenerator"]/comps/li/fuelFilter/thingDefs</xpath> | |
<compare>Both</compare> | |
<value> | |
<li MayRequire="Scruffy.Content.ONIAnimals">OxR_Coal</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Patch> | |
<Operation Class="XmlExtensions.PatchOperationSafeAddOrReplace" MayRequire="Kompadt.Warhammer.Dryad"> | |
<xpath>Defs/MeditationFocusDef[defName="Natural"]</xpath> | |
<compare>Both</compare> | |
<value> | |
<requiredBackstoriesAny> | |
<li> | |
<categoryName>KTDryadGood</categoryName> | |
<slot>Childhood</slot> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is just an excerpt, of course... | |
namespace CrashLanding { | |
public class Ticker_MTcounter : Building { | |
public void DoSpawn(int tickAmt) { | |
Predicate<IntVec3> validator = (Predicate<IntVec3>) (x => { | |
foreach (IntVec3 c in GenAdj.OccupiedRect(x, Rot4.North, new IntVec2(3, 3))) { | |
if (!c.InBounds(this.Map) || c.Fogged(this.Map) || !c.Standable(this.Map) || c.Roofed(this.Map) && c.GetRoof(this.Map).isThickRoof) | |
return false; | |
foreach (Thing thing in c.GetThingList(this.Map)) { | |
if (thing.def.preventSkyfallersLandingOn) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Matt Mastracci ([email protected]) | |
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script | |
# licensed under cc-wiki with attribution required | |
# Remainder of script public domain | |
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm | |
if [[ $NAME = "iTerm" ]]; then | |
FILE=$(osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")") | |
else |
NewerOlder