Skip to content

Instantly share code, notes, and snippets.

@mikeshardmind
mikeshardmind / dofus-setup.sh
Last active May 7, 2017 04:23
Quick script for Installing dofus and its dependencies
#!/bin/bash
#Run this from the same folder as dofus-amd64.tar.gz
#Run as a normal user to prevent root ownership of the files
#Will prompt for sudo partially through setup
#Only tested to work on Ubuntu 16.04, 15.10, 15.04, 14.04, 12.04 and Mint 17.x, 17, 13
#adobe air installation adapted from someone else's script found here : http://drive.noobslab.com/data/apps/AdobeAir/adobe-air.sh
if [ $# -ne 2 ]; then
echo "Usage: $0 path/to/dofus.tar.gz path/to/place/game/folder"
exit 0
#!/bin/bash
#Automatically Raises the Dofus window that is flashing
while [ 1 -lt 2 ] ; do
for id in `xdotool search --class "Dofus"`; do
xprop -id $id | grep "The urgency hint bit is set" > /dev/null 2>&1
if [ "$?" = "0" ]; then
wmctrl -i -a $id
fi
done
sleep 1
#!/bin/bash
#Dofus Window Switcher
#Usage: With no parameters, attempts to switch to a flashing dofus window.
#With a parameter, switch to the window with that title
if [ -z $1 ] ; then
for id in `xdotool search --class "Dofus"`; do
xprop -id $id | grep "The urgency hint bit is set" > /dev/null 2>&1
if [ "$?" = "0" ]; then
wmctrl -i -a $id
;This section makes the flashing dofus window come to front, dont touch this without knowing what you are doing
DetectHiddenWindows, On
Script_Hwnd := WinExist("ahk_class AutoHotkey ahk_pid " DllCall("GetCurrentProcessId"))
DetectHiddenWindows, Off
DllCall("RegisterShellHookWindow", "uint", Script_Hwnd)
OnMessage(DllCall("RegisterWindowMessage", "str", "SHELLHOOK"), "ShellEvent")
ShellEvent(wParam, lParam) {
if (wParam = 0x8006) HSHELL_FLASH
{
WinGet,descobre,ProcessName, ahk_id %lParam%
@mikeshardmind
mikeshardmind / cleanup.py
Last active September 8, 2020 17:55
Targetted cleanup bot.
#!/usr/bin/env python3
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@mikeshardmind
mikeshardmind / dofus-setup-2.48.sh
Last active April 15, 2020 23:05
Because Ankama still can't actually properly package for linux. (Ubuntu 18.04 Bionic tested)
#!/bin/bash
# This is a shitty workaround to Ankama not providing everything required in an actual package
# or even a proper dependency list.
# License: Unlicense, see bottom of file
if [ $# -ne 2 ]; then
echo "Usage: $0 path/to/dofus.tar.gz path/to/place/game/folder"
exit 0
@mikeshardmind
mikeshardmind / retrocensor.py
Last active February 10, 2022 18:21
Because Discord Partner Terms and Discord T&S exist at an intersection of insanity.
#!/usr/bin/env python3
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
# Copyright 2020-present Michael Hall
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@mikeshardmind
mikeshardmind / ez_badge.py
Last active November 18, 2022 20:57
Because people are running random untrusted code for discord's stupid badge. At least here's a safe way.
# Copyright 2022 Michael Hall
# LICENSE: Apache License, Version 2.0 : http://www.apache.org/licenses/LICENSE-2.0
from __future__ import annotations
import discord
import pathlib
import random
from discord import app_commands
@mikeshardmind
mikeshardmind / rl_handler.py
Created December 12, 2022 02:00
discord.py ratelimit monitoring.
# Copyright 2022 Michael Hall
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,