Skip to content

Instantly share code, notes, and snippets.

View naokihada's full-sized avatar

Naoki Hada naokihada

View GitHub Profile
@naokihada
naokihada / wiz1_ocr_1.py
Created June 1, 2024 00:51
Wizardry 1: Character cration marathon hit Ctrl key if the bonus number is less than 25
import pyocr
import pyocr.builders
import pyautogui
import time
from PIL import Image, ImageOps, ImageEnhance
# Get the available OCR tools
tools = pyocr.get_available_tools()
if len(tools) == 0:
raise Exception("No OCR tool found")
@naokihada
naokihada / wiz1_sd_portfolio_02.txt
Created May 29, 2024 02:13
StableDiffusion (and sd-dynamic-prompts) prompt template for Wizardry 1 remake with random race, job, weapon, armor, hair color, gender
( { human in armor | elf in wizard robe | dwarf in armor | gnome in armor | hobbit in armor }:1.2 ),
( { 20yo | 40yo | 60yo | 80yo }:1.2 ),
( { 1girl, large breast, long hair | 1woman, large breast, long hair | 1boy | 1man }:1.1 ), solo,
( { Fighter, holding sword
| Mage, holding magic rod
| Priest, holding magic wand
| Thief, holding knife
| Bishop, holding magic stuff
| Samurai, holding katana
@naokihada
naokihada / wiz1_sd_portfolio.txt
Created May 26, 2024 18:52
StableDiffusion (and sd-dynamic-prompts) prompt template for Wizardry 1 remake.
( { Fighter, holding sword
| Mage, holding magic rod
| Priest, holding magic wand
| Thief, holding knife
| Bishop, holding magic stuff,
| Samurai, holding katana
| Lord, holding magic stuff,
| Ninja, holding kunai
}:1.2 ),
__hair_color__, 20yo,
@naokihada
naokihada / _backup_Wiz1_duplicate.bat
Created May 25, 2024 23:38
Duplicate back up of game data for Wizardry: Proving Grounds of the Mad Overlord
rem Duplicate back up of game data for Wizardry: Proving Grounds of the Mad Overlord
rem https://store.steampowered.com/app/2518960/
set TMP_SRC=%LOCALAPPDATA%\murphy\*.*
set TMP_DST=%LOCALAPPDATA%\murphy_backup_%random%
md %TMP_DST%
xcopy /C /D /E /V /Y %TMP_SRC% %TMP_DST%
@naokihada
naokihada / wiz1_mask_03_circle.py
Created May 25, 2024 18:37
Image process to make circle mask from 512 JPG to PNG in folder. It is for Wizardry Custom Portfolio.
import os
from PIL import Image, ImageDraw
# Specify the path to the input folder
input_folder = 'input_images'
output_folder = 'output_images'
# Create the output folder if it does not exist
if not os.path.exists(output_folder):
os.makedirs(output_folder)
import os
from PIL import Image, ImageDraw
# Specify the path to the input folder
input_folder = 'input_images'
output_folder = 'output_images'
# Create the output folder if it does not exist
if not os.path.exists(output_folder):
os.makedirs(output_folder)
@naokihada
naokihada / sort_remove_duplicate_hash_tag_string_space_delimitter.js
Last active July 28, 2023 05:49
Sort and remove duplicate of Hash tag strings for SNS posting usage (space delimitter)
function processHashTags(input) {
// Step 1: Split the input string by spaces (including line breaks) and remove leading/trailing whitespaces
const hashTagsArray = input.split(/\s+/).map(tag => tag.trim());
// Step 2: Remove the '#' symbol and create a Set to remove duplicates
const hashTagsSet = new Set(hashTagsArray.map(tag => tag.substring(1)));
// Step 3: Convert the Set back to an array and sort it in alphabetical order
const sortedHashTags = Array.from(hashTagsSet).sort();
@naokihada
naokihada / sort_remove_duplicate_hash_tag_string_commna_delimitter.js
Last active July 28, 2023 05:28
Sort and remove duplicate of Hash tag strings for SNS posting usage (commna delimitter)
function processHashTags(input) {
// Step 1: Split the input string by commas and remove leading/trailing whitespaces
const hashTagsArray = input.split(',').map(tag => tag.trim());
// Step 2: Remove the '#' symbol and create a Set to remove duplicates
const hashTagsSet = new Set(hashTagsArray.map(tag => tag.substring(1)));
// Step 3: Convert the Set back to an array and sort it in alphabetical order
const sortedHashTags = Array.from(hashTagsSet).sort();
@naokihada
naokihada / sort_json_by_id.js
Created July 28, 2023 04:58
JS: Sort JSON data by ID field
const data = {
controls: [
{
"id": "cde",
"data": 456
},
{
"id": "abc",
"data": 123
}