-- ~26.5 Hours@60fps
package.path = "./main/?.lua;"
movement = loadfile('movement.lua')
m = movement()
local num = 5

press_b = {
    {'b', 60}
}

poison_kill = {
    {'runR', 105},
    {'runL', 105},
}
pokecenter_heal = {
    {'a', 15}, -- heal
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 500},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- end heal
}
run_daycare = {
    {'runD', 480},
    {'runU', 480},
}
use_move = {
    {'a', 15},
    {'a', 15},
    {'w', 540},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
}

start5 = {
    {'w', 204}, -- leave celadon gym
    {'d', 15},
    --mapChange
    {'w', 256},
    {'d', 4},
    {'r', 9},
    {'d', 2},
    {'r', 5},
    {'d', 2},
    {'r', 18},
    {'u', 2},
    {'w', 60},
    {'a', 12},
    {'w', 56},
    {'a', 22},
    {'w', 54},
    {'a', 21},
    {'w', 57},
    {'a', 19},
    {'w', 197},
    {'u', 3},
    {'l', 17},
    {'u', 9},
    {'l', 17},
    {'u', 2},
    {'l', 2},
    {'u', 10},
    {'r', 37},
    {'u', 4},
    {'r', 6},
    {'u', 2},
    --mapChange
    {'w', 200},
    {'u', 7},
    {'w', 60},
    {'pokecenter_heal', 1},
    {'w', 180},
    {'d', 6},
    --mapChange
    {'w', 244},
    {'r', 4},
    {'u', 6},
    {'l', 13},
    {'l', 1},
    {'u', 6},
    {'l', 9},
    {'d', 4},
    --mapChange
    {'w', 160},
    {'r', 4},
    --mapChange
    {'w', 102},
    {'l', 4},
    --mapChange
    {'w', 106},
    {'r', 4},
    --mapChange
    {'w', 107},
    {'l', 2},
    {'w', 24},
    {'d', 4},
    {'w', 21},
    {'r', 4},
    {'w', 26},
    {'d', 9},
    {'w', 39},
    {'l', 3},
    {'w', 51},
    {'l', 1},
    {'w', 45},
    {'u', 2},
    --mapChange
    {'w', 142}, -- acquire eevee
    {'u', 1},
    {'w', 26},
    {'r', 3},
    {'w', 61},
    {'r', 1},
    {'w', 30},
    {'u', 3},
    {'w', 39},
    {'a', 21},
    {'w', 62},
    {'a', 45},
    {'w', 41},
    {'a', 50},
    {'d', 2},
    {'r', 2},
    {'a', 15},
    {'u', 2},
    {'l', 3},
    {'a', 15}, 
    {'w', 60},
    {'r', 4},
    {'d', 3},
    {'a', 15},
    {'u', 3},
    {'l', 4},
    {'a', 60},
    {'a', 60},
    {'r', 3},
    {'d', 2},
    {'a', 15},
    {'s', 15},
    {'a', 15}, -- named eevee
    {'w', 100},
    {'w', 258}, -- leave building
    {'d', 4},
    {'l', 4},
    --mapChange
    {'d', 2},
    {'w', 179},
    {'r', 4},
    {'u', 9},
    {'l', 3},
    {'u', 4},
    {'r', 3},
    --mapChange
    {'w', 215},
    {'l', 3},
    --mapChange
    {'w', 103},
    {'r', 3},
    --mapChange
    {'w', 100},
    {'l', 2},
    {'u', 2},
    --mapChange
    {'w', 200},
    {'u', 2},
    {'l', 26},
    {'d', 1},
    {'w', 135},
    {'a', 9},
    {'w', 89},
    {'a', 18},
    {'w', 42},
    {'a', 21},
    {'w', 217},
    {'r', 35},
    {'w', 71},
    {'d', 5},
    {'w', 33},
    {'r', 13},
    {'w', 25},
    {'d', 8},
    {'w', 36},
    {'l', 4},
    {'w', 38},
    {'u', 3},
    --mapChange
    {'w', 227}, -- get gyarados from PC
    {'u', 4},
    {'w', 34},
    {'r', 5},
    {'w', 39},
    {'u', 3},
    {'w', 55},
    {'a', 20},
    {'w', 65},
    {'a', 22},
    {'w', 70},
    {'a', 23},
    {'w', 63},
    {'a', 24},
    {'w', 68},
    {'a', 20},
    {'w', 139},
    {'w', 181},
    {'a', 17},
    {'w', 185},
    {'a', 17},
    {'w', 127},
    {'a', 19},
    {'w', 236},
    {'b', 29},
    {'w', 52},
    {'b', 24},
    {'w', 47},
    {'b', 34},
    {'w', 69},
    {'b', 26},
    {'w', 59},
    {'b', 24},
    {'w', 50},
    {'b', 28},
    {'w', 197}, -- teach gyarados water pulse
    {'s', 11},
    {'w', 156},
    {'a', 13},
    {'w', 166},
    {'l', 1},
    {'w', 298},
    {'r', 1},
    {'w', 383},
    {'a', 11},
    {'w', 166},
    {'a', 16},
    {'w', 258},
    {'d', 1},
    {'w', 160},
    {'a', 24},
    {'w', 205},
    {'a', 19},
    {'w', 289},
    {'l', 1},
    {'w', 296},
    {'r', 1},
    {'w', 119},
    {'d', 1},
    {'w', 183},
    {'a', 19},
    {'w', 186},
    {'a', 25},
    {'w', 356},
    {'w', 378},
    {'b', 39},
    {'w', 115},
    {'b', 47},
    {'w', 177},
    {'b', 32},
    {'w', 108},
    {'b', 29},
    {'w', 242},
    {'d', 3},
    {'w', 60},
    {'l', 4},
    {'w', 55},
    {'l', 1},
    {'w', 43},
    {'d', 6},
    --mapChange
    {'w', 278},
    {'l', 30}, -- go to department store
    {'w', 70},
    {'d', 5},
    {'w', 25},
    {'l', 5},
    {'w', 41},
    {'u', 2},
    --mapChange
    {'u', 1},
    {'w', 200},
    --mapChange
    {'u', 9}, -- go into elevator
    {'l', 5},
    {'u', 5},
    --mapChange
    {'w', 200},
    {'u', 2}, -- go to buttons
    {'l', 3},
    {'u', 1},
    {'a', 15}, -- select floor
    {'w', 247},
    {'d', 3},
    {'w', 60},
    {'a', 18},
    {'w', 100},
    {'r', 3},
    {'d', 4}, -- get out of elevator
    {'w', 200},
    {'l', 4}, -- go to counter
    {'d', 10},
    {'w', 201},
    {'a', 11}, -- buy thunderstone
    {'w', 185},
    {'a', 13},
    {'w', 277},
    {'d', 1},
    {'d', 1},
    {'d', 1},
    {'w', 60},
    {'a', 17},
    {'w', 146},
    {'a', 15},
    {'w', 127},
    {'a', 13},
    {'w', 120},
    {'a', 13},
    {'w', 93},
    {'b', 14},
    {'w', 108},
    {'b', 14},
    {'w', 107},
    {'b', 13}, -- thunderstone purchased
    {'w', 60},
    {'u', 9}, -- get back to elevator
    {'w', 183},
    {'r', 4},
    {'w', 42},
    {'u', 3},
    --mapChange
    {'w', 180},
    {'u', 2}, -- go to panel
    {'l', 3},
    {'u', 1},
    {'a', 15}, -- select 1F
    {'w', 60},
    {'d', 3},
    {'a', 15},
    {'w', 180},
    {'r', 3}, -- get out of elevator
    {'d', 4},
    {'w', 180},
    {'d', 5},
    {'r', 5},
    {'d', 10},
    --mapChange
    {'w', 180},
    {'w', 205},
    {'r', 27},
    {'d', 8},
    {'d', 3},
    {'l', 11},
    {'d', 6},
    {'r', 11},
    {'l', 5},
    {'u', 3},
    --mapChange
    {'w', 180}, -- go into resturant
    {'u', 7},
    {'l', 5},
    {'a', 31}, -- get coin case
    {'w', 48},
    {'a', 31},
    {'w', 55},
    {'a', 39},
    {'w', 43},
    {'a', 37},
    {'w', 65},
    {'a', 33},
    {'w', 61},
    {'b', 43},
    {'w', 28},
    {'b', 28},
    {'b', 27},
    {'b', 20},
    {'b', 22}, -- coin case acquired
    {'w', 38},
    {'r', 4}, -- leave resturant
    {'d', 8},
    {'r', 2},
    --mapChange
    {'d', 2},
    {'w', 180}, -- go to casino
    {'l', 7},
    {'u', 6},
    {'r', 11},
    {'u', 4},
    {'l', 8},
    {'u', 2},
    --mapChange
    {'w', 180}, -- breakpoint - to rocket
    {'w', 251},
    {'s', 13}, -- move gyarados pulse and position
    {'w', 105},
    {'u', 1},
    {'w', 175},
    {'a', 13},
    {'w', 193},
    {'r', 1},
    {'w', 59},
    {'d', 1},
    {'w', 60},
    {'a', 17},
    {'w', 63},
    {'a', 16},
    {'w', 246},
    {'r', 1},
    {'w', 267},
    {'u', 1},
    {'w', 153},
    {'d', 1},
    {'w', 130},
    {'r', 1},
    {'w', 256},
    {'a', 21},
    {'w', 265},
    {'d', 1},
    {'w', 24},
    {'r', 1},
    {'w', 64},
    {'d', 1},
    {'w', 121},
    {'r', 1},
    {'w', 65},
    {'d', 1},
    {'w', 231},
    {'a', 20},
    {'w', 294},
    {'u', 1},
    {'w', 34},
    {'r', 1},
    {'w', 42},
    {'u', 1},
    {'w', 27},
    {'r', 1},
    {'w', 45},
    {'u', 1},
    {'r', 1},
    {'w', 93},
    {'a', 21},
    {'w', 558},
    {'b', 22},
    {'w', 166},
    {'b', 20},
    {'w', 344},
    {'d', 1},
    {'w', 201},
    {'a', 14},
    {'w', 235},
    {'l', 1},
    {'w', 129},
    {'a', 13},
    {'w', 607},
    {'b', 19},
    {'w', 202},
    {'b', 17}, -- done with gyarados, menu on pokemon
    {'w', 60},
    {'w', 159},
    {'u', 9},
    {'r', 3},
    {'u', 2}, -- go to rocket trainer
    {'w', 155}, -- start battle
    {'a', 12},
    {'w', 129},
    {'b', 17},
    {'w', 408},
    {'a', 16},
    {'w', 679}, -- wait for start w/ intimidate
    {'a', 16},
    {'use_move', 2}, -- use water pulse twice
    {'press_b', 7}, -- gyarados at 154/172 health due to quick attack
    {'u', 2},
    {'a', 15},
    {'press_b', 4},
    {'r', 6},
    {'w', 540}, -- enter rocket hideout
    {'r', 4},
    {'d', 7},
    {'r', 8},
    {'d', 5},
    {'w', 190},
    {'a', 17},
    {'w', 424},
    {'a', 14},
    {'w', 719},
    {'a', 18},
    {'use_move', 1}, -- kill drowzee
    {'press_b', 4},
    {'use_move', 1},
    {'w', 179},
    {'u', 3},
    {'l', 10},
    {'d', 8},
    {'r', 2},
    {'a', 4},
    {'w', 77},
    {'a', 18},
    {'w', 87},
    {'a', 27},
    {'w', 110},
    {'b', 100},
    {'l', 3},
    {'u', 9},
    {'l', 5},
    {'w', 219},
    {'b', 23},
    {'w', 410},
    {'b', 24},
    {'w', 694},
    {'a', 13},
    {'use_move', 2}, -- quick attack twice, 118/172
    {'press_b', 4},
    {'w', 60}, -- breakpoint
    {'r', 8},
    {'u', 8},
    --mapChange
    {'r', 3}, -- down stairs
    {'w', 174},
    {'d', 6},
    {'l', 9},
    {'u', 1},
    {'w', 112},
    {'a', 14},
    {'w', 27},
    {'a', 13},
    {'w', 518},
    {'b', 16},
    {'w', 673},
    {'b', 23},
    {'w', 686},
    {'b', 15},
    {'w', 196},
    {'a', 9},
    {'use_move', 5}, -- 100/172 defeat trainer
    {'press_b', 5},
    {'u', 3},
    {'w', 60}, -- to puzzle
    {'r', 2},
    {'u', 6},
    {'r', 2},
    {'w', 180},
    {'l', 7},
    {'d', 6},
    {'l', 7},
    {'w', 61},
    {'d', 3},
    {'w', 46},
    {'r', 3},
    {'w', 120},
    {'d', 2},
    {'w', 90},
    {'r', 2},
    {'w', 305},
    {'r', 2},
    {'w', 186},
    {'r', 3},
    {'u', 1},
    {'w', 58},
    {'a', 21},
    {'w', 88},
    {'b', 26},
    {'w', 132},
    {'b', 17},
    {'w', 60},
    {'l', 5},
    {'w', 40},
    {'u', 5},
    {'w', 76},
    {'r', 5},
    {'w', 23},
    {'u', 3},
    {'w', 26},
    {'l', 8},
    {'w', 70},
    {'d', 3},
    {'l', 2},
    {'w', 60},
    {'d', 3},
    {'w', 90},
    {'l', 3},
    {'d', 4},
    {'l', 4},
    {'d', 3},
    {'r', 3},
    {'w', 120},
    {'l', 3},
    {'d', 6},
    {'r', 10},
    {'u', 1},
    {'w', 15},
    {'a', 15},
    {'w', 180},
    {'press_b', 2},
    {'u', 5},
    {'r', 3},
    {'u', 3},
    {'l', 3}, -- down the steps
    {'w', 180},
    {'l', 7}, -- go grab max ether
    {'u', 1},
    {'w', 15},
    {'a', 4},
    {'w', 200},
    {'b', 16},
    {'w', 60},
    {'r', 6},
    {'u', 11},
    {'l', 4},
    {'u', 4},
    {'l', 2},
    {'w', 73},
    {'a', 23}, -- start battle
    {'w', 142},
    {'b', 29},
    {'w', 455},
    {'b', 19},
    {'w', 700},
    {'a', 11},
    {'use_move', 2},
    {'press_b', 5},
    {'d', 2}, -- go get key
    {'l', 3},
    {'u', 1},
    {'w', 15},
    {'a', 15},
    {'w', 180},
    {'b', 60},
    {'b', 15},
    {'r', 4},
    {'d', 3},
    {'r', 4},
    {'d', 11},
    {'r', 4}, -- back up one floor
    {'w', 180},
    {'w', 243},
    {'d', 4},
    {'w', 49},
    {'l', 6},
    {'w', 81},
    {'u', 9}, -- exit to 2nd floor
    {'w', 172},
    {'l', 3},
    {'u', 5},
    {'w', 67},
    {'r', 5},
    {'u', 7},
    {'l', 11}, -- get nugget
    {'w', 30},
    {'a', 15},
    {'w', 200},
    {'b', 60},
    {'b', 60},
    {'r', 11},
    {'u', 2},
    {'r', 8},
    --mapChange
    {'w', 180},
    {'d', 6},
    {'l', 2},
    {'u', 2}, -- reset against rocket trainer
    {'w', 80}, -- puzzle spinner floor
    {'l', 4},
    {'u', 2},
    {'l', 2},
    {'w', 180},
    {'r', 2},
    {'d', 1},
    {'w', 15},
    {'a', 15},
    {'w', 180},
    {'b', 60},
    {'d', 2},
    {'r', 2}, 
    {'w', 60},
    {'r', 2},
    {'d', 4},
    {'l', 2},
    {'w', 30},
    {'r', 3},
    {'w', 60},
    {'l', 3},
    {'w', 60},
    {'r', 4},
    {'d', 3},
    {'l', 2},
    {'w', 90},
    {'r', 2},
    {'d', 2},
    {'w', 90}, -- finish puzzle
    {'r', 3},
    {'u', 5},
    {'r', 8},
    {'d', 3},
    {'r', 7},
    {'u', 2},
    {'w', 90}, -- go into elevator
    {'l', 3},
    {'u', 3},
    {'w', 15},
    {'a', 15}, -- choose floor
    {'w', 90},
    {'df', 15},
    {'a', 15},
    {'w', 180},
    {'d', 3},
    {'r', 3},
    {'d', 2},
    {'w', 240}, -- exit on 4th floor
    {'s', 14}, -- switch charizard to front
    {'w', 73},
    {'a', 15},
    {'w', 219},
    {'a', 21},
    {'w', 272},
    {'d', 1},
    {'w', 118},
    {'a', 20},
    {'w', 214},
    {'r', 1},
    {'w', 135},
    {'d', 1},
    {'w', 94},
    {'a', 15},
    {'w', 325},
    {'b', 23},
    {'w', 130},
    {'b', 20},
    {'w', 270}, -- done switching
    {'l', 4},
    {'w', 60},
    {'u', 11},
    {'w', 15},
    {'l', 1},
    {'w', 164},
    {'a', 18},
    {'w', 180},
    {'a', 12},
    {'w', 500},
    {'b', 13},
    {'w', 500},
    {'a', 13},
    {'rf', 15},
    {'use_move', 3},
    {'press_b', 4},
    {'r', 2},
    {'w', 30},
    {'a', 24},
    {'w', 173},
    {'b', 25},
    {'w', 423},
    {'b', 24},
    {'w', 750},
    {'a', 14},
    {'rf', 15},
    {'use_move', 3}, -- open gate to giovanni
    {'press_b', 4},
    {'w', 169},
    {'s', 15}, -- switch gyarados back to front
    {'w', 79},
    {'a', 18},
    {'w', 120},
    {'a', 17},
    {'w', 52},
    {'d', 2},
    {'w', 60},
    {'a', 20},
    {'w', 60},
    {'r', 1},
    {'w', 60},
    {'d', 1},
    {'w', 41},
    {'a', 15},
    {'w', 216},
    {'b', 25},
    {'w', 78},
    {'b', 24},
    {'w', 60},
    {'w', 180},
    {'u', 8},
    {'w', 77},
    {'l', 2},
    {'w', 22},
    {'u', 3},
    {'w', 22},
    {'r', 3},
    {'w', 31},
    {'u', 1},
    {'w', 213},
    {'a', 15},
    {'w', 148},
    {'b', 15},
    {'w', 158},
    {'b', 15},
    {'w', 193},
    {'b', 14},
    {'w', 154},
    {'b', 14},
    {'w', 164},
    {'b', 16},
    {'w', 486}, -- fight giovanni
    {'b', 17},
    {'w', 807},
    {'a', 13},
    {'use_move', 1},
    {'a', 15},
    {'a', 15},
    {'w', 800},
    {'b', 60},
    {'b', 60},
    {'w', 60},
    {'b', 15},
    {'w', 90},
    {'a', 15},
    {'w', 90},
    {'r', 1},
    {'w', 15},
    {'d', 1},
    {'w', 15},
    {'a', 60},
    {'a', 60},
    {'w', 540},
    {'a', 15},
    {'rf', 15},
    {'use_move', 2}, --flamethrower twice in case we flinch
    {'press_b', 8},
    {'r', 1},
    {'w', 30},
    {'a', 12},
    {'w', 360},
    {'b', 15}, -- silph scope acquired
    -- rocketHide-3
    {'w', 308}, -- giovanni defeated
    {'l', 3}, -- go back to elevator
    {'w', 55},
    {'d', 20},
    {'w', 46},
    {'r', 4},
    {'w', 34},
    {'u', 2}, -- enter elevator
    --mapChange
    {'w', 274},
    {'u', 3},
    {'w', 92},
    {'l', 3},
    {'w', 40},
    {'u', 1},
    {'w', 118},
    {'a', 14},
    {'w', 275},
    {'u', 1},
    {'w', 53},
    {'u', 1},
    {'w', 73},
    {'a', 17},
    {'w', 358},
    {'d', 2},
    {'w', 45},
    {'r', 3},
    {'w', 30},
    {'d', 3},
    --mapChange
    {'w', 200},
    {'l', 3},
    {'d', 1},
    {'d', 1},
    {'l', 1},
    {'w', 16},
    {'a', 16},
    {'press_b', 5},
    {'w', 500},
    {'b', 60},
    {'w', 500},
    {'b', 60},
    {'w', 400},
    {'use_move', 2},
    {'press_b', 2},
    {'w', 60},
    {'l', 1},
    {'w', 30},
    {'u', 2},
    {'l', 2},
    {'u', 10},
    {'l', 3},
    {'u', 5},
    {'r', 4},
    {'u', 5},
    {'l', 9},
    {'u', 8},
    {'l', 4},
    {'w', 180},
    --mapChange
    -- rockethide-4
    {'w', 60}, -- pick up all stray coins
    {'l', 2},
    {'d', 1},
    {'w', 99},
    {'a', 17},
    {'w', 101},
    {'b', 17},
    {'w', 58},
    {'b', 20},
    {'w', 88},
    {'d', 3},
    {'w', 99},
    {'r', 2},
    {'w', 55},
    {'a', 16},
    {'w', 70},
    {'b', 27},
    {'w', 64},
    {'b', 23},
    {'w', 38},
    {'r', 2},
    {'w', 31},
    {'a', 19},
    {'w', 239},
    {'b', 20},
    {'w', 165},
    {'l', 2},
    {'w', 57},
    {'d', 7},
    {'w', 50},
    {'d', 1},
    {'w', 42},
    {'a', 16},
    {'w', 93},
    {'b', 21},
    {'w', 112},
    {'b', 23},
    {'w', 51},
    {'l', 2},
    {'w', 33},
    {'a', 19},
    {'w', 15},
    {'l', 1},
    {'w', 31},
    {'a', 18},
    {'w', 97},
    {'b', 24},
    {'w', 82},
    {'b', 23},
    {'w', 22},
    {'l', 5},
    {'w', 25},
    {'a', 24},
    {'w', 56},
    {'l', 1},
    {'a', 19},
    {'w', 245},
    {'b', 31},
    {'w', 70},
    {'l', 4},
    {'w', 54},
    {'l', 1},
    {'w', 41},
    {'u', 1},
    {'w', 44},
    {'a', 16},
    {'w', 115},
    {'b', 17},
    {'w', 99},
    {'b', 14},
    {'w', 24},
    {'r', 2},
    {'u', 4},
    {'w', 40},
    {'a', 19},
    {'w', 241},
    {'b', 23},
    {'w', 44},
    {'u', 5},
    {'w', 77},
    {'l', 1},
    {'w', 48},
    {'a', 13},
    {'w', 202},
    {'b', 16},
    {'w', 33},
    {'r', 7},
    {'w', 28},
    {'d', 1},
    {'w', 22},
    {'a', 8},
    {'w', 63},
    {'a', 14},
    {'w', 45},
    {'l', 2},
    {'w', 30},
    {'d', 1},
    {'w', 40},
    {'a', 9},
    {'w', 309},
    {'b', 15},
    {'w', 51},
    {'r', 2},
    {'w', 37},
    {'a', 19},
    {'w', 365},
    {'b', 17}, -- finish picking up coins
    {'w', 60},
    {'w', 60},
    {'l', 4}, -- go buy coins for thunderbolt
    {'w', 32},
    {'u', 1},
    {'w', 46},
    {'a', 16},
    {'w', 140},
    {'a', 21},
    {'w', 210},
    {'d', 1},
    {'w', 66},
    {'a', 15},
    {'w', 156},
    {'b', 24},
    {'w', 87},
    {'a', 20},
    {'w', 85},
    {'a', 21},
    {'w', 113},
    {'d', 1},
    {'w', 41},
    {'a', 18},
    {'w', 139},
    {'b', 19},
    {'w', 64},
    {'a', 23},
    {'w', 75},
    {'a', 23},
    {'w', 104},
    {'d', 1},
    {'w', 86},
    {'a', 18},
    {'w', 91},
    {'b', 21},
    {'w', 85},
    {'a', 24},
    {'w', 78},
    {'a', 25},
    {'w', 103},
    {'d', 1},
    {'w', 29},
    {'a', 22},
    {'w', 75},
    {'b', 33},
    {'w', 107},
    {'a', 25},
    {'w', 82},
    {'a', 25},
    {'w', 88},
    {'d', 1},
    {'w', 53},
    {'a', 22},
    {'w', 86},
    {'b', 26},
    {'w', 54},
    {'a', 25},
    {'w', 76},
    {'a', 21},
    {'w', 86},
    {'d', 1},
    {'a', 18},
    {'w', 86},
    {'b', 27},
    {'w', 48},
    {'a', 26},
    {'w', 69},
    {'a', 24},
    {'w', 81},
    {'d', 1},
    {'a', 21},
    {'w', 59},
    {'b', 27},
        {'w', 48},
    {'a', 26},
    {'w', 69},
    {'a', 24},
    {'w', 81},
    {'d', 1},
    {'a', 21},
    {'w', 59},
    {'b', 27},
        {'w', 48},
    {'a', 26},
    {'w', 69},
    {'a', 24},
    {'w', 81},
    {'d', 1},
    {'a', 21},
    {'w', 59},
    {'b', 27},
    {'w', 54},
    {'a', 22},
    {'w', 65},
    {'a', 25},
    {'w', 79},
    {'d', 1},
    {'a', 21},
    {'w', 99},
    {'b', 23}, -- done buying coins
    {'w', 120},
    {'w', 219},
    {'d', 2},
    {'w', 27},
    {'r', 4},
    {'w', 24},
    {'d', 10}, -- out of casino
    --mapChange
    {'w', 180},
    {'r', 6},
    {'u', 3}, -- into prize room
    --mapChange
    {'w', 180},
    {'u', 5}, -- get thunderbolt
    {'w', 46},
    {'r', 3},
    {'w', 48},
    {'u', 1},
    {'w', 52},
    {'a', 18},
    {'w', 110},
    {'a', 21},
    {'w', 178},
    {'d', 1},
    {'w', 157},
    {'d', 1},
    {'w', 164},
    {'a', 13},
    {'w', 200},
    {'a', 17},
    {'w', 308},
    {'b', 15},
    {'w', 287},
    {'l', 3},
    {'w', 86},
    {'u', 1}, -- get abra
    {'w', 72},
    {'a', 15},
    {'w', 155},
    {'a', 13},
    {'w', 240},
    {'a', 16},
    {'w', 174},
    {'a', 13},
    {'w', 233},
    {'b', 23},
    {'w', 90},
    {'l', 3}, -- go get charcoal
    {'w', 46},
    {'u', 1},
    {'w', 153},
    {'a', 13},
    {'w', 184},
    {'a', 13},
    {'w', 262},
    {'d', 1},
    {'w', 60},
    {'d', 1},
    {'w', 60},
    {'a', 16},
    {'w', 134},
    {'a', 23},
    {'w', 233},
    {'b', 22}, -- charcoal bought
    {'w', 90},
    --rockethide-5
    {'r', 3}, -- out of prize room
    {'w', 40},
    {'d', 6},
    --mapChange
    {'w', 180},
    {'d', 2},
    {'r', 3},
    {'u', 7},
    {'l', 8},
    {'u', 2},
    {'l', 11},
    {'u', 4},
    {'r', 6},
    {'w', 21},
    {'u', 2}, -- into mansion
    --mapChange
    {'w', 201},
    {'u', 4}, -- go to old woman
    {'w', 59},
    {'l', 13},
    {'w', 26},
    {'u', 7},
    {'w', 33},
    {'r', 2},
    {'w', 67},
    {'r', 1},
    {'w', 42},
    {'d', 1},
    {'w', 78},
    {'a', 11}, -- get tea
    {'w', 117},
    {'a', 12},
    {'press_b', 7},
    {'w', 30},
    {'l', 3}, -- leave mansion
    {'d', 7},
    {'r', 13},
    {'d', 6},
    --mapChange
    {'w', 180},
    {'r', 19}, -- go to pokecenter
    {'u', 2},
    --mapChange
    {'w', 180},
    {'u', 6},
    {'w', 30},
    {'pokecenter_heal', 1},
    {'w', 30},
    {'d', 7},
    {'w', 180},
    {'r', 22},
    {'d', 6},
    {'l', 3},
    {'d', 4},
    {'r', 10}, -- into guard passway
    --mapChange
    {'w', 180},
    {'r', 6},
    {'w', 30},
    {'press_b', 15}, -- give tea to guy
    {'w', 30},
    {'d', 2},
    {'r', 7},
    {'w', 180}, -- enter saffron
    {'r', 8},
    {'u', 18},
    {'r', 20},
    {'u', 7}, -- into guard passway
    --mapChange
    {'w', 180},
    {'u', 9}, -- exit
    --mapChange
    {'w', 180},
    {'u', 4}, -- go to daycare
    {'r', 6},
    --mapChange
    {'u', 36},
    {'l', 6},
    {'d', 2},
    {'w', 209},
    {'s', 10}, -- apply repel
    {'w', 126},
    {'d', 1}, -- go to bag (we're on pokemon)
    {'w', 30},
    {'a', 15},
    {'w', 300},
    {'l', 3},
    {'d', 17},
    {'w', 60},
    {'u', 10},
    {'w', 60},
    {'a', 60}, 
    {'a', 60},
    {'w', 90},
    {'press_b', 6}, -- exit menu
    {'w', 60},
    --mapChange
    {'d', 30},
    {'w', 60},
    {'r', 3},
    {'d', 6},
    {'l', 4},
    {'u', 2},
    {'w', 180}, -- into daycare
    {'u', 3}, -- give him eevee
    {'w', 30},
    {'a', 18},
    {'w', 87},
    {'a', 21},
    {'w', 183},
    {'a', 20},
    {'w', 177},
    {'a', 19},
    {'w', 264},
    {'r', 1},
    {'w', 168},
    {'a', 16},
    {'w', 127},
    {'a', 15},
    {'w', 279},
    {'b', 25},
    {'w', 129},
    {'b', 22},
    {'w', 120},
    -- cerulean-1
    {'d', 4},
    --mapChange
    {'w', 180},
    {'d', 2},
    {'w', 30},
    {'r', 7},
    {'d', 5},
    {'r', 3},
    {'u', 2},
    --mapChange
    {'w', 180}, -- go into underground pass
    {'u', 2},
    {'r', 2},
    {'u', 3},
    {'l', 2},
    --mapChange
    {'w', 180},
    {'l', 1}, -- get into position
    {'run_daycare', 5500}, -- juice jolteon up
    --cerulean-2
    {'w', 180}, -- BREAKPOINT
    {'d', 2}, -- back to daycare
    {'r', 3},
    {'w', 180},
    {'d', 4},
    {'l', 2},
    {'d', 3},
    --mapChange
    {'w', 180},
    {'l', 3},
    --mapChange
    {'u', 40},
    {'l', 7},
    {'d', 3}, -- use repel
    {'w', 30},
    {'s', 12},
    {'w', 60},
    {'a', 16},
    {'w', 60},
    {'a', 15},
    {'w', 52},
    {'a', 15},
    {'w', 180},
    {'b', 14},
    {'w', 72},
    {'b', 18},
    {'w', 114},
    {'b', 13},
    {'w', 30},
    {'d', 30},
    {'w', 30},
    {'l', 4},
    {'d', 6},
    {'r', 4},
    {'u', 2},
    {'w', 180},
    {'u', 3},
    {'w', 30},
    {'a', 9}, -- get eevee back
    {'w', 132},
    {'a', 17},
    {'w', 213},
    {'a', 20},
    {'w', 169},
    {'a', 17},
    {'w', 167},
    {'a', 17},
    {'w', 167},
    {'a', 19},
    {'w', 121},
    {'a', 20}, -- end talking to daycare man
    {'w', 60},
    {'s', 12}, -- use thunderstone on eevee
    {'w', 121},
    {'a', 15},
    {'w', 180},
    {'d', 1},
    {'w', 43},
    {'l', 1},
    {'w', 67},
    {'d', 1},
    {'w', 53},
    {'l', 1},
    {'w', 55},
    {'d', 1},
    {'w', 119},
    {'a', 11},
    {'w', 130},
    {'a', 8},
    {'w', 180},
    {'r', 1},
    {'w', 50},
    {'d', 1},
    {'w', 68},
    {'r', 1},
    {'w', 192},
    {'d', 1},
    {'w', 167},
    {'a', 14},
    {'w', 506},
    {'b', 18},
    {'w', 1399}, -- eevee is evolving
    {'b', 27},
    {'w', 119},
    {'b', 24},
    {'w', 140},
    {'b', 25},
    {'w', 104},
    {'b', 23}, -- jolteon acquired
    {'w', 60},
    {'s', 10}, -- teach jolteon thunderbolt
    {'w', 98},
    {'a', 16},
    {'w', 344},
    {'r', 1},
    {'w', 338},
    {'a', 12},
    {'w', 166},
    {'a', 11},
    {'w', 360},
    {'d', 1},
    {'w', 180},
    {'a', 16},
    {'w', 92},
    {'a', 10},
    {'w', 219},
    {'a', 11},
    {'w', 149},
    {'a', 9},
    {'w', 188},
    {'a', 11},
    {'w', 199},
    {'a', 10},
    {'w', 214},
    {'a', 10},
    {'w', 614},
    {'r', 1},
    {'w', 75},
    {'d', 1},
    {'w', 57},
    {'r', 1},
    {'w', 48},
    {'d', 1},
    {'w', 113},
    {'r', 1},
    {'w', 51},
    {'d', 1},
    {'w', 126},
    {'a', 21},
    {'w', 316},
    {'a', 19},
    {'w', 155},
    {'a', 19},
    {'w', 151},
    {'a', 28},
    {'w', 125},
    {'a', 29},
    {'w', 484},
    {'b', 34},
    {'w', 104},
    {'b', 30},
    {'w', 117},
    {'b', 32}, -- done teaching thunderbolt
    {'w', 168},
    {'s', 15},  -- move thunderbolt to pos 1
    {'w', 123},
    {'u', 1},
    {'w', 45},
    {'a', 9},
    {'w', 267},
    {'r', 1},
    {'w', 106},
    {'d', 1},
    {'w', 99},
    {'r', 1},
    {'w', 188},
    {'d', 1},
    {'w', 152},
    {'a', 13},
    {'w', 226},
    {'a', 12},
    {'w', 477},
    {'r', 1},
    {'w', 214},
    {'d', 1},
    {'w', 129},
    {'r', 1},
    {'w', 293},
    {'a', 24},
    {'w', 301},
    {'u', 1},
    {'w', 228},
    {'r', 1},
    {'w', 43},
    {'u', 1},
    {'w', 184},
    {'a', 18},
    {'w', 340},
    {'d', 1},
    {'w', 58},
    {'r', 1},
    {'w', 229},
    {'a', 19},
    {'w', 383},
    {'b', 23},
    {'w', 87},
    {'b', 27},
    {'w', 71},
    {'b', 27},
    {'w', 73},
    {'b', 32},
    {'w', 70},
    {'b', 43}, -- done moving thunderbolt
    -- cerulean 3
    {'w', 60},
    {'s', 13}, -- move jolteon to front of party
    {'w', 103},
    {'a', 15},
    {'w', 150},
    {'l', 1},
    {'w', 60},
    {'r', 1},
    {'w', 60},
    {'d', 1},
    {'w', 60},
    {'r', 1},
    {'w', 58},
    {'d', 1},
    {'w', 60},
    {'a', 16},
    {'w', 60},
    {'d', 1},
    {'w', 60},
    {'a', 23},
    {'w', 75},
    {'l', 1},
    {'w', 106},
    {'a', 21},
    {'w', 177},
    {'b', 26},
    {'w', 83},
    {'b', 22}, -- done moving
    {'w', 40}, -- go back to lavender
    {'d', 4},
    {'w', 240},
    {'r', 2},
    {'d', 2},
    {'w', 60},
    {'d', 5},
    {'w', 180},
    {'d', 9}, -- out into saffron
    {'w', 180},
    {'d', 9},
    {'r', 19},
    -- fix (crashed into rocket npc)
    {'d', 9},
    {'l', 14},
    {'d', 3},
    {'r', 2},
    {'w', 120},
    {'press_b', 4},
    {'r', 12},
    {'d', 3},
    {'r', 8},
    {'w', 180},
    {'r', 13}, -- out to route 7
    --mapChange
    {'w', 180},
    {'u', 3}, -- go to lavender 
    {'w', 30},
    {'r', 12},
    {'d', 7},
    {'r', 9},
    {'u', 13},
    {'r', 30},
    {'d', 13},
    {'r', 7},
    {'d', 2},
    {'r', 4},
    {'u', 5},
    --mapChange
    {'r', 15},
    {'d', 3},
    {'r', 8},
    {'u', 6},
    {'u', 1},
    {'r', 6},
    {'u', 3}, -- into pokemon tower
    --mapChange
    {'w', 540},
    -- lavender-1
    {'r', 2},
    {'w', 38},
    {'u', 3},
    {'w', 44},
    {'r', 3},
    {'w', 32},
    {'u', 7},
    {'w', 32},
    {'r', 5},
    {'w', 24},
    {'u', 2},
    {'w', 60},
    {'r', 2}, -- up stairs to first floor
    --mapChange
    {'w', 216},
    {'s', 11}, -- use repel (and setup future repels)
    {'w', 296},
    {'d', 1},
    {'w', 116},
    {'a', 14},
    {'w', 223},
    {'l', 1},
    {'w', 209},
    {'u', 1},
    {'u', 1},
    {'u', 1},
    {'w', 58},
    {'a', 17},
    {'w', 116},
    {'a', 13},
    {'w', 183},
    {'b', 22},
    {'w', 52},
    {'b', 22},
    {'w', 71},
    {'b', 27}, -- end menu
    {'w', 60},
    {'u', 6}, -- goto rival
    {'l', 2},
    {'w', 180},
    {'b', 11},
    {'w', 153},
    {'b', 11},
    {'w', 127},
    {'b', 13},
    {'w', 152},
    {'b', 19},
    {'w', 452},
    {'b', 21},
    {'w', 444},
    {'use_move', 5}, -- defeat rival
    {'press_b', 6},
    {'w', 60},
    {'l', 8},
    {'d', 2},
    {'l', 6},
    {'d', 5},
    {'l', 2}, -- up one floor
    --mapChange
    {'w', 180},
    {'d', 5},
    {'r', 6},
    {'u', 3},
    {'w', 228},
    {'b', 11},
    {'w', 442},
    {'b', 15},
    {'w', 483},
    {'a', 19},
    {'w', 47},
    {'r', 1},
    {'w', 33},
    {'use_move', 1}, -- defeat ghost trainer
    {'press_b', 5},
    {'d', 4}, -- go to next trainer
    {'r', 2},
    {'w', 232},
    {'b', 16},
    {'w', 467},
    {'b', 17},
    {'w', 495},
    {'a', 10},
    {'w', 68},
    {'r', 1},
    {'use_move', 1},
    {'press_b', 5}, -- defeat next ghost trainer
    {'r', 5},
    {'u', 2},
    {'r', 3},
    {'u', 5},
    {'r', 3}, -- up another floor
    -- mapChange
    {'w', 180},
    {'l', 2}, -- goto next trainer
    {'w', 232},
    {'b', 14},
    {'w', 445},
    {'b', 14},
    {'w', 448},
    {'a', 18},
    {'r', 1},
    {'use_move', 2},
    {'press_b', 4},
    {'l', 3},
    {'w', 27},
    {'d', 2},
    {'w', 25},
    {'l', 3},
    {'w', 123},
    {'a', 14},
    {'w', 194},
    {'b', 16},
    {'w', 62},
    {'r', 3},
    {'w', 36},
    {'u', 6},
    {'w', 60},
    {'l', 5},
    {'w', 22},
    {'u', 4},
    {'w', 31},
    {'l', 5},
    {'w', 23},
    {'d', 2},
    {'w', 23},
    {'l', 3},
    {'w', 37},
    {'d', 7},
    {'w', 159},
    {'d', 2},
    {'w', 156},
    {'b', 19},
    {'w', 434},
    {'b', 21},
    {'w', 437},
    {'a', 22},
    {'w', 32},
    {'r', 1},
    {'use_move', 1},
    {'press_b', 4},
    {'u', 3},
    {'l', 3},
    {'w', 180}, -- up to next floor
    {'u', 5},
    {'w', 37},
    {'r', 7},
    {'w', 39},
    {'u', 2},
    {'w', 30},
    {'r', 2},
    {'u', 1},
    {'a', 13},
    {'w', 85},
    {'a', 17},
    {'w', 481},
    {'b', 24},
    {'w', 400},
    {'a', 12},
    {'w', 38},
    {'r', 1},
    {'use_move', 1},
    {'press_b', 4},
    {'r', 3},
    {'d', 2},
    {'w', 30},
    {'s', 15}, -- apply repel
    {'w', 30},
    {'a', 12},
    {'w', 80},
    {'a', 13},
    {'w', 30},
    {'a', 12},
    {'w', 90},
    {'b', 14},
    {'w', 61},
    {'b', 17},
    {'w', 82},
    {'b', 14},
    {'w', 60},
    {'d', 1},
    {'s', 15}, -- apply repel
    {'w', 30},
    {'a', 12},
    {'w', 80},
    {'a', 13},
    {'w', 30},
    {'a', 12},
    {'w', 90},
    {'b', 14},
    {'w', 61},
    {'b', 17},
    {'w', 82},
    {'b', 14},
    {'w', 60},
    {'d', 2},
    {'w', 25},
    {'l', 2},
    {'w', 149},
    {'b', 21},
    {'w', 66},
    {'b', 18},
    {'w', 64},
    {'r', 3},
    {'w', 51},
    {'u', 3},
    {'w', 46},
    {'r', 3},
    {'w', 186},
    {'b', 22},
    {'w', 412},
    {'b', 24},
    {'w', 424},
    {'a', 12},
    {'w', 42},
    {'r', 1},
    {'use_move', 1},
    {'press_b', 3},
    {'u', 2},
    {'w', 39},
    {'r', 3},
    {'w', 45},
    {'d', 5},
    {'w', 46},
    {'r', 2},
    --mapChange
    {'w', 180}, -- up another floor
    {'l', 2},
    {'w', 207},
    {'a', 20}, -- fight trainer
    {'w', 428},
    {'b', 25},
    {'w', 463},
    {'a', 21},
    {'r', 1},
    {'use_move', 3},
    {'press_b', 4},
    {'u', 5},
    {'w', 225},
    {'b', 13}, -- fight trainer
    {'w', 420},
    {'b', 22},
    {'w', 390},
    {'a', 15},
    {'w', 26},
    {'r', 1},
    {'use_move', 1},
    {'press_b', 4},
    {'u', 3}, -- to next trainer
    {'l', 6},
    {'d', 4},
    {'l', 2},
    {'w', 200},
    {'b', 20}, -- fight trainer
    {'w', 431},
    {'b', 25},
    {'w', 495},
    {'a', 18},
    {'w', 33},
    {'r', 1},
    {'use_move', 1},
    {'press_b', 4},
    {'l', 4},
    {'d', 8},
    {'w', 31},
    {'a', 15},
    {'w', 186},
    {'b', 26},
    {'w', 54},
    {'u', 3},
    {'w', 44},
    {'r', 7},
    {'w', 42},
    {'d', 4},
    {'w', 219},
    {'b', 16}, -- fight marowak
    {'w', 406},
    {'b', 21},
    {'w', 381},
    {'b', 29},
    {'w', 346},
    {'a', 18},
    {'w', 117},
    {'r', 1}, 
    {'use_move', 1},
    {'press_b', 5},
    {'d', 1},
    {'l', 2}, -- up another floor
    {'w', 180},
    {'u', 7},
    {'w', 200},
    {'b', 15},
    {'w', 380},
    {'b', 18},
    {'w', 400},
    {'use_move', 3},
    {'press_b', 5},
    {'u', 2},
    {'w', 217},
    {'a', 20},
    {'w', 163},
    {'b', 24},
    {'w', 147},
    {'b', 22},
    {'w', 403},
    {'b', 23},
    {'w', 427},
    {'use_move', 2},
    {'press_b', 5},
    {'u', 2},
    {'w', 185},
    {'b', 27},
    {'w', 451},
    {'b', 23},
    {'w', 438},
    {'use_move', 4},
    {'press_b', 5},
    {'u', 1},
    {'w', 60},
    {'a', 19}, -- talk to mr. fuji
    {'w', 132},
    {'b', 25},
    {'w', 157},
    {'b', 23},
    {'w', 114},
    {'b', 28},
    {'w', 209},
    {'b', 20},
    {'w', 112},
    {'b', 26},
    {'w', 227},
    {'b', 22}, -- back to fuji's house
    --mapChange
    {'w', 200},
    {'w', 233},
    {'u', 4},
    {'w', 40},
    {'l', 1},
    {'w', 40},
    {'a', 12}, -- talk to fuji
    {'w', 140},
    {'b', 20},
    {'w', 105},
    {'b', 31},
    {'w', 74},
    {'b', 35},
    {'w', 67},
    {'b', 46},
    {'w', 52},
    {'b', 40},
    {'w', 142},
    {'b', 38},
    {'w', 51},
    {'b', 45},
    {'w', 51},
    {'b', 42}, -- pokeflute acquired 
    {'w', 60},
    {'d', 6},
    {'w', 180},
    -- lavender-2
    {'w', 60},
    {'l', 10},
    {'u', 3},
    --mapChange
    {'l', 11}, -- into route 8
{'d', 6},
{'w', 45},
{'l', 4},
{'w', 27},
{'u', 2},
{'w', 55},
{'l', 4},
{'b', 60},
{'b', 60},
{'l', 2},
{'u', 13},
{'l', 30},
{'w', 26},
{'d', 13},
{'w', 29},
{'l', 9},
{'w', 27},
{'u', 7},
{'w', 23},
{'l', 11},
{'w', 27},
{'d', 3},
{'l', 3},
--mapChange
{'w', 180},
{'l', 11},
{'w', 180},
{'l', 6}, -- go to pokecenter
{'d', 14},
{'l', 29}, 
{'w', 36},
{'u', 3}, -- into center
--mapChange
{'w', 200},
{'u', 5},
{'pokecenter_heal',1},
{'d', 6},
{'w', 180},
{'l', 8},
{'u', 8},
{'r', 17},
{'u', 4}, -- enter silph co
--mapChange
{'w', 360},
{'u', 15}, -- go to elevator
{'r', 15},
{'u', 3}, -- into elevator
--mapChange
{'w', 180},
{'u', 2},
{'l', 3},
{'u', 1},
{'w', 30},
{'a', 15},
{'w', 90},
{'u', 8}, -- go to 9th floor
{'w', 30},
{'a', 18},
{'w', 240}, -- wait for elevator
{'r', 3},
{'d', 4}, -- exit elevator
{'w', 180}, 
{'r', 7},
{'d', 15},
{'l', 5},
{'u', 14}, -- wait for scientist to notice us
{'a', 60},
{'w', 90},
{'a', 60}, -- battle scientist
{'b', 100},
{'w', 540},
{'b', 60},
{'w', 400},
{'b', 60},
{'w', 400},
{'b', 60},
{'use_move', 3},
{'press_b', 5},
{'l', 3},
{'w', 30},
{'u', 10}, -- go past crates
{'w', 30},
    {'l', 6},
    {'d', 5},
    {'r', 3}, -- warp to floor 5
    {'w', 180},
    --mapChange
    {'d', 2},
    {'l', 1},
    {'a', 15}, -- fight rocket trainer
    {'w', 90},
    {'b', 10},
    {'w', 450},
    {'b', 16},
    {'w', 640},
    {'use_move', 1}, -- kill arbok
    {'press_b', 4},
    {'r', 13}, -- go get card key
    {'w', 30},
    {'a', 16},
    {'w', 240},
    {'b', 16},
    {'l', 12},
    {'u', 2}, -- warp back to 9f
    {'w', 180},
    {'l', 3},
    {'u', 5},
    {'r', 8},
    {'d', 5},
    {'r', 4},
    {'u', 15},
    {'l', 7},
    {'u', 2}, -- into elevator
    --mapChange
    {'w', 180},
    {'u', 2},
    {'l', 3},
    {'u', 1},
    {'a', 9},
    {'w', 90},
    {'d', 6},
    {'w', 30},
    {'a', 15},
    {'w', 240}, -- elevator descends
    {'r', 3},
    {'d', 4},  -- out of elevator
    {'w', 180},
{'d', 5}, -- got battle rocket trainer
{'w', 308},
{'a', 18},
{'w', 460},
{'b', 18},
{'w', 538},
{'a', 20},
{'use_move', 3}, -- might get quick attacked down to 162 hp
{'press_b', 5}, -- finish battle, jolteon is lvl 88 now
--mapChange
{'d', 3},
{'w', 42},
{'l', 1},
{'w', 57},
{'a', 18}, -- use keycard on door
{'w', 167},
{'b', 25},
{'w', 60},
{'l', 4},
{'u', 3},
{'l', 6},
{'d', 5}, -- onto warp
--mapChange
{'w', 180},
{'d', 2},
{'l', 4}, --  battle with rival
{'w', 200},
{'b', 26},
{'w', 179},
{'b', 25},
{'w', 182},
{'b', 23},
{'w', 199},
{'b', 24},
{'w', 507},
{'b', 30},
{'w', 497},
{'a', 25},
{'use_move', 9}, -- pidgeot QA to 136
{'press_b', 6},

{'w', 165}, -- ether thunderbolt
{'s', 13},
{'w', 102},
{'a', 22},
{'w', 300},
{'d', 1},
{'w', 55},
{'d', 1},
{'w', 182},
{'a', 13},
{'w', 92},
{'a', 12},
{'w', 133},
{'a', 20},
{'w', 270},
{'a', 17},
{'w', 289},
{'a', 20},
{'press_b', 6},



    {'d', 2},
    {'l', 2},
    {'w', 37},
    {'a', 19}, -- get lapras
    {'w', 110},
    {'b', 35},
    {'w', 55},
    {'b', 37},
    {'w', 110},
    {'b', 31},
    {'w', 300},
    {'b', 23},
    {'w', 119},
    {'b', 28},
    {'w', 106},
    {'b', 28},
    {'w', 101},
    {'b', 27},
    {'w', 109},
    {'b', 30},
    {'w', 60},
    {'d', 2}, -- go to warp
    {'r', 5},
    {'w', 180},
    {'d', 10}, -- go to rocket trainer
    {'w', 171},
    {'b', 26},
    {'w', 453},
    {'b', 24},
    {'w', 404},
    {'b', 24},
    {'w', 404},
    {'a', 16},
    {'w', 42},
    {'r', 1},
    {'use_move', 3},
    {'press_b', 4},
    {'w', 196},
    {'l', 2}, -- go to giovanni
    {'w', 38},
    {'d', 6},
    {'w', 28},
    {'r', 5},
    {'w', 52},
    {'u', 2},
    {'w', 29},
    {'a', 20},
    {'w', 134},
    {'b', 27},
    {'w', 105},
    {'u', 3},
    {'w', 76},
    {'b', 31},
    {'w', 109},
    {'b', 37},
    {'w', 94},
    {'b', 32},
    {'w', 111},
    {'b', 22},
    {'w', 519},
    {'b', 24},
    {'w', 433}, -- begin giovanni fight
    -- start cycle
    {'a', 60},
    {'a', 60}, -- use thunderbolt, KO nidorino
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 60}, -- say yes to switching, send out charizard
    {'w', 180},
    {'rf', 15},
    {'a', 60},
    {'a', 60},
    {'w', 440}, -- wait for nidoqueen to come out
    {'a', 60},
    {'r', 1},
    {'a', 60}, -- use flamethrower, potential to burn or crit
    {'w', 900}, -- wait for moves/burn/paralysis
    -- if it crits or dies to burn or charizard is just that strong
    -- we get 1 text prompt for "nidoqueen died"
    -- then 1 more for "gained 1704 EXP"
    -- then 1 more for "about to use Rhyhorn"
    -- now it prompts us if we want to change pokemon
    {'d', 1}, -- down to "pokemon", nothing if nidoqueen died
    {'a', 15}, -- open menu, clears nidoqueen died prompt
    {'w', 60}, 
    {'d', 4}, -- move down to lapras
    {'a', 15},
    {'a', 15}, -- switch out lapras, clears the EXP text
    -- Nidoqueen MIGHT use tail whip, which wont KO abra
    {'w', 800}, -- let lapras get sent out
    -- lapras might get wacked and killed instantly 
    -- scenario 1: we're on "about to use Rhyhorn prompt"
    -- scenario 2: we're on "lapras fainted" prompt
    -- scenario 3: lapras is alive and we're on the fight menu
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #1
    -- scenario 1: we're on "do you want to switch poke" for rhyhorn
    -- scenario 2: we're on the poke select screen w/ lapras(FNT), jolt, char, snok, lapras
    -- scenario 3: lapras is alive and we're on the fight menu
    -- scenario 4: we're on "lapras fainted" prompt
    -- we can just use teleport 6 times in a row to guarantee death
    -- the poke select screen will eat static inputs
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #2
    -- scenario 1: we're on the poke select screen w/ char,      jolt, abra, snok, lapras
    -- scenario 2: we're on the poke select screen w/ lapras(FNT), jolt, char, snok, abra
    -- scenario 3: abra is alive and we're on the fight menu
    -- scenario 4: we're on "lapras fainted" prompt
    -- scenario 5: nidoqueen died to burn, and abra is about to level up
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #3
    -- scenario 1: we're on the poke select screen w/ char,      jolt, abra, snok, lapras
    -- scenario 2: we're on the poke select screen w/ abra(FNT), jolt, char, snok, lapras
    -- scenario 3: abra is alive and we're on the fight menu
    -- scenario 4: identical to 2
    -- scenario 5: we're going through level up prompts
    -- scenario 6: we're on "Abra fainted" prompt
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #4
    -- scenario 1: we're on the poke select screen w/ char,      jolt, abra, snok, lapras
    -- scenario 2: we're on the poke select screen w/ abra(FNT), jolt, char, snok, lapras
    -- scenario 3: abra is alive and we're on the fight menu
    -- scenario 4: identical to 2
    -- scenario 5: we're going through level up prompts
    -- scenario 6: identical to 2
    -- scenario 7: we're on the "Abra fainted" prompt (this will continue)
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #5
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #6
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- move #7 is guaranteed to kill faint abra
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #8 -- lapras will die for sure on move 16
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #9
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #10
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #11
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #12
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #13
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #14
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #15
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #16
    -- all of nidoqueens attacks have 100% accuracy
    -- scenario 1: still on poke select screen, waiting for rhydon
    -- scenario 2: on poke select screen, waiting to finish nidoqueen
    -- scenario 3: Abra Fainted
    -- scenario 4: identical to 2
    -- sceanrio 5: still going through levelup prompts
    -- scenario 6+: identical to 2
    -- scenario 5 and scenario 1 are outliers
    -- to deal with scenario 5, we can just spam A until
    -- we get to the poke select screen, then it's
    -- basically the same as scenario 1
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    -- now we have a dilemma, we need to switch gyarados out
    -- but we dont know what state the menu is in
    -- we can reach gyarados by clicking "down" 3 times
    -- but we're in a menu, either 
    -- Scenario 1: "Shift, Summary, Cancel" on charizard
    -- Scenario 2: "Charizard is already in battle"
    -- Scenario 3: "Lapras has no energy left to fight"
    -- Scenario 4: "Shift, Summary, Cancel" on Lapras
    -- Scenario 5: No Menu
    {'d', 3},
    {'a', 60},
    {'a', 60},
    -- Scenario 1: "Shift, Summary, Cancel" on charizard
    -- Scenario 2: "Shift, Summary, Cancel" on charizard
    -- Scenario 3: "Shift, Summary, Cancel" on abra
    -- Scenario 4: "Shift, Summary, Cancel" on abra
    -- Scenario 5: "Gyarados is switched in"
    {'w', 600}, -- wait for intimidate/switch in animation
    {'b', 60}, -- close menu in scenario 1-4
    {'d', 3},
    {'a', 60},
    {'a', 60},
    {'w', 600}, -- gyarados is switched in in all scenarios
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'u', 1}, -- reset to "fight" option in menu
    {'press_b', 12}, -- deal with scenario where nidoqueen died to burn after abra dies
    -- now there are only 2 possible scenarios
    -- Scenario 1: Gyarados is facing a weak nidoqueen
    -- Scenario 2: Gyarados is facing rhyhorn
    {'a', 60},
    {'a', 60}, -- use water pulse
    {'w', 600},
    -- Scenario 1: "Rhyhorn Fainted!"
    -- Scenario 2: "Nidoqueen Fainted!"
    -- gyarados can tank 1 crit from kangaskhan
    -- we can spam b because we want gyarados out in both scenarios
    {'press_b', 15},
    {'a', 60},
    {'a', 60},
    {'w', 800}, -- use water pulse
    -- Scenario 1: Kangaskhan and gyarados still alive
    -- Scenario 2: "Rhyhorn Fainted!"
    {'d', 1}, -- move to "Pokemon in Scenario 1"
    {'a', 100}, -- open menu
    {'a', 100},
    {'a', 100},
    {'a', 100},
    {'w', 180},
    -- Scenario 1: Pokemon Menu on Gyarados
    -- Scenario 2: Pokemon Menu on Gyarados
    -- perfect!  Now we can finish with jolteon thunderbolt
    {'r', 1}, 
    {'a', 60}, 
    {'a', 60}, 
    {'w', 800},
    {'use_move', 2}, -- thunderbolt twice to account for flinching
    {'press_b', 10}, -- done with fight, giovanni defeated
    -- silph-2
    -- -- -- -- -- - - - - - --
    {'d', 5},
    {'w', 30},
    {'press_b', 3},
    {'l', 10},
    {'w', 30},
    {'press_b', 4},
    {'l', 8}, -- up against the wall
    {'w', 30},
    {'poison_kill', 150}, -- kill lapras or charizard if they're poisoned
    {'press_b', 5},
    {'l', 20},
    {'w', 30},
    {'r', 6},
    {'u', 6},
    {'w', 90}, -- go get masterball
    {'u', 8},
    {'w', 30},
    {'r', 2},
    {'d', 2},
    {'r', 2},
    {'d', 2},
    {'r', 3},
    {'u', 1},
    {'w', 30},
    {'a', 19},
    {'press_b', 15}, -- masterball acquired
    {'w', 269},
    {'l', 4}, -- get out of silph co
    {'d', 9},
    {'l', 6},
    {'w', 27},
    {'u', 15},
    {'w', 32},
    {'r', 2},
    {'w', 24},
    {'d', 2},
    --mapChange
    {'w', 236},
    {'l', 4},
    {'w', 30},
    {'u', 5},
    {'w', 39},
    {'r', 4},
    --mapChange
    {'w', 222},
    {'u', 4},
    {'w', 39},
    {'r', 2},
    {'u', 2},
    {'w', 22},
    {'r', 4},
    {'w', 26},
    {'d', 1},
    {'r', 3},
    {'d', 4},
    {'r', 4},
    {'w', 29},
    {'u', 10},
    {'w', 24},
    {'u', 2}, -- into elevator
    --mapChange
    {'w', 180}, 
    {'u', 2},
    {'l', 3},
    {'u', 1},
    {'w', 30},
    {'a', 21}, -- go down elevator
    {'w', 90},
    {'d', 2},
    {'w', 30},
    {'a', 20},
    {'w', 180},
    {'r', 3},
    {'d', 4}, -- out of elevator
    {'w', 180}, 
    {'d', 3},
    {'r', 6},
    {'d', 12},
    {'l', 20},
    {'w', 25},
    {'d', 4}, -- leave this forsaken place
    --mapChange
    {'w', 180},
    {'d', 1},
    {'l', 18},
    {'d', 8},
    {'r', 9},
    {'u', 2}, -- into pokecenter
    --mapChange
    -- silph-3
    {'w', 240},
    {'u', 5},
    {'w', 30},
    {'pokecenter_heal', 1},
    {'w', 15},
    {'d', 6},
    {'w', 210},
    {'l', 10}, -- go to saffron gym
    {'u', 30},
    {'r', 22},
    {'d', 3},
    {'r', 3},
    {'d', 2},
    {'r', 9},
    {'u', 2}, -- enter gym
    --mapChange
    {'w', 180},
    {'r', 5}, -- solve warp puzzle
    {'w', 33},
    {'u', 4},
    {'w', 188},
    {'u', 3},
    {'w', 151},
    {'d', 4},
    {'w', 172},
    {'d', 3},
    {'w', 196},
    {'u', 4},
    {'w', 167},
    {'d', 4},
    {'w', 164},
    {'u', 4},
    {'w', 173},
    {'u', 3},
    {'w', 143},
    {'d', 4},
    {'w', 154},
    {'d', 3},
    {'w', 156},
    {'u', 4},
    {'w', 153},
    {'u', 3},
    {'w', 160},
    {'u', 3},
    {'w', 145},
    {'d', 4},
    {'w', 165},
    {'d', 3},
    {'w', 180},
    {'u', 2}, -- exit into sabrina's room
    {'w', 60},
    {'l', 4},
    {'w', 44},
    {'u', 2},
    {'w', 49},
    {'l', 2},
    {'w', 22},
    {'u', 2},
    {'w', 34},
    {'a', 22},
    {'w', 125},
    {'b', 43},
    {'w', 35},
    {'b', 51},
    {'w', 52},
    {'b', 56},
    {'w', 46},
    {'b', 52},
    {'w', 443},
    {'b', 55},
    {'w', 440},
    {'b', 40},
    {'use_move', 4},
    {'press_b', 16},
    {'w', 213}, -- leave gym
    {'d', 4},
    {'w', 22},
    {'r', 5},
    {'w', 145},
    {'u', 4},
    {'w', 138},
    {'d', 1},
    {'w', 23},
    {'u', 4},
    {'w', 146},
    {'d', 4},
    {'w', 141},
    {'d', 3},
    {'w', 145},
    {'d', 3},
    {'w', 167},
    {'u', 4},
    {'w', 152},
    {'u', 3},
    {'w', 144},
    {'d', 4},
    {'w', 156},
    {'d', 3},
    {'w', 166},
    {'u', 4},
    {'w', 151},
    {'d', 4},
    {'w', 148},
    {'u', 4},
    {'w', 185},
    {'u', 3},
    {'w', 144},
    {'d', 4},
    {'w', 180},
    {'d', 4},
    {'l', 4},
    {'d', 2},
    --mapChange
    {'w', 180},
    -- saffron-1

}

