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

press_a = {
    {'a', 60},
}
press_b = {
    {'b', 60}
}
grass_cycle = {
    {'w', 15}, -- begin grass run cycle
    {'w', 540},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'s', 15},
    {'df', 10},
    {'rf', 10},
    {'s', 15},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 120},-- end grass run cycle
}

battle_setup = {
    {'w',500},
    {'a',5},
    {'w',240},
    {'a',60},
    {'w',240},
    {'a', 15},
    {'df', 15},
    {'rf', 15},
}
doug_cycle_1 = {
    {'d', 6}, -- start doug cycle
    {'w', 240},
    {'l', 5},
    {'u', 20},
    {'u', 20},
    {'l', 6},
    {'u', 8},
    {'r', 9},
    {'u', 9},
    {'l', 8},
    {'u', 5},
    {'w', 180},
    {'u', 10},
    {'w', 300}, -- enter viridian forest
    {'u', 1},
    {'r', 14},
    {'u', 18},
    {'r', 6},
    {'u', 16},
    {'a', 15},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 600},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240}, -- start fight
    {'a', 15},
    {'df', 10},
    {'a', 15},
    {'w', 480}, -- if we level up, it's happening here
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'a', 15},
    {'uf', 10},
    {'rf', 10},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'use_growl', 30}, -- lose battle, end up in center
}

doug_cycle_2 = {
    {'d', 6}, -- start doug cycle
    {'w', 240},
    {'l', 5},
    {'u', 20},
    {'u', 20},
    {'l', 6},
    {'u', 8},
    {'r', 9},
    {'u', 9},
    {'l', 8},
    {'u', 5},
    {'w', 180},
    {'u', 10},
    {'w', 300}, -- enter viridian forest
    {'u', 1},
    {'r', 14},
    {'u', 18},
    {'r', 6},
    {'u', 16},
    {'a', 15},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 600},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240}, -- start fight
    {'a', 15},
    {'df', 10},
    {'a', 15},
    {'w', 540}, -- if we level up, it's happening here
    {'b', 200},
    {'b', 200},
    {'b', 200},
    {'b', 60},
    {'b', 200},
    {'b', 200},
    {'b', 200},
    {'w', 120},
    {'df', 10},
    {'a', 60},
    {'w', 500},
    {'a', 60},
    {'w', 120},
    {'a', 120},
    {'b', 60},
    {'b', 60},
    {'b', 200},
    {'b', 60},
    {'b', 60},
    {'w', 200},
    {'uf', 10},
    {'a', 15},
    {'uf', 10},
    {'rf', 10},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'use_growl', 35}, -- lose battle, end up in center
}

doug_cycle_3 = {
    {'d', 6}, -- start doug cycle
    {'w', 240},
    {'l', 5},
    {'u', 20},
    {'u', 20},
    {'l', 6},
    {'u', 8},
    {'r', 9},
    {'u', 9},
    {'l', 8},
    {'u', 5},
    {'w', 180},
    {'u', 10},
    {'w', 300}, -- enter viridian forest
    {'u', 1},
    {'r', 14},
    {'u', 18},
    {'r', 6},
    {'u', 16},
    {'a', 15},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 600},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240}, -- start fight
    {'a', 15},
    {'df', 10},
    {'a', 15},
    {'w', 480}, -- if we level up, it's happening here
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'a', 15},
    {'uf', 10},
    {'rf', 10},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'use_growl', 36}, -- lose battle, end up in center
}

doug_cycle_4 = {
    {'d', 6}, -- start doug cycle
    {'w', 240},
    {'l', 5},
    {'u', 20},
    {'u', 20},
    {'l', 6},
    {'u', 8},
    {'r', 9},
    {'u', 9},
    {'l', 8},
    {'u', 5},
    {'w', 180},
    {'u', 10},
    {'w', 300}, -- enter viridian forest
    {'u', 1},
    {'r', 14},
    {'u', 18},
    {'r', 6},
    {'u', 16},
    {'a', 15},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 600},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240}, -- start fight
    {'a', 15},
    {'df', 10},
    {'a', 15},
    {'w', 480}, -- if we level up, it's happening here
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'a', 15},
    {'uf', 10},
    {'rf', 10},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'use_growl', 41}, -- lose battle, end up in center
}

