Skip to content

Instantly share code, notes, and snippets.

@Wampa842
Wampa842 / getCetusTime.js
Last active February 13, 2018 01:22
A function to pull the Cetus bounty reset timestamp from the world state file, then pass it to a callback
//The first parameter defines the platform (1: PC, 2: PS4, 3: XBO). If it's 0 or undefined, the function won't fetch anything - it'll instead use a static timestamp.
//I don't think there's any major difference between the platforms' times, you can probably safely use the PC data and remove the unnecessary lines.
//On success, the time is passed to the callback function. On any error, the callback will receive the static timestamp.
function getCetusTime(platform, callback)
{
var timestamp = 1510884902; //Static timestamp to be returned in case of an error. Correct as of 2018-02-13, for PC version 22.12.2. Might not be accurate in the future.
if(!platform || (platform > 3))
{
callback(timestamp);
return;
@Wampa842
Wampa842 / BuyableBehaviour.cs
Last active August 10, 2018 10:58
My Summer Car buyable mod item
/*
When the mod is loaded, instantiate your GameObject, then set its position to somewhere in Teimo's shop.
The GameObject must have the usual interactivity components - a convex MeshCollider and a Rigidbody.
It's best to set Rigidbody.isKinematic to true and GameObject.tag to "Untagged" before adding the behaviour component.
*/
/*MIT License
Copyright(c) 2018 Wampa842
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@Wampa842
Wampa842 / MSCLoaderPro.snippet
Created June 10, 2021 17:51
A collection of Visual Studio snippets for mod development for My Summer Car using MSC Loader Pro.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>mcl</Title>
<Shortcut>mcl</Shortcut>
<Description>Inserts ModConsole.Log(), or wraps selected code inside the method.</Description>
<Author>Wampa842</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@Wampa842
Wampa842 / GridBitmap.cs
Created December 8, 2021 11:55
Chequered bitmap
public static class GridBitmap
{
public static Bitmap Create(int repeatX, int repeatY, Size bitmapSize, Color foreground, Color background)
{
// Check for division by zero
if (repeatX == 0 || repeatY == 0)
throw new ArgumentException("Division by zero.");
Bitmap bmp = new Bitmap(bitmapSize.Width, bitmapSize.Height);
Graphics g = Graphics.FromImage(bmp);
@Wampa842
Wampa842 / AmbientCG Import.py
Last active March 21, 2022 22:17
AmbientCG material import add-on for Blender. Developed for 3.1.0, but probably compatible with earlier versions too.
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@Wampa842
Wampa842 / NvidiaSensors2.py
Last active November 6, 2022 00:46
Qtile widget to display arbitrary data from Nvidia GPU(s)
import csv
import re
from subprocess import CalledProcessError
from libqtile.widget import base
class NvidiaSensors2(base.ThreadPoolText):
"""
Displays arbitrary sensor data from Nvidia GPU(s).
Not backwards-compatible with ``libqtile.widget.NvidiaSensors``.
"""