b = {
    {'d', 5},
    {'w', 30},
    {'press_b', 3},
    {'l', 10},
    {'w', 30},
    {'press_b', 4},
    {'l', 8}, -- up against the wall
    {'w', 30},
    {'poison_kill', 150}, -- kill lapras or charizard if they're poisoned
    {'press_b', 5},
    {'l', 20},
    {'w', 30},
    {'r', 6},
    {'u', 6},
    {'w', 90}, -- go get masterball
    {'u', 8},
    {'w', 30},
    {'r', 2},
    {'d', 2},
    {'r', 2},
    {'d', 2},
    {'r', 3},
    {'u', 1},
    {'w', 30},
    {'a', 19},
    {'press_b', 15}, -- masterball acquired
    {'w', 269},
    {'l', 4}, -- get out of silph co
    {'d', 9},
    {'l', 6},
    {'w', 27},
    {'u', 15},
    {'w', 32},
    {'r', 2},
    {'w', 24},
    {'d', 2},
    --mapChange
    {'w', 236},
    {'l', 4},
    {'w', 30},
    {'u', 5},
    {'w', 39},
    {'r', 4},
    --mapChange
    {'w', 222},
    {'u', 4},
    {'w', 39},
    {'r', 2},
    {'u', 2},
    {'w', 22},
    {'r', 4},
    {'w', 26},
    {'d', 1},
    {'r', 3},
    {'d', 4},
    {'r', 4},
    {'w', 29},
    {'u', 10},
    {'w', 24},
    {'u', 2}, -- into elevator
    --mapChange
    {'w', 180}, 
    {'u', 2},
    {'l', 3},
    {'u', 1},
    {'w', 30},
    {'a', 21}, -- go down elevator
    {'w', 90},
    {'d', 2},
    {'w', 30},
    {'a', 20},
    {'w', 180},
    {'r', 3},
    {'d', 4}, -- out of elevator
    {'w', 180}, 
    {'d', 3},
    {'r', 6},
    {'d', 12},
    {'l', 20},
    {'w', 25},
    {'d', 4}, -- leave this forsaken place
    --mapChange
    {'w', 180},
    {'d', 1},
    {'l', 18},
    {'d', 8},
    {'r', 9},
    {'u', 2}, -- into pokecenter
    --mapChange
    -- silph-3
    {'w', 240},
    {'u', 5},
    {'w', 30},
    {'pokecenter_heal', 1},
    {'w', 15},
    {'d', 6},
    {'w', 210},
    {'l', 10}, -- go to saffron gym
    {'u', 30},
    {'r', 22},
    {'d', 3},
    {'r', 3},
    {'d', 2},
    {'r', 9},
    {'u', 2}, -- enter gym
    --mapChange
    {'w', 180},
    {'r', 5}, -- solve warp puzzle
    {'w', 33},
    {'u', 4},
    {'w', 188},
    {'u', 3},
    {'w', 151},
    {'d', 4},
    {'w', 172},
    {'d', 3},
    {'w', 196},
    {'u', 4},
    {'w', 167},
    {'d', 4},
    {'w', 164},
    {'u', 4},
    {'w', 173},
    {'u', 3},
    {'w', 143},
    {'d', 4},
    {'w', 154},
    {'d', 3},
    {'w', 156},
    {'u', 4},
    {'w', 153},
    {'u', 3},
    {'w', 160},
    {'u', 3},
    {'w', 145},
    {'d', 4},
    {'w', 165},
    {'d', 3},
    {'w', 180},
    {'u', 2}, -- exit into sabrina's room
    {'w', 60},
    {'l', 4},
    {'w', 44},
    {'u', 2},
    {'w', 49},
    {'l', 2},
    {'w', 22},
    {'u', 2},
    {'w', 34},
    {'a', 22},
    {'w', 125},
    {'b', 43},
    {'w', 35},
    {'b', 51},
    {'w', 52},
    {'b', 56},
    {'w', 46},
    {'b', 52},
    {'w', 443},
    {'b', 55},
    {'w', 440},
    {'b', 40},
    {'use_move', 4},
    {'press_b', 16},
    {'w', 213}, -- leave gym
    {'d', 4},
    {'w', 22},
    {'r', 5},
    {'w', 145},
    {'u', 4},
    {'w', 138},
    {'d', 1},
    {'w', 23},
    {'u', 4},
    {'w', 146},
    {'d', 4},
    {'w', 141},
    {'d', 3},
    {'w', 145},
    {'d', 3},
    {'w', 167},
    {'u', 4},
    {'w', 152},
    {'u', 3},
    {'w', 144},
    {'d', 4},
    {'w', 156},
    {'d', 3},
    {'w', 166},
    {'u', 4},
    {'w', 151},
    {'d', 4},
    {'w', 148},
    {'u', 4},
    {'w', 185},
    {'u', 3},
    {'w', 144},
    {'d', 4},
    {'w', 180},
    {'d', 4},
    {'l', 4},
    {'d', 2},
    --mapChange
    {'w', 180},
    -- saffron-1
}