doug_cycle_5 = {
    {'d', 6}, -- start doug cycle
    {'w', 240},
    {'l', 5},
    {'u', 20},
    {'u', 20},
    {'l', 6},
    {'u', 8},
    {'r', 9},
    {'u', 9},
    {'l', 8},
    {'u', 5},
    {'w', 180},
    {'u', 10},
    {'w', 300}, -- enter viridian forest
    {'u', 1},
    {'r', 14},
    {'u', 18},
    {'r', 6},
    {'u', 16},
    {'a', 15},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 600},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240}, -- start fight
    {'a', 15},
    {'df', 10},
    {'a', 15},
    {'w', 540}, -- if we level up, it's happening here
    {'b', 200},
    {'b', 200},
    {'b', 200},
    {'b', 60},
    {'b', 200},
    {'b', 200},
    {'b', 200},
    {'w', 120},
    {'rf', 20},
    {'a', 60}, -- make room for flamethrower
    {'w', 240},
    {'df', 20},
    {'df', 20},
    {'df', 20},
    {'a', 60},
    {'w', 120},
    {'a', 60},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 60},
    {'b', 60},
    {'b', 200},
    {'b', 60},
    {'b', 60},
    {'w', 200},
    {'lf', 20},
    {'a', 60},
    {'a', 60}, -- ember down the second weedle (omg)
    {'w', 540}, -- level up the level 5 version
    {'b', 200},
    {'b', 200},
    {'b', 200},
    {'b', 60},
    {'b', 200},
    {'b', 200},
    {'b', 200},
    {'w', 120},
    {'rf', 20},
    {'a', 60}, -- make room for flamethrower
    {'w', 240},
    {'df', 20},
    {'df', 20},
    {'df', 20},
    {'a', 60},
    {'w', 120},
    {'a', 60},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 60},
    {'b', 60},
    {'b', 200},
    {'b', 60},
    {'b', 60},
    {'w', 200},
    {'lf', 20},
    {'a', 60}, -- finish the battle
    {'a', 60},
    {'w', 540}, 
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'w', 2000}, -- charmander EVOLVES
    {'a', 60},
    {'w', 200}, -- doug cycle ends
}

use_growl = {
    {'a', 15},
    {'a', 15},
    {'w', 240},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
}
attack_down_ember = { -- for first battle with anthony
    {'a', 15}, -- scratch/ember 18
    {'s', 20},
    {'df', 10},
    {'s', 20},
    {'a', 15},
    {'w', 300},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'b', 60},
}


