-- ~35 minutes@60fps
package.path = "./main/?.lua;"
movement = loadfile('movement.lua')
m = movement()
local num = 7

press_b = {
    {'b', 60}
}

use_repel = {
    {'s', 15},
    {'a', 15},
    {'w', 60},
    {'a', 15},
    {'a', 15},
    {'press_b', 5},
}
pokecenter_heal = {
    {'a', 15}, -- heal
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'a', 60},
    {'w', 500},
    {'b', 60},
    {'b', 60},
    {'b', 60}, -- end heal
}

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},
    {'b', 100},
}

start7 = {
    {'w', 230}, 
    {'l', 4}, -- go to water route
    {'d', 3},
    {'l', 2},
    {'d', 4},
    {'r', 8},
    --mapChange
    {'d', 12},
    {'l', 8},
    {'d', 4},
    {'r', 7},
    {'w', 60},
    {'a', 14},
    {'w', 90},
    {'a', 16},
    {'w', 120},
    {'b', 19},
    {'w', 180}, -- we're on the water
    {'s', 10}, -- use a repel
    {'w', 296},
    {'a', 17},
    {'w', 289},
    {'l', 1},
    {'w', 247},
    {'a', 19},
    {'w', 34},
    {'a', 17},
    {'w', 153},
    {'b', 22},
    {'w', 63},
    {'b', 23},
    {'w', 70},
    {'b', 25}, -- done using repel
    {'w', 90},
    {'d', 11}, -- surf to first trainer
    {'l', 12},
    {'d', 2},
    {'r', 3},
    {'d', 2},
    {'r', 14},
    {'d', 3},
    {'r', 2},
    {'d', 3},
    {'d', 2},
    {'l', 2},
    {'l', 2},
    {'r', 2},
    {'d', 1},
    {'d', 1},
    {'w', 755},
    {'b', 7},
    {'w', 452},
    {'b', 18},
    {'w', 396},
    {'a', 15},
    {'use_move', 2}, -- defeat swimming boi 13/15 tbolt
    {'d', 4},
    {'l', 3},
    {'d', 4},
    {'l', 2},
    {'d', 4},
    {'r', 4},
    {'d', 8},
    {'d', 3},
    {'l', 4},
    {'d', 7},
    {'l', 7},
    {'u', 3},
    {'l', 4},
    {'d', 2},
    {'l', 5},
    {'w', 90},
    {'b', 16}, -- reuse repel
    {'w', 309},
    {'s', 11},
    {'w', 98},
    {'a', 19},
    {'w', 111},
    {'a', 19},
    {'w', 42},
    {'a', 16},
    {'w', 175},
    {'b', 34},
    {'w', 58},
    {'b', 22},
    {'w', 78},
    {'b', 22}, -- done using repel
    {'w', 30},
    --mapChange
    {'l', 12},
    {'d', 3},
    {'l', 3},
    {'u', 3},
    {'l', 5},
    {'w', 700}, -- wait for swimmer to get to us
    {'b', 18},
    {'w', 441},
    {'a', 16},
    {'w', 401},
    {'a', 15}, -- battle
    {'use_move', 4}, -- tbolt 9/15
    {'l', 6},
    {'u', 3},
    {'l', 4},
    {'d', 4},
    {'l', 6},
    {'l', 2},
    {'u', 5},
    {'l', 3},
    {'u', 1},
    {'u', 1},
    {'l', 4},
    {'l', 1},
    {'u', 2},
    {'l', 5},
    {'u', 2},
    {'l', 3},
    {'u', 2},
    {'l', 2}, -- land on seafoam islands
    {'w', 90},
    {'u', 3},
    {'l', 2},
    {'u', 2},
    {'l', 11},
    {'d', 6},
    {'l', 7},
    {'u', 4},
    --mapChange
    {'w', 540}, -- enter seafoam cave
    --seafoam-1
    {'u', 3},
    {'r', 9}, -- repel runs out
    {'w', 90},
    {'b', 20},
    {'w', 90},
    {'s', 14}, -- use a new repel
    {'w', 90},
    {'a', 20},
    {'w', 90},
    {'a', 13},
    {'w', 30},
    {'a', 16},
    {'press_b', 5}, -- done using repel
    {'r', 6}, -- go to push boulder 
    {'u', 7},
    {'r', 2},
    {'d', 2},
    {'r', 2},
    {'u', 1},
    {'w', 90},
    {'a', 14},
    {'w', 130},
    {'a', 20},
    {'w', 121},
    {'a', 16},
    {'w', 246},
    {'b', 20},
    {'w', 86},
    {'b', 21},
    {'w', 87},
    {'u', 1},
    {'w', 107},
    {'u', 2},
    {'w', 97},
    {'u', 2},
    {'w', 107},
    {'u', 2},
    {'w', 161},
    {'r', 2},
    {'w', 60},
    {'u', 3},
    {'w', 92},
    {'l', 2}, -- boulder 1 goes down hole
    {'w', 90},
    {'d', 4},
    {'l', 8},
    {'d', 5},
    {'l', 8},
    {'u', 9},
    {'r', 4},
    {'u', 2},
    {'r', 7},
    {'u', 2},
    {'r', 9},
    {'d', 5},
    {'r', 6},
    {'d', 3},
    {'r', 3},
    {'u', 3},
    {'l', 2},
    {'w', 140},
    {'l', 2},
    {'w', 78},
    {'d', 2},
    {'w', 31},
    {'l', 3},
    {'w', 42},
    {'u', 2}, -- boulder 2 goes down hole
    {'w', 60},
    {'l', 4},
    {'u', 2},
    {'w', 47},
    {'l', 2},
    {'u', 5},
    {'w', 27},
    {'l', 4}, -- repel runs out
    {'w', 72},
    {'b', 20},
    {'w', 170},
    {'s', 12}, -- use new repel
    {'w', 91},
    {'a', 18},
    {'w', 81},
    {'a', 19},
    {'w', 31},
    {'a', 21},
    {'w', 105},
    {'b', 29},
    {'w', 45},
    {'b', 26},
    {'w', 57},
    {'b', 31}, -- done with repel
    {'w', 60},
    {'l', 13},
    {'d', 2},
    --mapChange
    {'w', 180},
    {'l', 3},
    {'d', 12},
    {'r', 6},
    {'u', 8},
    {'r', 4},
    {'u', 7},
    {'r', 7},
    {'d', 4},
    {'l', 2},
    {'d', 2},
    {'r', 1}, -- approach boulder
    {'w', 60},
    {'a', 14}, -- use strength
    {'w', 79},
    {'a', 19},
    {'w', 127},
    {'a', 16},
    {'w', 220},
    {'b', 19},
    {'w', 51},
    {'b', 20}, -- exit prompt
    {'r', 1}, -- push boulder down hole
    {'w', 70}, 
    {'u', 3},
    {'r', 2},
    {'u', 4},
    {'l', 8},
    {'d', 13},
    {'l', 2},
    {'d', 3},
    {'l', 12},
    {'u', 5}, -- repel runs out
    {'w', 60},
    {'b', 17},
    {'w', 60},
    {'s', 15}, -- use new repel
    {'w', 90},
    {'a', 16},
    {'w', 90},
    {'a', 16},
    {'w', 34},
    {'a', 14},
    {'w', 90},
    {'press_b', 6}, -- done using new repel
    {'w', 30},
    {'u', 11},
    {'r', 5}, -- down ladder
    --mapChange
    {'w', 180},
    {'r', 14},
    {'d', 5},
    {'r', 1}, -- approach boulder
    {'w', 60}, 
    {'a', 14}, -- use strength
    {'w', 90},
    {'a', 20},
    {'w', 90},
    {'a', 15},
    {'w', 200},
    {'b', 16},
    {'w', 70},
    {'b', 19},
    {'w', 30},
    {'r', 1},
    {'w', 70},
    {'r', 2}, 
    {'w', 120}, -- rock goes into hole
    {'u', 4},
    {'l', 16},
    {'u', 2},
    --mapChange
    {'w', 180},
    {'l', 4},
    {'d', 10},
    {'r', 5},
    {'u', 7},
    {'r', 3},
    --mapChange
    {'w', 180},
    {'u', 2},
    {'r', 17},
    {'d', 5},
    {'r', 6}, -- repel wears off
    {'w', 90},
    {'b', 22},
    {'w', 165},
    {'s', 15}, -- use a new repel
    {'w', 93},
    {'a', 17},
    {'w', 108},
    {'a', 24},
    {'w', 30},
    {'a', 17},
    {'press_b', 6},
    {'u', 6},
    --mapChange
    {'w', 180},
    {'d', 5},
    {'l', 1}, -- face boulder
    {'w', 30},
    {'a', 14}, -- use strength
    {'w', 78},
    {'a', 23},
    {'w', 65},
    {'a', 16},
    {'w', 195},
    {'a', 23},
    {'w', 67},
    {'b', 34},
    {'l', 1},
    {'w', 70},
    {'l', 2},
    {'w', 120}, -- boulder goes down hole
    {'l', 2}, -- you go down hole
    {'w', 260},
    {'d', 1},
    {'r', 3},
    {'u', 2},
    {'l', 1},
    {'w', 72},
    {'a', 14}, -- USE STRENGTH
    {'w', 147},
    {'b', 20},
    {'w', 94},
    {'a', 25},
    {'w', 206},
    {'a', 24},
    {'w', 64},
    {'a', 20}, -- down using strength
    {'w', 60},
    {'l', 1},
    {'w', 70},
    {'l', 2},
    {'w', 70},
    {'l', 2}, -- boulder goes down hole
    {'w', 180},
    {'l', 2}, -- you go down hole
    {'w', 260},
    {'d', 4},
    {'l', 5},
    {'u', 4},
    {'w', 60}, -- hop onto ground
    {'u', 1},
    {'l', 5},
    {'d', 6},
    {'r', 6},
    {'d', 5},
    {'l', 7},
    {'d', 2},
    {'l', 3},
    {'u', 3},
    {'r', 2},
    {'u', 1}, -- look at boulder
    {'w', 30},
    {'a', 20}, -- use strength
    {'w', 74},
    {'a', 32},
    {'w', 69},
    {'a', 25},
    {'w', 192},
    {'b', 26},
    {'w', 56},
    {'b', 26}, -- done using strength
    {'w', 60},
    {'u', 1},
    {'w', 70},
    {'u', 2},
    {'w', 70},
    {'u', 1},
    {'l', 2},
    {'d', 2},
    {'w', 70},
    {'r', 2},
    {'d', 3},
    {'l', 2}, -- push boulder
    {'w', 70},
    {'l', 1},
    {'d', 2},
    {'l', 3},
    {'u', 3},
    {'l', 2},
    {'w', 70},
    {'l', 2},
    {'w', 70},
    {'l', 2},
    {'w', 70},
    {'l', 2},
    {'w', 70},
    {'l', 1},
    {'d', 2}, -- kick boulder down hole
    {'w', 180},
    {'r', 5},
    {'d', 3},
    {'r', 3},
    {'u', 2},
    {'l', 2},
    {'w', 70},
    {'l', 2},
    {'w', 70},
    {'l', 1},
    {'u', 2},
    {'l', 2},
    {'d', 2}, -- push boulder down hole
    {'w', 180},
    {'d', 2}, -- you down hole
    {'w', 260}, -- land in water
    {'u', 12}, -- repel wears off
    {'w', 77},
    {'b', 24},
    {'w', 146},
    {'s', 12}, -- use new repel
    {'w', 88},
    {'a', 15},
    {'w', 92},
    {'a', 25},
    {'w', 26},
    {'a', 20},
    {'w', 142},
    {'b', 22},
    {'w', 50},
    {'b', 22},
    {'w', 57},
    {'b', 24}, -- done with repel
    {'u', 1},
    {'r', 3},
    {'u', 2},
    {'w', 90},
    {'u', 2},
    {'l', 2}, -- face articuno
    {'w', 60},
    {'a', 14}, -- fight articuno
    {'w', 138},
    {'b', 18},
    {'w', 409},
    {'a', 18},
    {'w', 500}, -- await battle screen
    {'rf', 15},
    {'a', 15},
    {'w', 90},
    {'r', 2},
    {'d', 1},
    {'a', 15},
    {'a', 15}, -- use masterball
    {'w', 900},
    {'b', 16},
    {'w', 90},
    {'b', 17},
    {'w', 120},
    {'a', 22},
    {'w', 223},
    {'a', 14}, -- name articuno
    {'w', 90},
    {'rf'},
    {'a'},
    {'df'},
    {'df'},
    {'rf'},
    {'a'},
    {'lf'},
    {'lf'},
    {'a'},
    {'uf'},
    {'uf'},
    {'rf'},
    {'a'},
    {'rf'},
    {'rf'},
    {'df'},
    {'a'},
    {'lf'},
    {'lf'},
    {'lf'},
    {'uf'},
    {'a'},
    {'df'},
    {'df'},
    {'df'},
    {'rf'},
    {'rf'},
    {'rf'},
    {'rf'},
    {'rf'},
    {'a'},
    {'s', 15},
    {'a', 15},
    {'w', 180}, -- bombjay named
    {'w', 60},
    {'d', 3},
    {'w', 60},
    {'a', 16}, -- try surfing
    {'w', 113},
    {'a', 19},
    {'w', 113},
    {'b', 20},
    {'w', 240}, -- we on the water
    {'l', 2},
    {'d', 11},
    {'r', 5},
    {'u', 5}, -- hop onto land
    {'w', 90},
    {'u', 3},
    {'r', 3}, -- up the ladder
    --mapChange
    {'w', 180},
    {'l', 2},
    {'u', 6},
    {'l', 5},
    {'d', 9},
    {'r', 11},
    {'u', 5},
    {'r', 5},
    {'d', 3},
    {'w', 90},
    {'a', 18},
    {'w', 94},
    {'a', 22}, -- surf
    {'w', 53},
    {'a', 20},
    {'w', 387},
    {'r', 4},
    {'w', 53},
    {'d', 2},
    {'w', 56},
    {'r', 4},
    {'w', 60},
    {'u', 2},
    {'w', 90}, -- hop onto land
    {'u', 1},
    {'r', 4},
    {'d', 5},
    {'l', 2},
    {'d', 3},
    {'r', 2}, -- up ladder
    --mapChange
    {'w', 180},
    {'r', 1},
    {'u', 4}, -- up ladder
    --mapChange
    {'w', 180},
    {'d', 6},
    {'l', 5}, -- up ladder
    --mapChange
    {'w', 180},
    {'r', 4}, -- repel runs out
    {'w', 90},
    {'b', 17},
    {'w', 90},
    {'s', 18}, -- new repel
    {'w', 123},
    {'a', 16},
    {'w', 90},
    {'l', 2},
    {'w', 20},
    {'a', 15},
    {'a', 15},
    {'press_b', 6},
    {'r', 1},
    {'d', 4}, -- out of caves
    {'w', 540},
    -- seafoam-2
    {'l', 5},
    {'w', 31},
    {'a', 20}, -- surf
    {'w', 180},
    {'a', 21},
    {'w', 103},
    {'b', 30}, -- on snok
    {'w', 120},
    {'d', 2},
    {'l', 20},
    {'u', 11},
    {'l', 4},
    {'l', 8},
    {'u', 3},
    {'l', 13},
    {'u', 2},
    {'l', 6},
    {'d', 5},
    --mapChange
    {'l', 24}, -- land on cinnabar
    {'w', 90},

    {'d', 6},
    {'l', 3},
    {'w', 90},
    {'b', 15},
    {'l', 1},
    {'u', 2},
    --mapChange
    {'w', 180},
    {'u', 4},
    {'l', 1}, -- approach mart
    {'w', 60},
    {'a', 25},
    {'w', 60},
    {'a', 15},
    {'w', 60},
    {'d', 5},
    {'a', 15},
    {'w', 90},
    {'a', 15},
    {'w', 90},
    {'a', 15}, -- buy escape rope
    {'press_b', 6},
    {'d', 6}, -- leave mart
    {'w', 180},
    {'r', 4},
    {'w', 44},
    {'u', 7},
    {'l', 4},
    {'u', 3},
    {'l', 11},
    {'u', 2}, -- into mansion
    {'w', 360},
    {'use_repel'},
    {'w', 20},
    {'u', 20},
    {'r', 4},
    --mapChange
    {'w', 180},
    {'d', 5},
    {'r', 9},
    {'u', 7},
    {'r', 3},
    {'u', 5},
    {'l', 8},
    {'u', 5},
    {'u', 1},
    {'r', 1},
    --mapChange
    {'w', 180},
    {'d', 4},
    {'r', 5},
    {'u', 1},
    {'w', 30},
    {'a', 10},
    {'w', 90},
    {'b', 20},
    {'w', 67},
    {'a', 25},
    {'w', 136},
    {'a', 19}, -- press switch
    {'w', 50},
    {'r', 6},
    {'d', 8},
    {'r', 5},
    {'d', 2},
    {'r', 2},
    {'w', 120},
    {'b', 15}, -- battle scientist
    {'w', 478},
    {'b', 16},
    {'w', 486},
    {'a', 23},
    {'use_move', 3}, --tbolt to 6/15
    {'w', 90},
    {'l', 3},
    {'d', 5}, -- fall down big ledge
    --mapChange
    {'w', 240},
    {'l', 4},
    {'w', 44},
    {'d', 7},
    {'w', 61},
    {'r', 5}, -- repel runs out
    {'b', 60},
    {'b', 60},
    {'use_repel'},
    {'w', 30},
    {'d', 2},
    {'r', 6},
    {'u', 3},
    --mapChange
    {'l', 4}, -- go down the stairs
    {'w', 180},
    {'l', 6},
    {'u', 10},
    {'l', 7},
    {'d', 4},
    -- special-thief
    {'d', 1}, -- either we fight the thief or we dont
    {'r', 5},
    {'w', 108},
    {'b', 20},
    {'w', 432},
    {'b', 25},
    {'w', 617},
    {'a', 18},
    {'use_move', 2}, -- tbolt to 4/15, desync, jolteon to level 90 in some PU
    {'press_b', 4},
    {'r', 5},
    {'w', 60},
    {'d', 8},
    {'l', 2},
    {'u', 2},
    {'w', 60},
    {'a', 17}, -- flip switch
    {'w', 75},
    {'a', 20},
    {'w', 77},
    {'a', 22},
    {'w', 81},
    {'b', 47},
    {'w', 60},
    {'l', 10},
    {'u', 12},
    {'r', 15},
    {'d', 4},
    {'r', 5},
    {'u', 14},
    {'press_b', 2},
    {'use_repel'}, -- somehow, the repels got 1 step out of sync dependent on the battle
    -- despite traveling the same distance, the battle actually gives us back 1 step
    {'w', 60},
    {'u', 1},
    {'press_b', 2},
    {'use_repel'}, -- use an extra repel, in case we battled
    {'u', 2},
    {'l', 7},
    {'u', 1},
    {'w', 60},
    {'a', 19}, -- flip switch
    {'w', 63},
    {'a', 20},
    {'w', 77},
    {'a', 19},
    {'w', 93},
    {'b', 20},
    {'w', 60},
    {'r', 4},
    {'d', 5},
    {'l', 27},
    {'u', 4},
    {'r', 1},
    {'w', 49},
    {'a', 22}, -- pick up secret key
    {'w', 220},
    {'b', 29},
    -- 1-cinnabar
    {'w', 90},
    {'s', 15}, -- use escape rope
    {'w', 90},
    {'a', 14},
    {'w', 120},
    {'d', 9},
    {'a', 15},
    {'w', 60},
    {'a', 15},
    {'w', 90},
    {'a', 15},
    {'w', 240}, -- out of mansion
    {'w', 60},
    {'r', 11}, -- go to pokecenter
    {'d', 2},
    {'r', 4},
    {'d', 8},
    {'l', 8},
    {'u', 2},
    --mapChange
    {'w', 240},
    {'u', 6},
    {'pokecenter_heal'},
    {'d', 6}, -- leave pokecenter
    {'w', 240},
    {'r', 8}, -- go to gym
    {'u', 6},
    {'l', 2},
    {'u', 5}, -- go into gym
    --mapChange
    {'w', 240},
    {'u', 4}, -- repel 1 runs out
    {'w', 90},
    {'b', 12},
    {'u', 1}, -- repel 2 runs out
    {'w', 90},
    {'b', 15},
    {'w', 60},
{'r', 2}, -- do all of blaines dumb questions
{'w', 48},
{'u', 7},
{'w', 61},
{'l', 4},
{'w', 31},
{'u', 2},
{'w', 60},
{'a', 16},
{'w', 90},
{'a', 19},
{'w', 90},
{'a', 18},
{'w', 90},
{'a', 23},
{'w', 90},
{'a', 26},
{'w', 90},
{'a', 19},
{'w', 90},
{'a', 17},
{'w', 120},
{'b', 37},
{'w', 62},
{'b', 34},
{'w', 92},
{'r', 2},
{'w', 37},
{'u', 2},
{'w', 33},
{'r', 3},
{'w', 34},
{'u', 6},
{'w', 78},
{'l', 4},
{'w', 28},
{'u', 3},
{'w', 26},
{'l', 9},
{'w', 59},
{'u', 1},
{'w', 66},
{'a', 22},
{'w', 86},
{'a', 23},
{'w', 90},
{'a', 24},
{'w', 90},
{'a', 24},
{'w', 90},
{'a', 22},
{'w', 90},
{'a', 13},
{'w', 90},
{'d', 1},
{'w', 32},
{'a', 22},
{'w', 196},
{'a', 25},
{'w', 83},
{'b', 25},
{'w', 105},
{'d', 4},
{'w', 45},
{'r', 3},
{'w', 44},
{'d', 7},
{'w', 34},
{'l', 5},
{'w', 33},
{'u', 3},
{'w', 38},
{'a', 30},
{'w', 63},
{'a', 18},
{'w', 109},
{'a', 23},
{'w', 88},
{'a', 21},
{'w', 110},
{'a', 23},
{'w', 77},
{'a', 26},
{'w', 120},
{'d', 1},
{'w', 27},
{'a', 27},
{'w', 120},
{'a', 27},
{'w', 86},
{'a', 23},
{'w', 90},
{'d', 2},
{'w', 36},
{'r', 5},
{'w', 57},
{'d', 8},
{'w', 36},
{'l', 4},
{'w', 49},
{'u', 3},
{'w', 39},
{'a', 23},
{'w', 73},
{'a', 29},
{'w', 120},
{'a', 30},
{'w', 98},
{'a', 27},
{'w', 108},
{'a', 30},
{'w', 104},
{'a', 26},
{'w', 120},
{'d', 1},
{'w', 54},
{'a', 25},
{'w', 155},
{'a', 34},
{'w', 65},
{'a', 26},
{'w', 186},
{'d', 5},
{'w', 49},
{'l', 9},
{'w', 39},
{'u', 3},
{'w', 31},
{'l', 6},
{'w', 30},
{'u', 3},
{'w', 50},
{'a', 23},
{'w', 113},
{'a', 32},
{'w', 96},
{'a', 35},
{'w', 93},
{'a', 23},
{'w', 116},
{'a', 28},
{'w', 127},
{'a', 18},
{'w', 406},
{'a', 27},
{'w', 185},
{'a', 26},
{'w', 97},
{'a', 27},
{'w', 186},
{'d', 2},
{'w', 31},
{'r', 6},
{'w', 40},
{'u', 9},
{'w', 104},
{'l', 6},
{'w', 39},
{'u', 2},
{'w', 67},
{'a', 20},
{'w', 129},
{'a', 21},
{'w', 112},
{'a', 27},
{'w', 106},
{'a', 20},
{'w', 119},
{'a', 26},
{'w', 74},
{'a', 22},
{'w', 170},
{'d', 1},
{'w', 47},
{'a', 24},
{'w', 172},
{'a', 29},
{'w', 109},
{'a', 22},
{'w', 159},
{'d', 2},
{'w', 39},
{'r', 5},
{'w', 36},
{'u', 9}, -- in front of blaine
{'w', 90},
{'a', 15},
{'w', 173},
{'a', 16},
{'w', 164},
{'a', 12},
{'w', 137},
{'a', 15},
{'w', 118},
{'a', 10},
{'w', 90},
{'b', 14},
{'w', 506},
{'b', 20},
{'w', 629},
{'a', 21}, -- fight begins
{'use_move', 3},
{'w', 240},
{'use_move', 1}, --kill arcanine
{'press_b', 12}, -- blaine defeated
{'w', 90},
{'d', 7},
{'d', 12},
{'r', 16},
{'u', 7},
{'l', 4},
{'u', 9},
{'u', 3},
{'r', 4},
{'u', 3},
{'r', 4},
{'d', 3},
{'r', 4},
{'d', 17},
{'l', 2},
{'d', 3}, -- out of the gym
--mapChange
{'w', 240}, -- bill spots us
{'press_b', 20}, -- tell him no to seveii islands
{'w', 30},
{'r', 2},
{'d', 9},
{'l', 8},
{'u', 3},
--mapChange
{'w', 180},
{'u', 6},
{'pokecenter_heal'},
{'d', 7},
{'w', 240},
-- 2-cinnabar

}

