Skip to content

Instantly share code, notes, and snippets.

@demonnic
demonnic / gist:c709905d1ba4884e46f4a0fd5add4269
Created January 18, 2018 16:27
generic mapper help text
Jor'Mox's Generic Map Script
This script allows for semi-automatic mapping using just room names and exits. It is
a good idea to know the general layout of the area you are trying to map before
turning on mapping with this script, so as to minimize how much you need to move
things around to make it look how you want it to. The script will automatically
stretch out a map to make space for a room if it would overlap with another one, but
it is important to make sure that things line up properly, or you will have inaccurate
maps with duplicate sections in them.
--Given the following table of defense for Normal mode
--And Beastmode, when you switch between them make sure
--The current defense list matches the intended list
defenses = defenses or {}
defenses.currentMode = defenses.currentMode or "None"
defenses.normal = defenses.normal or { "Antibodies", "sunscale", "shroud" }
defenses.beast = defense.beast or { "Transmission", "shroud", "poisonspit" }
defenses.current = defenses.current or {}
defenses.toRaise = defenses.toRaise or {}
demonnic.newContainer = demonnic.newContainer or Geyser.Container:new({x=0, y=0, height=400, width = 200})
local myCss1 = [[
border-width: 4px;
border-radius: 7;
border-color: red;
background-color: green;
]]
local myCss2 = [[
border-width: 4px;
border-radius: 7;
@demonnic
demonnic / getBadnessLevels.lua
Created October 24, 2021 03:56
getAlertGradientTable(max): Create a table of r,g,b color values for an alert scale 1 - max
local function getBadnessLevel(num, max)
local halfWay = (max+1) / 2
local stepSize = 255 / (halfWay - 1)
local r,g,b = 0,255,0
if num <= 1 then
return r,g,b
end
if num > max then
return 255,0,0
end
@demonnic
demonnic / simGMCP.lua
Last active November 12, 2022 03:03
A function to simulate a gmcp event in Mudlet by name, with a given payload
--- a naive implementation which should have some type checks put in place almost certainly
-- @param eventName the event name, IE "gmcp.Char.Vitals"
-- @param payload the payload to place at the endpoint. IE { name = "TestName", hp = 1388 }
-- @param skipEvent if set to true, will create the table space but not raise the event.
-- @usage simGMCP("gmcp.Char.Vitals", {name = "Demonnic", hp = 123, maxhp = 123})
-- -- the next one will not raise an event.
-- simGMCP("gmcp.Room.Info", {name = "TestRoom", vnum = 1000, x = 0, y = 0, z = 0, area = "TestArea"}, true)
function simGMCP(eventName, payload, skipEvent)
eventName = eventName:gsub("^gmcp.", "")
local eventTokens = eventName:split("%.")
@demonnic
demonnic / keybase.md
Created November 12, 2022 19:01
keybase.io verification

Keybase proof

I hereby claim:

  • I am demonnic on github.
  • I am demonnic (https://keybase.io/demonnic) on keybase.
  • I have a public key ASBQh3Z5wkpXDdK8BTzoHMpxXsT6c7o2T92G3qgsdKBGPwo

To claim this, I am signing this object:

@demonnic
demonnic / installOrUpdateCLITools.sh
Last active April 19, 2023 19:36
Script to install or update XCode Command Line Tools. Tested working on MacOS 13.3.1 on 2023-04-19
#!/usr/bin/env bash
cliLocation="/Library/Developer/CommandLineTools"
tmpFile="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
if [[ ! -d "$cliLocation" ]]
then
touch $tmpFile
fi
PROD=$(softwareupdate -l | grep "\*.*Command Line" | tail -n 1 | sed 's/^[^C]* //')
if [[ ! -z $PROD ]]
@demonnic
demonnic / Dominated.xml
Created May 11, 2023 16:37
Get dominated
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
<TriggerPackage>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Dom Gate</name>
<script>dominates = {}
deleteLine()</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>