Skip to content

Instantly share code, notes, and snippets.

@Schroedi
Schroedi / MapDevice.cs
Last active September 25, 2024 16:49
private static async Task<bool> FastMoveFromDevice(int itemId)
{
// get the generic control, regardless of whether we have a 4 or 5 slot device
var inventoryControlWrapper = MapDevice.InventoryControl;
// accessing the items works on both
var itemCount = inventoryControlWrapper.Inventory.Items.Count;
var item = inventoryControlWrapper.Inventory.FindItemById(itemId);
if (item == null)
{
GlobalLog.Error($"[FastMoveFromDevice] Fail to find item {itemId} in Map Device.");
@Schroedi
Schroedi / main.js
Created May 24, 2023 19:25 — forked from kdzwinel/main.js
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.