start1 ={
    {'w', 350}, -- start the rom
    {'a', 15},
    {'w', 350},
    {'s', 15},
    {'w', 200},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 180},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 540},
    {'a', 60},
    {'a', 5},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 80},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 60},
    {'a', 60},
    {'w', 120},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'df', 3},
    {'a',5},
    {'w', 120},
    {'a', 60},
    {'a', 5},
    {'w', 120},
    {'d'}, -- name character
    {'d'},
    {'l'},
    {'l'},
    {'l'},
    {'a'},
    {'l'},
    {'l'},
    {'l'},
    {'l'},
    {'a'},
    {'l'},
    {'d'},
    {'a'},
    {'u'},
    {'r'},
    {'r'},
    {'a'},
    {'s'},
    {'a'},
    {'w', 240},
    {'a', 5},
    {'w', 300},
    {'a', 5}, 
    {'a', 60},
    {'a', 60},
    {'a', 60}, -- name grandson
    {'w', 30},
    {'r'},
    {'r'},
    {'r'},
    {'a'},
    {'l'},
    {'l'},
    {'l'},
    {'a'},
    {'d'},
    {'d'},
    {'d'},
    {'r'},
    {'r'},
    {'a'},
    {'u'},
    {'u'},
    {'u'},
    {'r'},
    {'r'},
    {'a'},
    {'s', 30},
    {'a', 15},
    {'w', 180},
    {'a', 15},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 300}, -- enter game
    {'s', 60}, -- change battle scene
    {'df', 5},
    {'df', 5},
    {'df', 5},
    {'a'},
    {'w', 180},
    {'r'},
    {'df', 10},
    {'r'},
    {'a'},
    {'w', 120},
    {'s'},
    {'w', 180},
    {'l', 4},
    {'u', 5},
    {'l', 3},
    {'u', 1},
    {'w', 30},
    {'a', 8},
    {'w', 30},
    {'press_a', 7},
    {'press_b', 4},
    {'w', 30},
    {'r', 7},
    {'d', 3},
    {'r', 4},
    {'u', 3},
    {'l', 2},
    {'w',80},
    {'d',6},
    {'l',7},
    {'d',3},
    {'w',100},
    {'r',6},
    {'u',7},
    {'r',2},
    {'u',2},
    {'w',540},
    {'a',60},
    {'a',60},
    {'a',60},
    {'a',1},
    {'w',720},
    {'a',60},
    {'a',3},
    {'w',120},
    {'a',20},
    {'a',80},
    {'a',80},
    {'a',80},
    {'a',80},
    {'a',80},
    {'a',80},
    {'w',60},
    {'b',80},
    {'b',80},
    {'b',80},
    {'b',80},
    {'b',60},
    {'b',60},
    {'b',60},
    {'b',60},
    {'b',60},
    {'r',2},
    {'u',2},
    {'r',4},
    {'d',2},
    -- RECORD: First Fight Start
    {'a',3},
    {'w',20},
    {'a',60},
    {'a',60},
    {'w',20},
    {'a',5},
    {'a',60},
    {'a',5},
    {'a',80},
    {'a',5},
    {'a',80},
    {'w',360},
    {'a',5},
    {'w',60},
    {'r'}, -- naming charmander
    {'r'},
    {'r'},
    {'a'},
    {'r'},
    {'a'},
    {'l'},
    {'l'},
    {'l'},
    {'l'},
    {'a'},
    {'d'},
    {'d'},
    {'d'},
    {'a'},
    {'u'},
    {'u'},
    {'r'},
    {'a'},
    {'s'},
    {'a'},
    {'w',180},
    {'a',5},
    {'a',60},
    {'a',5},
    {'w',360},
    {'a',5}, -- end
    {'l',4}, -- fight with rival
    {'d',6},
    {'w',60},
    {'a',60},
    {'a',60},
    {'a',60}, -- enter fight
    {'a',60},
    {'w',500}, -- breakpoint
    {'b', 15},
    {'w', 400},
    {'b', 15},
    {'w', 90},
    {'b', 15},
    {'w', 90},
    {'b', 15},
    {'w', 120},
    {'b', 15},
    {'w', 90},
    {'b', 15},
    {'w', 153},
    {'b', 18},
    {'w', 94},
    {'b', 22},
    {'w', 148},
    {'b', 19},
    {'w', 123},
    {'b', 60},
    {'b', 16}, -- turn 1 
    {'a', 15},
    {'a', 15}, -- use scratch 
    {'w', 180},
    {'press_b', 5},
    {'w', 300}, -- turn 2
    {'a', 15},
    {'a', 15},
    {'w', 540}, -- turn 3
    {'a', 15},
    {'a', 15},
    {'w', 540}, -- turn 4
    {'r', 1},
    {'a', 21},
    {'w', 40},
    {'a', 21},
    {'w', 42},
    {'a', 20},
    {'w', 60},
    {'a', 29},
    {'w', 60},
    {'a', 29},
    {'w', 60},
    {'a', 29},
    {'w', 60},
    {'press_a', 5},
    {'press_b', 5},
    {'w', 300}, -- turn 5
    {'l', 1},
    {'a', 15},
    {'a', 15},
    {'w', 540}, -- turn 6
    {'a', 15},
    {'a', 15}, -- fight over

    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- end rival fight 
    -- STOP RECORDING
    -- START RECORDING GRASS SECTION
    {'l',2},
    {'d',6},
    {'w',180},
    {'l', 5},
    {'u', 12},
    {'r', 2},
    {'u', 2},
    {'b', 15},
    {'b', 60}, -- b spam through text
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 15},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'u',3}, -- walk through grass to viridian from pallet
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1 },
    {'l', 6},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 2},
    {'r', 10},
    {'u', 3},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'r', 1},
    {"grass_cycle", 1},
    {'r', 1},
    {'u',3},
    {'l',9},
    {'u',5},
    {'r',7},
    {'u',3},
    {"grass_cycle", 1},
    {'u',1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {'u', 4},
    {'r', 2},
    {'u', 2},
    {"grass_cycle", 1},
    {'u',1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1}, -- out of grass and into viridian
    {'u', 2},
    -- END RECORDING
    {'l', 7}, --  go to mart
    {'u', 16},
    {'r', 10},
    {'u', 14},
    {'r', 8},
    {'d', 5},
    {'l', 3},
    {'u', 2},
    {'b', 60}, -- pick up parcel
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'d',7}, -- leave mart
    {'w', 120},
    {'r', 3},
    {'u', 5},
    {'l', 8},
    {'d', 14},
    {'l', 10},
    {'d', 15},
    {'l', 5},
    {'d', 18},
    {'r', 14},
    {'d', 9},
    {'l', 7},
    {'d', 6},
    {'d',1},
    {"grass_cycle", 1},
    {'d',1},
    {"grass_cycle", 1},
    {'d',1},
    {"grass_cycle", 1},
    {'d',1},
    {"grass_cycle", 1},
    {'d',1},
    {"grass_cycle", 1},
    {'d', 15}, -- enter pallet 
    {'r', 5},
    {'u', 2},
    {'w', 120},
    {'u', 8},
    {'a', 15},
    {'a', 15},
    {'b', 60}, -- talk to oak, get dex
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'d', 9}, -- out of lab
    {'w', 150},
    {'l', 5},
    {'u', 15},
    {'r', 2},
    {'u', 2}, -- up to grass
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1 },
    {'l', 6},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 2},
    {'r', 10},
    {'u', 3},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'r', 1},
    {"grass_cycle", 1},
    {'r', 1},
    {'u',3},
    {'l',9},
    {'u',5},
    {'r',7},
    {'u',3},
    {"grass_cycle", 1},
    {'u',1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {'u', 4},
    {'r', 2},
    {'u', 2},
    {"grass_cycle", 1},
    {'u',1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1}, -- out of grass and into viridian
    {'u', 2},
    {'l', 5}, -- go to mart
    {'u', 14},
    {'l', 3},
    {'u', 5},
    {'u', 6},
    {'r', 15},
    {'u', 4},
    {'w', 240},
    {'u', 4},
    {'l', 1},
    {'a', 15}, -- start shopping
    {'w', 180},
    {'a', 15},
    {'w', 120},
    {'d', 2},
    {'a', 15},
    {'w', 150},
    {'a', 15},
    {'a', 60}, -- buy antidote
    {'a', 60},
    {'w', 180},
    {'a', 15},
    {'w', 60},
    {'u', 1}, -- buy potions
    {'a', 15},
    {'w', 240},
    {'d', 1},
    {'a', 15},
    {'a', 60},
    {'a', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- exit mart menu
    {'d', 6},
    {'w', 240},
    {'l', 6},
    {'d', 8},
    {'l', 6},
    {'u', 2},
    {'w', 240},
    {'u', 4},
    {'a', 15},
    {'a', 60}, -- talk to nurse joy
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 300},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'d', 6},
    {'w', 240},
    {'l', 5},
    {'u', 20},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 2200}, -- watch old man pokeball
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'u', 20},
    {'l', 6},
    {'u', 8},
    {'r', 9},
    {'u', 9},
    {'l', 8},
    {'u', 5},
    {'w', 180},
    {'u', 10},
    {'w', 300}, -- enter viridian forest
    {'u', 3}, -- start walk to anthony
    {'r', 10},
    {'d', 2},
    {'r', 5},
    {'u', 15},
    {'l', 2},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'r', 1},
    {"grass_cycle", 1},
    {'r', 1},
    {'r', 6},
    {'u',17},
    {'l', 8},
    {'u', 10},
    {'l', 6},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 2},
    {'l', 10},
    {'u', 3}, -- exit grass
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {'u', 6},
    {'l', 8},
    {'a', 15}, -- fight bug catcher anthony //video breakpoint
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 450},
    {'a', 15}, -- scratch 1
    {'a', 15},
    {'w', 300},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'a', 15}, -- scratch 2
    {'a', 15},
    {'w', 300},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'a', 15}, -- scratch 3 (potential KO on crits)
    {'a', 15},
    {'w', 300},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'b', 60},
    {'a', 15}, -- scratch/ember 4
    {'s', 20},
    {'df', 10},
    {'s', 20},
    {'a', 15},
    {'w', 300},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'b', 60},
    {'attack_down_ember', 17}, -- end fight / video breakpoint
    {'d', 6}, -- fighting rick / video breakpoint
    {'r', 7},
    {'d', 3},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {'d', 1},
    {'r', 10},
    {'u', 2},
    {'u', 1},
    {'grass_cycle', 1},
    {'u', 1},
    {'grass_cycle', 1},
    {'u', 1},
    {'grass_cycle', 1},
    {'r', 1},
    {'grass_cycle', 1},
    {'r', 1},
    {'grass_cycle', 1},
    {'r', 1},
    {'grass_cycle', 1},
    {'r', 1},
    {'grass_cycle', 1},
    {'r', 1},
    {'grass_cycle', 1},
    {'r', 1}, -- exit grass
    {'r', 5},
    {'d', 9},
    {'r', 7},
    {'d', 17},
    {'l', 3},
    {'d', 4},
    {'w', 120}, -- start battle with rick (430xp/500xp)
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 420},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240},
    {'a', 15},
    {'df', 10},
    {'a', 15}, -- use ember, will faint caterpie
    {'w', 480}, -- wait for battle sequence
    {'b', 60}, -- skip through text 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, -- go through level up text (lvl 6 charm)
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'w', 480}, -- wait for caterpie to be sent out
    {'a', 15},
    {'a', 15}, -- use ember, will faint second caterpie
    {'w', 480}, -- wait for battle sequence
    {'b', 60}, 
    {'b', 60}, -- spam through end of battle text (lvl 5 charm gets to 10 here)
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'b', 60}, 
    {'w', 300}, -- rick defeated // video breakpoint
    {'u', 4}, -- go to doug
    {'r', 3},
    {'u', 17},
    {'l', 4},
    {'d', 4}, -- doug spots us
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 600},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 240}, -- start fight
    {'a', 15},
    {'df', 10},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'a', 15},
    {'uf', 10},
    {'rf', 10},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'use_growl', 25}, -- lose battle, end up in center / video breakpoint
    {'doug_cycle_1',7}, -- (711/1,261) brings us to (1257/1261)
    {'doug_cycle_1', 16}, -- (1257/2535) brings us to (2505/2535), about to evolve
    {'doug_cycle_1', 26}, -- (2505/4575) -> (4533/4575) about to learn smokescreen
    {'doug_cycle_2', 2}, -- avoid learning smokescreen (4689/11735)
    {'doug_cycle_3', 90}, -- holy frick (11709/11735)
    {'doug_cycle_2', 2},  -- avoid learning scary face (11865/24294)
    {'doug_cycle_4', 159}, -- god have mercy (24267/24294)
    {'doug_cycle_5', 1}, -- learn flamethrower and evolve
    {'b', 50},
    {'w', 200},
    {'r', 2},
    {'u', 3},
    {'l', 8},
    {'u', 10},
    {'l', 6},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'l', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 2},
    {'l', 10},
    {'u', 3}, -- exit grass
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {'u', 1},
    {'l', 9},
    {'d', 2},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {"grass_cycle", 1},
    {'d', 1},
    {'l', 12},
    {'u', 2},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1}, -- move to fight trainer
    {'w', 120},
    {'b', 60},
    {'w', 540},
    {'b', 60},
    {'b', 60},
    {'w', 360},
    {'b', 60},
    {'b', 60},
    {'w', 360},
    {'b', 60},
    {'a', 15},
    {'df', 15},
    {'a', 15},
    {'w', 360},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'w', 120},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1},
    {"grass_cycle", 1},
    {'u', 1}, -- right outside pewter
    {'u', 3},
    {'w', 240},
    {'u', 10},
    {'w', 120},
    {'u', 4},
    {'r', 5},
    {'u', 15}, -- enter pewter city
    {'u', 6},
    {'r', 3},
    {'u', 19},
    {'l', 16},
    {'d', 7},
    {'r', 8},
    {'u', 2},
    {'w', 240},
    {'u', 6},
    {'w', 240},
    {'b', 60},
    {'b', 60},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'df', 15},
    {'rf', 15},
    {'a', 15},
    {'w', 480},
    {'b', 60},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 120}, -- first trainer defeated
    {'u', 3},
    {'a', 15}, -- fight brock
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 480},
    {'b', 100},
    {'w', 360},
    {'a', 15},
    {'df', 15},
    {'rf', 15},
    {'a', 15},
    {'w', 240},
    {'b', 100},
    {'w', 240},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 240},
    {'a', 15},
    {'a', 15}, -- kill onix
    {'w', 240},
    {'b', 100},
    {'w', 240},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 60},
    {'d', 10}, -- go to mart
    {'w', 120},
    {'l', 10},
    {'u', 8},
    {'r', 17},
    {'d', 10},
    {'r', 6},
    {'u', 2},
    {'w', 120},
    {'u', 4},
    {'l', 2},
    {'a', 100},
    {'d', 1},
    {'a', 60},
    {'w', 120},
    {'u', 1},
    {'a', 120},
    {'d', 1},
    {'a', 120}, -- sell potions
    {'a', 120},
    {'b', 120},
    {'b', 120},
    {'w', 300},
    {'a', 15},
    {'w', 90},
    {'df', 240},
    {'u', 1},
    {'a', 60},
    {'d', 1},
    {'a', 120}, -- buy repels
    {'a', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'d', 6},
    {'w', 200}, -- exit mart
    {'d', 2}, -- start new stuff
    {'r', 20},
    {'w', 90},
    {'b', 60}, -- get the running shoes
    {'b', 100}, -- spam through text
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'r', 11},
    {'u', 2},
    {'r', 4},
    {'u', 4},
    {'r', 3},
    {'u', 2},
    {'u', 1}, -- get noticed
    {'w', 200},
    {'b', 100},
    {'b', 100},
    {'battle_setup', 1}, -- fight colton
    {'a', 15},
    {'w', 400},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'a', 15},
    {'w', 400},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'u', 3},
    {'r', 10},
    {'d', 4},
    {'r', 3},
    {'w', 200},
    {'b', 100},
    {'b', 100},
    {'w',400},
    {'a',5},
    {'w',240},
    {'a',60},
    {'w',240},
    {'a', 15},
    {'df', 15},
    {'a', 15},
    {'w', 400},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'a', 15},
    {'w', 400},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 100},
    {'r', 2},
    {'u', 2},
    {'r', 10},
    {'d', 2},
    {'w', 300},
    {'b', 100},
    {'b', 100},
    {'w',400},
    {'a',5},
    {'w',240},
    {'a',60},
    {'w',240},
    {'a', 15},
    {'df', 15},
    {'a', 15},
    {'w', 400},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'w', 200},
    {'d', 3},
    {'r', 5},
    {'w', 1200},
    {'b', 100},
    {'b', 100},
    {'battle_setup', 1},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'r', 7},
    {'u', 3},
    {'r', 14},
    {'d', 6},
    {'r', 10},
    {'u', 3},
    {'r', 3},
    {'u', 19},
    {'r', 2},
    {'u', 8}, -- enter pokecenter
    {'w', 200},
    {'l', 6},
    {'u', 6},
    {'l', 2},
    {'a', 15},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 100},
    {'a', 60},
    {'w', 200}, -- name magikarp
    {'l'},
    {'l'},
    {'l'},
    {'d'},
    {'d'},
    {'a'},
    {'l'},
    {'l'},
    {'l'},
    {'l'},
    {'l'},
    {'a'},
    {'r'},
    {'a'},
    {'u'},
    {'r'},
    {'r'},
    {'a'},
    {'w', 15},
    {'s', 15},
    {'a', 15},
    {'b', 60},
    {'w', 200},
    {'d', 6},
    {'r', 6},
    {'u', 7},
    {'a', 15}, -- heal
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 500},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- end heal
    {'r', 5},
    {'u', 4},
    {'a', 15},
    {'a', 60},
    {'w', 120},
    {'a', 120},
    {'a', 120},
    {'a', 120},
    {'a', 120},
    {'df', 15},
    {'a', 120},
    {'rf', 30},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'b', 120},
    {'d', 4},
    {'l', 2},
    {'d', 4},
    {'reset_start', 1},
    {'l', 4},
    {'d', 2},
    {'w', 360},
    {'r', 8},
    {'u', 2},
    {'w', 600}, -- enter mt. moon  // BREAKPOINT
    {'s', 15},
    {'w', 60},
    {'u', 4},
    {'a', 15},
    {'w', 60},
    {'d', 5},
    {'w', 60},
    {'u', 1},
    {'w', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- repel used, 100 steps
    {'u', 10},
    {'r', 3},
    {'w', 140},
    {'b', 22},
    {'w', 57},
    {'b', 21},
    {'w', 399},
    {'b', 21},
    {'w', 341},
    {'a', 17},
    {'w', 27},
    {'d', 1},
    {'r', 1},
    {'a', 15}, -- use flamethrower
    {'w', 540},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- done leveling up
    {'w', 30},
    {'r', 5},
    {'u', 13},
    {'r', 14},
    {'u', 3},
    {'r', 6},
    {'d', 23},
    {'l', 1},
    {'a', 15}, -- pick up rare candy
    {'a', 60},
    {'b', 60},
    {'b', 60},
    {'b', 60},
    {'l', 1},
    {'u', 25},
    {'l', 7},
    {'w', 120},
    {'a', 60},
     {'s', 15},
    {'a', 100},
    {'a', 100},
    {'a', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100}, -- repel number 2
    {'l', 1},
    {'u', 4},
    {'l', 3},

   
    {'l', 6},
    {'w', 600},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'battle_setup', 1},
    {'w', 60},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'l', 13},
    {'d', 10},
    {'w', 240},
    {'b', 100},
    {'battle_setup', 1}, -- fight kid with yellow hat
    {'w', 60},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'w', 100},
    {'d', 1},
    {'l', 5},
    {'u', 13},
    {'l', 8},
    {'w', 90},
    {'d', 18},
    {'r', 20},
    {'w', 90},
    {'r', 1},
    {'u', 5},
    
    
    {'r', 6},
    {'d', 4},
    {'w', 60},
    {'b', 100},
    {'s', 15},
    {'a', 100},
    {'a', 100},
    {'a', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100}, -- repel number 3
    {'r', 7},
    {'d', 1},
    {'a', 60},
    {'w', 600},
    {'b', 100},
    {'b', 100},
    {'battle_setup', 1}, -- fight grunt
    {'a', 15},
    {'w', 60},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'u', 2},
    {'r', 2},
    {'u', 3},
    {'r', 5},
    {'d', 13},
    {'l', 4},
    {'d', 10},
    {'l', 28},
    {'u', 16},
    {'w', 240},
    {'b', 100},
    {'b', 100},
    {'battle_setup', 1}, -- fight next grunt
    {'a', 15},
    {'w', 60},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100}, -- defeat grunt
    {'r', 2},
    {'u', 12},
    {'a', 50},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'battle_setup', 1}, -- fight nerd
    {'a', 15},
    {'w', 60},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'a', 15},
    {'a', 15},
    {'w', 480},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100}, -- defeat nerd
    {'r', 2},
    {'u', 5},
    {'l', 2},
    {'u', 1},
    {'w', 25},
    {'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},
    {'u', 3},
    {'w', 90},
    {'b', 60},
    {'b', 60},
    {'s', 15},
    {'a', 100},
    {'a', 100},
    {'a', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100}, -- repel number 4
    {'u', 1},  -- desynced repel
    {'w', 90},
    {'b', 60},
    {'b', 60},
    {'s', 15},
    {'a', 100},
    {'a', 100},
    {'a', 100},
    {'b', 100},
    {'b', 100},
    {'b', 100}, -- repel number 4
    {'l', 8},
    {'l', 2},
    {'d', 7},
    {'r', 2},
    {'w', 120},
    {'r', 6},
    {'w', 300}, -- out of mt. moon
    {'r', 28},
    {'d', 6},
    {'r', 12},
    {'u', 4},
    {'r', 24},
    {'d', 3},
    {'r', 20},
    {'w', 90}, -- repel wears off
    {'b', 100},
    {'r', 7},
    {'u', 7},
    {'r', 16},
    {'d', 7},
    {'l', 4},
    {'u', 2},
    {'w', 240},
    {'u', 7},
    {'a', 15}, -- heal
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 500},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- end heal
    {'w', 240},
}

m.executeOrders(start1)
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 Brock! Making savestate: '%s/States/Gym%dFinished.State'. To continue from here load the state and run %d.lua.", folderName, num, nextScript))