diff --git a/Archived/Run/Run.exe b/Archived/Run/Run.exe new file mode 100644 index 0000000..6d0573f Binary files /dev/null and b/Archived/Run/Run.exe differ diff --git a/Archived/Run/Run.py b/Archived/Run/Run.py new file mode 100644 index 0000000..a8cdd6e --- /dev/null +++ b/Archived/Run/Run.py @@ -0,0 +1,13 @@ +import wx + +app = wx.App(0) +dialog = wx.MessageDialog(None, 'There is nowhere you can run.', 'Warning', wx.OK|wx.ICON_ERROR) +res = dialog.ShowModal() +dialog.Destroy() +app.MainLoop() + +### To build the EXE for fun: ### +# mkdir ./venv +# python -m venv ./venv +# python -m pip install pyinstaller wxPython +# pyinstaller Run.py --noconsole -F --clean --icon "running.ico" --upx-dir "C:\upx-3.96-win64" --exclude-module select --exclude-module unicodedata --exclude-module socket --exclude-module decimal --exclude-module overlapped --exclude-module ssl --exclude-module asyncio --exclude-module queue --exclude-module ctypes --exclude-module multiprocessing --exclude-module pyexpat --exclude-module hashlib --exclude-module lzma --exclude-module bz2 --exclude-module libssl-1_1 --exclude-module libcrypto-1_1 --exclude-module libffi-7 \ No newline at end of file diff --git a/Archived/Run/running.ico b/Archived/Run/running.ico new file mode 100644 index 0000000..1c65949 Binary files /dev/null and b/Archived/Run/running.ico differ diff --git a/Archived/Run/stop.ico b/Archived/Run/stop.ico new file mode 100644 index 0000000..6451772 Binary files /dev/null and b/Archived/Run/stop.ico differ diff --git a/ExtractSubtitles/extractsubs_srt.bat b/ExtractSubtitles/extractsubs_srt.bat index 0657d3f..48e87bb 100644 --- a/ExtractSubtitles/extractsubs_srt.bat +++ b/ExtractSubtitles/extractsubs_srt.bat @@ -1,12 +1,12 @@ -@echo OFF -REM ffmpeg -i "%~1" -map 0:m:language:eng "%~n1.eng.srt" -REM ffmpeg -i "%~1" "%~n1.eng.srt" - -:LOOP -if "%~1"=="" goto :END - ffmpeg -i "%~1" "%~n1.eng.srt" - shift - goto :LOOP -:END - -if %errorlevel% neq 0 pause +@echo OFF +REM ffmpeg -i "%~1" -map 0:m:language:eng "%~n1.eng.srt" +REM ffmpeg -i "%~1" "%~n1.eng.srt" + +:LOOP +if "%~1"=="" goto :END + ffmpeg -i "%~1" -map 0:m:language:eng "%~n1.eng.srt" + shift + goto :LOOP +:END + +if %errorlevel% neq 0 pause diff --git a/Geoffrey/geoffrey.ico b/Geoffrey/geoffrey.ico new file mode 100644 index 0000000..13b46ab Binary files /dev/null and b/Geoffrey/geoffrey.ico differ diff --git a/Geoffrey/geoffrey.py b/Geoffrey/geoffrey.py new file mode 100644 index 0000000..144d40c --- /dev/null +++ b/Geoffrey/geoffrey.py @@ -0,0 +1,92 @@ +""" +Geoffrey - A very simple Discord server link remover for public channels. + +This bot expects an environment variable named DISCORD_TOKEN with your Discord user full-access token. + +--- + +IF the bot stops responding without any error, reinvite it to your server: + + https://discord.com/developers/applications + +Create an executable to run on Windows startup: + + pyinstaller --onefile --noconsole --icon=geoffrey.ico geoffrey.py + +More useful information: + + Module: https://github.com/Rapptz/discord.py + Guide: https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links + Bot permissions: https://discord.com/developers/docs/topics/permissions +""" + +import logging, sys, os +import discord + +DISCORD_TOKEN = os.getenv('DISCORD_TOKEN') + +logging.basicConfig( + handlers=[ + logging.FileHandler('geoffrey.log', mode='w'), + logging.StreamHandler(sys.stdout) + ], + encoding='utf-8', + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + datefmt='%m/%d/%Y %I:%M:%S %p' +) + +logger = logging.getLogger(__name__) + +invite_links = [ + 'discord.gg/', + 'discordapp.com/invite/', + 'discord.me/server/join/', + 'discord.com/invite/' +] + +allowed_links = [] + +# Lower case for string matching, even though invites are case sensitive. +invite_links = [x.lower() for x in invite_links] +allowed_links = [x.lower() for x in allowed_links] + + +class MyClient(discord.Client): + async def on_ready(self): + logger.info(f'Logged on as {self.user}!') + + async def on_message(self, message): + words = message.content.lower().split() + + for word in words: + if any(link in word for link in allowed_links): + logger.info('Detected safe link:') + logger.info(message.author) + logger.info(message.created_at.astimezone().strftime('%Y-%m-%d %H:%M:%S')) + logger.info(message.content) + logger.info('Did nothing.') + continue + + if any(link in word for link in invite_links): + await message.delete() + + logger.warning('Detected invite link:') + logger.warning(message.author) + logger.warning(message.created_at.astimezone().strftime('%Y-%m-%d %H:%M:%S')) + logger.warning(message.content) + logger.warning('Deleted!') + + +intents = discord.Intents.default() +intents.message_content = True + +if __name__ == '__main__': + client = MyClient(intents=intents) + + if not DISCORD_TOKEN: + error_msg = 'Environment variable DISCORD_TOKEN is not defined! Quitting...' + logger.error(error_msg) + sys.exit(error_msg) + + client.run(DISCORD_TOKEN) diff --git a/click.ahk b/click.ahk new file mode 100644 index 0000000..ba71bcd --- /dev/null +++ b/click.ahk @@ -0,0 +1,45 @@ +#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. +; #Warn ; Enable warnings to assist with detecting common errors. +SendMode Input ; Recommended for new scripts due to its superior speed and reliability. +SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. + +#MaxThreadsPerHotkey 2 + +MsgBox, 0, Functions, F1 - Click`nF2 - Hold Click`nF3 - Random E Key`nF4 - Random Clicking, 3 + +F1::Click +;F2::RButton +F2::Click down + +F3:: +ToggleE := !ToggleE +Loop +{ + If not ToggleE + break + + Random,rand, 838, 2292 + Sleep rand + Send e +} +return + +F4:: +Toggle := !Toggle +Loop +{ + If not Toggle + break + + Random,rand, 348, 1492 + Sleep rand + Click +} +return + +F5::ExitApp + +;New World +;ahk_class CryENGINE +;ahk_exe Javelin_x64.exe +;ahk_pid 4220 \ No newline at end of file diff --git a/lock_at_night.bat b/lock_at_night.bat new file mode 100644 index 0000000..7c9217e --- /dev/null +++ b/lock_at_night.bat @@ -0,0 +1,13 @@ +@echo off + +title LockAtNight +nircmd.exe win hide ititle "LockAtNight" + +SET hour=%time:~0,2% +SET shouldrun=False + +IF %hour% GEQ 0 IF %hour% LEQ 08 SET shouldrun=True + +IF "%shouldrun%"=="True" ( + C:\nircmd-x64\nircmd.exe monitor off +) diff --git a/mac_copypaste.ahk b/mac_copypaste.ahk new file mode 100644 index 0000000..ba34400 --- /dev/null +++ b/mac_copypaste.ahk @@ -0,0 +1,12 @@ +#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. +; #Warn ; Enable warnings to assist with detecting common errors. +SendMode Input ; Recommended for new scripts due to its superior speed and reliability. +SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. + +#MaxThreadsPerHotkey 2 + +MsgBox, 0, Functions, Copy Paste Cut with the Alt key, 3 + +!c::Send, ^c +!v::Send, ^v +!x::Send, ^x \ No newline at end of file diff --git a/~nwn2_camera_hold_x.ahk b/~nwn2_camera_hold_x.ahk new file mode 100644 index 0000000..b5bbc5b --- /dev/null +++ b/~nwn2_camera_hold_x.ahk @@ -0,0 +1,28 @@ +#Requires AutoHotkey v2.0 + +SendMode('Event') + +toggle := 0 + +ToggleX() +{ + global toggle + + Click 'X ' ((toggle := !toggle) ? 'down' : 'up') +} + +#HotIf WinActive("ahk_exe nwn2.exe") +; Override clicking X with a hold toggle of X +X:: +{ + ToggleX() +} + +; Release the toggle on Left Mouse Button click +~LButton:: +{ + if (toggle) { + ToggleX() + } +} +#HotIf