Skip to content

Instantly share code, notes, and snippets.

View scheibo's full-sized avatar

Kirk Scheibelhut scheibo

View GitHub Profile
import * as smogon from 'smogon';
import {JSDOM} from 'jsdom';
const text = await (await fetch(`https://www.smogon.com/dex/sv/formats/`)).text();
const formats = smogon.Analyses.parse(text).injectRpcs[1][1].formats;
for (const {shorthand, genfamily} of formats) {
for (const gen of genfamily) {
const id = shorthand.toLowerCase().replaceAll(' ', '-');
const url = `https://www.smogon.com/dex/${gen.toLowerCase()}/formats/${id}/`;
const endian = @import("builtin").cpu.arch.endian();
var bytes: usize = 0;
const a = std.mem.toBytes(copy)[0..376];
const b = std.mem.toBytes(battle.*)[0..376];
var diffs: [128]u8 = undefined;
var i: usize = 0;
var j: usize = 0;
while (i < 376) : (i += 2) {
const ai = std.mem.bytesAsValue(u16, a[i .. i + 2]).*;
if (ai != std.mem.bytesAsValue(u16, b[i .. i + 2]).*) {
const fs = require('fs');
const words = [];
for (const line of fs.readFileSync(process.argv[2], 'utf8').trim().split('\n')) {
const word = line.trim();
words[word.length - 2] = words[word.length - 2] || [];
words[word.length - 2].push(word);
}
for (let n = 5; n <= 5; n++) {
This file has been truncated, but you can view the full file.
(AA|AB)_ AAS/ABS
(AA|AC)_ AAH/ACH
(AA|AC)___ AAHED/ACHED
(AA|AC)____ AAHING/ACHING
(AA|AD)_ AAS/ADS
(AA|AG)_ AAS/AGS
(AA|AH)_ AAS/AHS
(AA|AI)_ AAL/AIL AAS/AIS
(AA|AI)__ AALS/AILS
(AA|AL)_ AAL/ALL AAS/ALS
const fs = require('fs');
const spreads = {};
const IV = 30;
const POWER = 70;
const HP = {
Bug: {ivs: {atk: 30, def: 30, spd: 30}, dvs: {atk: 13, def: 13}},
Dark: {ivs: {}, dvs: {}},
@scheibo
scheibo / PT
Last active May 7, 2024 00:58
PT
SIDE LYING TWIST
SUPINE WINDOW WIPERS
HIP MOBILITY DRILL
HALF KNEELING WALL TRUNK ROTATION
SINGLE LEG SIT-BACKS
QUICK-REBOUNDING CALF RAISE
ALTERNATE FORWARD LUNGE
SIDE LUNGE
STAR BALANCE TAP
import type {Battle, Side, Pokemon} from ".";
function encodeBattle(battle: Battle) {
const buf: any[] = [];
for (const side of battle.sides) {
encodeSide(side, buf);
}
buf.push(battle.turn);
buf.push(battle.lastDamage);
% W L T
0 49663 50117 220
1 49170 50643 187
2 48757 51056 187
3 48208 51580 212
4 48027 51772 201
5 47450 52344 206
6 46766 53052 182
7 46154 53657 189
8 45990 53827 183
import {Generations} from '@pkmn/data';
import {TeamGenerators} from '@pkmn/randoms';
import {Battle, Dex, ID, PRNG, PRNGSeed, Teams, extractChannelMessages} from '@pkmn/sim';
import {RandomPlayer} from './random-player';
Teams.setGeneratorFactory(TeamGenerators as any);
const gens = new Generations(Dex as any);
const gen = gens.get(process.argv[2] ?? 1);
sProtectSuccessRates
FF FF
FF 7F
FF 3F
FF 1F
sMovesForbiddenToCopy
76 00