c = {
    {'d', 1}, -- either we fight the thief or we dont
    {'r', 5},
    {'w', 108},
    {'b', 20},
    {'w', 432},
    {'b', 25},
    {'w', 617},
    {'a', 18},
    {'use_move', 2}, -- tbolt to 4/15, desync, jolteon to level 90 in some PU
    {'press_b', 4},
    {'r', 5},
    {'w', 60},
    {'d', 8},
    {'l', 2},
    {'u', 2},
    {'w', 60},
    {'a', 17}, -- flip switch
    {'w', 75},
    {'a', 20},
    {'w', 77},
    {'a', 22},
    {'w', 81},
    {'b', 47},
    {'w', 60},
    {'l', 10},
    {'u', 12},
    {'r', 15},
    {'d', 4},
    {'r', 5},
    {'u', 14},
    {'press_b', 2},
    {'use_repel'}, -- somehow, the repels got 1 step out of sync dependent on the battle
    -- despite traveling the same distance, the battle actually gives us back 1 step
    {'w', 60},
    {'u', 1},
    {'press_b', 2},
    {'use_repel'}, -- use an extra repel, in case we battled
    {'u', 2},
    {'l', 7},
    {'u', 1},
    {'w', 60},
    {'a', 19}, -- flip switch
    {'w', 63},
    {'a', 20},
    {'w', 77},
    {'a', 19},
    {'w', 93},
    {'b', 20},
    {'w', 60},
    {'r', 4},
    {'d', 5},
    {'l', 27},
    {'u', 4},
    {'r', 1},
    {'w', 49},
    {'a', 22}, -- pick up secret key
    {'w', 220},
    {'b', 29},
    -- 1-cinnabar
   
}

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