c = {
    -- {'a', 60},
    -- {'a', 60}, -- use thunderbolt, KO nidorino
    -- {'w', 480},
    -- {'b', 100},
    -- {'b', 100},
    -- {'b', 100},
    -- {'a', 60}, -- say yes to switching, send out charizard
    -- {'w', 180},
    -- {'rf', 15},
    -- {'a', 60},
    -- {'a', 60},
    -- {'w', 440}, -- wait for nidoqueen to come out
    -- {'a', 60},
    -- {'r', 1},
    {'a', 60}, -- use flamethrower, potential to burn or crit
    {'w', 900}, -- wait for moves/burn/paralysis
    -- if it crits or dies to burn or charizard is just that strong
    -- we get 1 text prompt for "nidoqueen died"
    -- then 1 more for "gained 1704 EXP"
    -- then 1 more for "about to use Rhyhorn"
    -- now it prompts us if we want to change pokemon
    {'d', 1}, -- down to "pokemon", nothing if nidoqueen died
    {'a', 15}, -- open menu, clears nidoqueen died prompt
    {'w', 60}, 
    {'d', 4}, -- move down to lapras
    {'a', 15},
    {'a', 15}, -- switch out lapras, clears the EXP text
    -- Nidoqueen MIGHT use tail whip, which wont KO abra
    {'w', 800}, -- let lapras get sent out
    -- lapras might get wacked and killed instantly 
    -- scenario 1: we're on "about to use Rhyhorn prompt"
    -- scenario 2: we're on "lapras fainted" prompt
    -- scenario 3: lapras is alive and we're on the fight menu
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #1
    -- scenario 1: we're on "do you want to switch poke" for rhyhorn
    -- scenario 2: we're on the poke select screen w/ lapras(FNT), jolt, char, snok, lapras
    -- scenario 3: lapras is alive and we're on the fight menu
    -- scenario 4: we're on "lapras fainted" prompt
    -- we can just use teleport 6 times in a row to guarantee death
    -- the poke select screen will eat static inputs
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #2
    -- scenario 1: we're on the poke select screen w/ char,      jolt, abra, snok, lapras
    -- scenario 2: we're on the poke select screen w/ lapras(FNT), jolt, char, snok, abra
    -- scenario 3: abra is alive and we're on the fight menu
    -- scenario 4: we're on "lapras fainted" prompt
    -- scenario 5: nidoqueen died to burn, and abra is about to level up
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #3
    -- scenario 1: we're on the poke select screen w/ char,      jolt, abra, snok, lapras
    -- scenario 2: we're on the poke select screen w/ abra(FNT), jolt, char, snok, lapras
    -- scenario 3: abra is alive and we're on the fight menu
    -- scenario 4: identical to 2
    -- scenario 5: we're going through level up prompts
    -- scenario 6: we're on "Abra fainted" prompt
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #4
    -- scenario 1: we're on the poke select screen w/ char,      jolt, abra, snok, lapras
    -- scenario 2: we're on the poke select screen w/ abra(FNT), jolt, char, snok, lapras
    -- scenario 3: abra is alive and we're on the fight menu
    -- scenario 4: identical to 2
    -- scenario 5: we're going through level up prompts
    -- scenario 6: identical to 2
    -- scenario 7: we're on the "Abra fainted" prompt (this will continue)
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #5
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- teleport/tail whip #6
    {'a', 15}, -- advances menus
    {'a', 15}, -- eaten outside of fight menu
    {'w', 800}, -- move #7 is guaranteed to kill faint abra
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #8 -- lapras will die for sure on move 16
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #9
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #10
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #11
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #12
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #13
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #14
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #15
    {'a', 15},
    {'a', 15},
    {'w', 800}, -- move #16
    -- all of nidoqueens attacks have 100% accuracy
    -- scenario 1: still on poke select screen, waiting for rhydon
    -- scenario 2: on poke select screen, waiting to finish nidoqueen
    -- scenario 3: Abra Fainted
    -- scenario 4: identical to 2
    -- sceanrio 5: still going through levelup prompts
    -- scenario 6+: identical to 2
    -- scenario 5 and scenario 1 are outliers
    -- to deal with scenario 5, we can just spam A until
    -- we get to the poke select screen, then it's
    -- basically the same as scenario 1
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    -- now we have a dilemma, we need to switch gyarados out
    -- but we dont know what state the menu is in
    -- we can reach gyarados by clicking "down" 3 times
    -- but we're in a menu, either 
    -- Scenario 1: "Shift, Summary, Cancel" on charizard
    -- Scenario 2: "Charizard is already in battle"
    -- Scenario 3: "Lapras has no energy left to fight"
    -- Scenario 4: "Shift, Summary, Cancel" on Lapras
    -- Scenario 5: No Menu
    {'d', 3},
    {'a', 60},
    {'a', 60},
    -- Scenario 1: "Shift, Summary, Cancel" on charizard
    -- Scenario 2: "Shift, Summary, Cancel" on charizard
    -- Scenario 3: "Shift, Summary, Cancel" on abra
    -- Scenario 4: "Shift, Summary, Cancel" on abra
    -- Scenario 5: "Gyarados is switched in"
    {'w', 600}, -- wait for intimidate/switch in animation
    {'b', 60}, -- close menu in scenario 1-4
    {'d', 3},
    {'a', 240},
    {'a', 60},
    {'w', 600}, -- gyarados is switched in in all scenarios
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'u', 1}, -- reset to "fight" option in menu
    {'press_b', 12}, -- deal with scenario where nidoqueen died to burn after abra dies
    -- now there are only 2 possible scenarios
    -- Scenario 1: Gyarados is facing a weak nidoqueen
    -- Scenario 2: Gyarados is facing rhyhorn
    {'a', 60},
    {'a', 60}, -- use water pulse
    {'w', 600},
    -- Scenario 1: "Rhyhorn Fainted!"
    -- Scenario 2: "Nidoqueen Fainted!"
    -- gyarados can tank 1 crit from kangaskhan
    -- we can spam b because we want gyarados out in both scenarios
    {'press_b', 15},
    {'a', 60},
    {'a', 60},
    {'w', 800}, -- use water pulse
    -- Scenario 1: Kangaskhan and gyarados still alive
    -- Scenario 2: "Rhyhorn Fainted!"
    {'d', 1}, -- move to "Pokemon in Scenario 1"
    {'a', 100}, -- open menu
    {'a', 100},
    {'a', 100},
    {'a', 100},
    {'w', 180},
    -- Scenario 1: Pokemon Menu on Gyarados
    -- Scenario 2: Pokemon Menu on Gyarados
    -- perfect!  Now we can finish with jolteon thunderbolt
    {'r', 1}, 
    {'a', 60}, 
    {'a', 60}, 
    {'w', 800},
    {'use_move', 2}, -- thunderbolt twice to account for flinching
    {'press_b', 10}, -- done with fight, giovanni defeated
    {'w', 300}
}


m.executeOrders(start5)  
local info = debug.getinfo(1, "S")
local folderName = info.what
local nextScript = num + 1 
savestate.save(string.format("./States/Gym%dFinished.State", num))
print(string.format("You beat Sabrina! Making savestate: '%s/States/Gym%dFinished.State'. To continue from here load the state and run %d.lua.", folderName, num, nextScript))