changeset 98:08cd8be1edc1

renamed inspect.clj to items.clj
author Robert McIntyre <rlm@mit.edu>
date Mon, 12 Mar 2012 00:31:10 -0500
parents abb5add24b26
children 9fad96094950
files clojure/com/aurellem/inspect.clj clojure/com/aurellem/items.clj
diffstat 2 files changed, 403 insertions(+), 403 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/inspect.clj	Mon Mar 12 00:30:28 2012 -0500
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,403 +0,0 @@
     1.4 -(ns com.aurellem.inspect
     1.5 -  (:use (com.aurellem gb-driver vbm title))
     1.6 -  ;; this is fucking bullshit
     1.7 -  (:import [com.aurellem.gb_driver SaveState]))
     1.8 -
     1.9 -
    1.10 -
    1.11 -(defn game-name []
    1.12 -  (map char (subvec (vec (memory)) 0x134 0x142)))
    1.13 -
    1.14 -
    1.15 -
    1.16 -                    
    1.17 -
    1.18 -(defn current-items [^SaveState state]
    1.19 -  (set-state! state)
    1.20 -  
    1.21 -
    1.22 -  )
    1.23 -
    1.24 -
    1.25 -
    1.26 -;; try just buying five potions in sequence and see what changes
    1.27 -;; each time.
    1.28 -
    1.29 -(defn common-differences [& seqs]
    1.30 -  (let [backbone (range (count (first seqs)))]
    1.31 -    (filter
    1.32 -     (comp (partial apply distinct?) second)
    1.33 -     (zipmap backbone
    1.34 -             (apply (partial map list) seqs)))))
    1.35 -
    1.36 -;; trying to find how items are represented in memory
    1.37 -
    1.38 -(comment
    1.39 -  (def empty-inventory @current-state)
    1.40 -  
    1.41 -  (def one-potion @current-state)
    1.42 -  
    1.43 -  (def two-potions @current-state)
    1.44 -  
    1.45 -  (def three-potions @current-state)
    1.46 -  
    1.47 -  (def four-potions @current-state)
    1.48 -  
    1.49 -  (def five-potions @current-state)
    1.50 -  
    1.51 -  
    1.52 -  ;; result
    1.53 -  (def canidates
    1.54 -    (apply common-differences
    1.55 -           (map (comp vec memory)
    1.56 -                [empty-inventory one-potion two-potions three-potions
    1.57 -                 four-potions five-potions])))
    1.58 -
    1.59 -  [55875 (37 15 49 27 14 44)]
    1.60 -  [55876 (30 1 49 56 55 23)]
    1.61 -  [49158 (154 191 78 135 70 73)]
    1.62 -  [54087 (49 40 37 34 25 22)]
    1.63 -  [49160 (7 24 59 243 50 217)]
    1.64 -  [49704 (31 14 72 33 84 27)]
    1.65 -  [49162 (126 159 183 110 176 179)]
    1.66 -  [39984 (0 254 251 248 127 252)]
    1.67 -  [49904 (29 72 64 78 1 95)]
    1.68 -  [65491 (222 127 149 132 226 38)]
    1.69 -  [65492 (44 20 89 11 253 163)]
    1.70 -  [49335 (52 15 6 14 3 17)]
    1.71 -  [49720 (78 152 96 60 83 103)]
    1.72 -  [65304 (19 89 214 33 18 113)]
    1.73 -  [53561 (132 185 145 162 159 183)]
    1.74 -  [54046 (0 1 2 3 4 5)])
    1.75 -
    1.76 -;;; hmmmmmm...... I guess that the potion quantities are at 54046,
    1.77 -;;;huh?
    1.78 -
    1.79 -
    1.80 -
    1.81 -(def item-hack (read-state 7999))
    1.82 -
    1.83 -(def item-hack2 (read-state 75882))
    1.84 -
    1.85 -(defn get-mem []
    1.86 -  (subvec (vec (memory @current-state)) 54040 (+ 54046 100)))
    1.87 -
    1.88 -
    1.89 -;; potion -- 99
    1.90 -[0 16 0 0 1 20 99 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.91 -
    1.92 -;; potion -- 95
    1.93 -[0 16 0 0 1 20 95 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.94 -
    1.95 -;; potion -- 95
    1.96 -;; pokeball -- 1
    1.97 -[0 16 0 0 2 20 95 4 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.98 -
    1.99 -;; potion -- 95
   1.100 -;; pokeball -- 10
   1.101 -[0 16 0 0 2 20 95 4 10 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
   1.102 -
   1.103 -
   1.104 -;; pokeball -- 10
   1.105 -;; potion -- 95
   1.106 -[0 16 0 0 2 4 10 20 95 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
   1.107 -
   1.108 -;; pokeball -- 10
   1.109 -;; potion -- 95
   1.110 -;; antidote -- 1
   1.111 -
   1.112 -;;prediction
   1.113 -;;[0 16 0 0 3 4 10 20 95 ?? 1 255 0 0 0 0 0 ....]
   1.114 -  [0 16 0 0 3 4 10 20 95 11 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
   1.115 -
   1.116 -
   1.117 -
   1.118 -;; now it's time to learn the item codes
   1.119 -
   1.120 -(def item-hack-3 (read-state 77557))
   1.121 -(defn show-item
   1.122 -  "Run a saved pokemon with the first item replaced by the item named
   1.123 -   by n."
   1.124 -  [n]
   1.125 -  (set-state! item-hack-3)
   1.126 -  (let [mem (memory)]
   1.127 -    (aset mem 54045 n)
   1.128 -    (write-memory! mem))
   1.129 -  (step)
   1.130 -  (->> [[] @current-state]
   1.131 -       (play-moves
   1.132 -        [[:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
   1.133 -         [] [] [] [] []])))
   1.134 -
   1.135 -
   1.136 -(defn get-item-names []
   1.137 -  (dorun (map (fn [n] (println n)
   1.138 -                (show-item n)
   1.139 -                (Thread/sleep 5000))
   1.140 -              (range 0x00 0xFF))))
   1.141 -
   1.142 -
   1.143 -
   1.144 -;; 0   garbage
   1.145 -;; 1   master-ball
   1.146 -;; 2   ultra-ball
   1.147 -;; 3   great-ball
   1.148 -;; 4   poke-ball
   1.149 -;; 5   town-map
   1.150 -;; 6   bicycle
   1.151 -;; 7   ?????
   1.152 -;; 8   safari-ball
   1.153 -;; 9   pokedex
   1.154 -;; 10  moon-stone 
   1.155 -;; 11   antidote
   1.156 -;; 12   burn-heal
   1.157 -;; 13   ice-heal
   1.158 -;; 14   awakening
   1.159 -;; 15   parlyz-heal
   1.160 -;; 16   full-restore
   1.161 -;; 17   max-potion
   1.162 -;; 18   hyper-potion
   1.163 -;; 19   super-potion
   1.164 -;; 20   potion
   1.165 -;; 21   boulderbadge
   1.166 -;; 22   cascadebadge
   1.167 -;; 23   thunderbadge
   1.168 -;; 24   rainbowbadge
   1.169 -;; 25   soulbadge
   1.170 -;; 26   marshbadge
   1.171 -;; 27   volcanobadge
   1.172 -;; 28   earthbadge
   1.173 -;; 29   escape-rope
   1.174 -;; 30   repel
   1.175 -;; 31   old amber
   1.176 -;; 32   fire-stone
   1.177 -;; 33   thunderstone
   1.178 -;; 34   water-stone
   1.179 -;; 35   hp-up
   1.180 -;; 36   protein
   1.181 -;; 37   iron
   1.182 -;; 38   carbos
   1.183 -;; 39   calcium
   1.184 -;; 40   rare-candy
   1.185 -;; 41   dome-fossil
   1.186 -;; 42   helix-fossil
   1.187 -;; 43   secret-key
   1.188 -;; 44   ?????
   1.189 -;; 45   bike-voucher
   1.190 -;; 46   x-accuracy
   1.191 -;; 47   leaf-stone
   1.192 -;; 48   card-key
   1.193 -;; 49   nugget
   1.194 -;; 50   pp-up
   1.195 -;; 51   poke-doll
   1.196 -;; 52   full-heal
   1.197 -;; 53   revive
   1.198 -;; 54   max-revive
   1.199 -;; 55   guard-spec.
   1.200 -;; 56   super-repel
   1.201 -;; 57   max-repel
   1.202 -;; 58   dire-hit
   1.203 -;; 59   coin
   1.204 -;; 60   fresh-water
   1.205 -;; 61   soda-pop
   1.206 -;; 62   lemonade
   1.207 -;; 63   s.s.ticket
   1.208 -;; 64   gold-teeth
   1.209 -;; 65   x-attach
   1.210 -;; 66   x-defend
   1.211 -;; 67   x-speed
   1.212 -;; 68   x-special
   1.213 -;; 69   coin-case
   1.214 -;; 70   oak's-parcel
   1.215 -;; 71   itemfinder
   1.216 -;; 72   silph-scope
   1.217 -;; 73   poke-flute
   1.218 -;; 74   lift-key
   1.219 -;; 75   exp.all
   1.220 -;; 76   old-rod
   1.221 -;; 77   good-rod
   1.222 -;; 78   super-rod
   1.223 -;; 79   pp-up
   1.224 -;; 80   ether
   1.225 -;; 81   max-ether
   1.226 -;; 82   elixer
   1.227 -;; 83   max-elixer
   1.228 -;; 84   B2F
   1.229 -;; 85   B1F
   1.230 -;; 86   1F
   1.231 -;; 87   2F
   1.232 -;; 88   3F
   1.233 -;; 89   4F
   1.234 -;; 90   5F
   1.235 -;; 91   6F
   1.236 -;; 92   7F
   1.237 -;; 93   8F
   1.238 -;; 94   9F
   1.239 -;; 95   10F
   1.240 -;; 96   11F
   1.241 -;; 97   B4F
   1.242 -;; 98   garbage
   1.243 -;; 99   garbage
   1.244 -;; 100   garbage
   1.245 -;; 101   garbage
   1.246 -;; 102   garbage
   1.247 -;; 103   garbage
   1.248 -;; 104   garbage
   1.249 -;; 105   garbage
   1.250 -;; 106   garbage
   1.251 -;; 107   garbage
   1.252 -;; 108   garbage
   1.253 -;; 109   garbage
   1.254 -;; 110   garbage
   1.255 -;; 111   garbage
   1.256 -;; 112   garbage
   1.257 -;; 113   garbage
   1.258 -;; 114   garbage
   1.259 -;; 115   garbage
   1.260 -;; 116   garbage
   1.261 -;; 117   garbage
   1.262 -;; 118   garbage
   1.263 -;; 119   4
   1.264 -;; 120   garbage
   1.265 -;; 121   garbage
   1.266 -;; 122   slow
   1.267 -;; 123   garbage
   1.268 -;; 124   garbage
   1.269 -;; 125   garbage
   1.270 -;; 126   garbage
   1.271 -;; 127   garbage
   1.272 -;; 128   garbage
   1.273 -;; 129   garbage
   1.274 -;; 130   garbage
   1.275 -;; 131   slow
   1.276 -;; 132   slow
   1.277 -;; 133   garbage
   1.278 -;; 134   slow
   1.279 -;; 135   garbage
   1.280 -;; 136   garbage
   1.281 -;; 137   slow
   1.282 -;; 138   garbage
   1.283 -;; 139   garbage
   1.284 -;; 140   garbage
   1.285 -;; 141   slow
   1.286 -;; 142   garbage
   1.287 -;; 143   garbage
   1.288 -;; 144   garbage
   1.289 -;; 145   garbage
   1.290 -;; 146   garbage
   1.291 -;; 147   garbage
   1.292 -;; 148   garbage
   1.293 -;; 149   garbage
   1.294 -;; 150   slow
   1.295 -;; 151   garbage
   1.296 -;; 152   Q
   1.297 -;; 153   garbage
   1.298 -;; 154   garbage
   1.299 -;; 155   garbage
   1.300 -;; 156   garbage
   1.301 -;; 157   garbage
   1.302 -;; 158   garbage
   1.303 -;; 159   garbage
   1.304 -;; 160   garbage (alaphabet)
   1.305 -;; 161   garbage
   1.306 -;; 162   garbage
   1.307 -;; 163   garbage
   1.308 -;; 164   rival's
   1.309 -;; 165   name?
   1.310 -;; 166   nickname?
   1.311 -;; 167   slow
   1.312 -;; 168   garbage
   1.313 -;; 169   slow
   1.314 -;; 170   garbage
   1.315 -;; 171   garbage
   1.316 -;; 172   garbage
   1.317 -;; 173   garbage
   1.318 -;; 174   garbage
   1.319 -;; 175   yellow
   1.320 -;; 176   ash
   1.321 -;; 177   jack
   1.322 -;; 178   new-name
   1.323 -;; 179   blue
   1.324 -;; 180   gary
   1.325 -;; 181   john
   1.326 -;; 182   garbage
   1.327 -;; 183   garbage
   1.328 -;; 184   garbage
   1.329 -;; 185   garbage
   1.330 -;; 186   slow
   1.331 -;; 187   garbage
   1.332 -;; 188   garbage
   1.333 -;; 189   garbage
   1.334 -;; 190   garbage
   1.335 -;; 191   garbage
   1.336 -;; 192   garbage
   1.337 -;; 193   garbage
   1.338 -;; 194   garbage
   1.339 -;; 195   slow
   1.340 -;; 196   HM01
   1.341 -;; 197   HM02
   1.342 -;; 198   HM03
   1.343 -;; 199   HM04
   1.344 -;; 200   HM05
   1.345 -;; 201   TM01
   1.346 -;; 202   TM02
   1.347 -;; 203   TM03
   1.348 -;; 204   TM04
   1.349 -;; 205   TM05
   1.350 -;; 206   TM06
   1.351 -;; 207   TM07
   1.352 -;; 208   TM08
   1.353 -;; 209   TM09
   1.354 -;; 210   TM10
   1.355 -;; 211   TM11
   1.356 -;; 212   TM12
   1.357 -;; 213   TM13
   1.358 -;; 214   TM13
   1.359 -;; 215   TM15
   1.360 -;; 216   TM16
   1.361 -;; 217   TM17
   1.362 -;; 218   TM18
   1.363 -;; 219   TM19
   1.364 -;; 220   TM20
   1.365 -;; 221   TM21
   1.366 -;; 222   TM22
   1.367 -;; 223   TM23
   1.368 -;; 224   TM24
   1.369 -;; 225   TM25
   1.370 -;; 226   TM26
   1.371 -;; 227   TM27
   1.372 -;; 228   TM28
   1.373 -;; 229   TM29
   1.374 -;; 230   TM30
   1.375 -;; 231   TM31
   1.376 -;; 232   TM32
   1.377 -;; 233   TM33
   1.378 -;; 234   TM34
   1.379 -;; 235   TM35
   1.380 -;; 236   TM36
   1.381 -;; 237   TM37
   1.382 -;; 238   TM38
   1.383 -;; 239   TM39
   1.384 -;; 240   TM40
   1.385 -;; 241   TM41
   1.386 -;; 242   TM42
   1.387 -;; 243   TM43
   1.388 -;; 244   TM44
   1.389 -;; 245   TM45
   1.390 -;; 246   TM46
   1.391 -;; 247   TM47
   1.392 -;; 248   TM48
   1.393 -;; 249   TM49
   1.394 -;; 250   TM50
   1.395 -;; 251   TM51
   1.396 -;; 252   TM52
   1.397 -;; 253   TM53
   1.398 -;; 254   TM54
   1.399 -;; 255   end-of-list-sentinel   
   1.400 -
   1.401 -
   1.402 -  
   1.403 -
   1.404 -  
   1.405 -  
   1.406 -
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/clojure/com/aurellem/items.clj	Mon Mar 12 00:31:10 2012 -0500
     2.3 @@ -0,0 +1,403 @@
     2.4 +(ns com.aurellem.items
     2.5 +  (:use (com.aurellem gb-driver vbm title))
     2.6 +  ;; this is fucking bullshit
     2.7 +  (:import [com.aurellem.gb_driver SaveState]))
     2.8 +
     2.9 +
    2.10 +
    2.11 +(defn game-name []
    2.12 +  (map char (subvec (vec (memory)) 0x134 0x142)))
    2.13 +
    2.14 +
    2.15 +
    2.16 +                    
    2.17 +
    2.18 +(defn current-items [^SaveState state]
    2.19 +  (set-state! state)
    2.20 +  
    2.21 +
    2.22 +  )
    2.23 +
    2.24 +
    2.25 +
    2.26 +;; try just buying five potions in sequence and see what changes
    2.27 +;; each time.
    2.28 +
    2.29 +(defn common-differences [& seqs]
    2.30 +  (let [backbone (range (count (first seqs)))]
    2.31 +    (filter
    2.32 +     (comp (partial apply distinct?) second)
    2.33 +     (zipmap backbone
    2.34 +             (apply (partial map list) seqs)))))
    2.35 +
    2.36 +;; trying to find how items are represented in memory
    2.37 +
    2.38 +(comment
    2.39 +  (def empty-inventory @current-state)
    2.40 +  
    2.41 +  (def one-potion @current-state)
    2.42 +  
    2.43 +  (def two-potions @current-state)
    2.44 +  
    2.45 +  (def three-potions @current-state)
    2.46 +  
    2.47 +  (def four-potions @current-state)
    2.48 +  
    2.49 +  (def five-potions @current-state)
    2.50 +  
    2.51 +  
    2.52 +  ;; result
    2.53 +  (def canidates
    2.54 +    (apply common-differences
    2.55 +           (map (comp vec memory)
    2.56 +                [empty-inventory one-potion two-potions three-potions
    2.57 +                 four-potions five-potions])))
    2.58 +
    2.59 +  [55875 (37 15 49 27 14 44)]
    2.60 +  [55876 (30 1 49 56 55 23)]
    2.61 +  [49158 (154 191 78 135 70 73)]
    2.62 +  [54087 (49 40 37 34 25 22)]
    2.63 +  [49160 (7 24 59 243 50 217)]
    2.64 +  [49704 (31 14 72 33 84 27)]
    2.65 +  [49162 (126 159 183 110 176 179)]
    2.66 +  [39984 (0 254 251 248 127 252)]
    2.67 +  [49904 (29 72 64 78 1 95)]
    2.68 +  [65491 (222 127 149 132 226 38)]
    2.69 +  [65492 (44 20 89 11 253 163)]
    2.70 +  [49335 (52 15 6 14 3 17)]
    2.71 +  [49720 (78 152 96 60 83 103)]
    2.72 +  [65304 (19 89 214 33 18 113)]
    2.73 +  [53561 (132 185 145 162 159 183)]
    2.74 +  [54046 (0 1 2 3 4 5)])
    2.75 +
    2.76 +;;; hmmmmmm...... I guess that the potion quantities are at 54046,
    2.77 +;;;huh?
    2.78 +
    2.79 +
    2.80 +
    2.81 +(def item-hack (read-state 7999))
    2.82 +
    2.83 +(def item-hack2 (read-state 75882))
    2.84 +
    2.85 +(defn get-mem []
    2.86 +  (subvec (vec (memory @current-state)) 54040 (+ 54046 100)))
    2.87 +
    2.88 +
    2.89 +;; potion -- 99
    2.90 +[0 16 0 0 1 20 99 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    2.91 +
    2.92 +;; potion -- 95
    2.93 +[0 16 0 0 1 20 95 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    2.94 +
    2.95 +;; potion -- 95
    2.96 +;; pokeball -- 1
    2.97 +[0 16 0 0 2 20 95 4 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    2.98 +
    2.99 +;; potion -- 95
   2.100 +;; pokeball -- 10
   2.101 +[0 16 0 0 2 20 95 4 10 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
   2.102 +
   2.103 +
   2.104 +;; pokeball -- 10
   2.105 +;; potion -- 95
   2.106 +[0 16 0 0 2 4 10 20 95 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
   2.107 +
   2.108 +;; pokeball -- 10
   2.109 +;; potion -- 95
   2.110 +;; antidote -- 1
   2.111 +
   2.112 +;;prediction
   2.113 +;;[0 16 0 0 3 4 10 20 95 ?? 1 255 0 0 0 0 0 ....]
   2.114 +  [0 16 0 0 3 4 10 20 95 11 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
   2.115 +
   2.116 +
   2.117 +
   2.118 +;; now it's time to learn the item codes
   2.119 +
   2.120 +(def item-hack-3 (read-state 77557))
   2.121 +(defn show-item
   2.122 +  "Run a saved pokemon with the first item replaced by the item named
   2.123 +   by n."
   2.124 +  [n]
   2.125 +  (set-state! item-hack-3)
   2.126 +  (let [mem (memory)]
   2.127 +    (aset mem 54045 n)
   2.128 +    (write-memory! mem))
   2.129 +  (step)
   2.130 +  (->> [[] @current-state]
   2.131 +       (play-moves
   2.132 +        [[:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
   2.133 +         [] [] [] [] []])))
   2.134 +
   2.135 +
   2.136 +(defn get-item-names []
   2.137 +  (dorun (map (fn [n] (println n)
   2.138 +                (show-item n)
   2.139 +                (Thread/sleep 5000))
   2.140 +              (range 0x00 0xFF))))
   2.141 +
   2.142 +
   2.143 +
   2.144 +;; 0   garbage
   2.145 +;; 1   master-ball
   2.146 +;; 2   ultra-ball
   2.147 +;; 3   great-ball
   2.148 +;; 4   poke-ball
   2.149 +;; 5   town-map
   2.150 +;; 6   bicycle
   2.151 +;; 7   ?????
   2.152 +;; 8   safari-ball
   2.153 +;; 9   pokedex
   2.154 +;; 10  moon-stone 
   2.155 +;; 11   antidote
   2.156 +;; 12   burn-heal
   2.157 +;; 13   ice-heal
   2.158 +;; 14   awakening
   2.159 +;; 15   parlyz-heal
   2.160 +;; 16   full-restore
   2.161 +;; 17   max-potion
   2.162 +;; 18   hyper-potion
   2.163 +;; 19   super-potion
   2.164 +;; 20   potion
   2.165 +;; 21   boulderbadge
   2.166 +;; 22   cascadebadge
   2.167 +;; 23   thunderbadge
   2.168 +;; 24   rainbowbadge
   2.169 +;; 25   soulbadge
   2.170 +;; 26   marshbadge
   2.171 +;; 27   volcanobadge
   2.172 +;; 28   earthbadge
   2.173 +;; 29   escape-rope
   2.174 +;; 30   repel
   2.175 +;; 31   old amber
   2.176 +;; 32   fire-stone
   2.177 +;; 33   thunderstone
   2.178 +;; 34   water-stone
   2.179 +;; 35   hp-up
   2.180 +;; 36   protein
   2.181 +;; 37   iron
   2.182 +;; 38   carbos
   2.183 +;; 39   calcium
   2.184 +;; 40   rare-candy
   2.185 +;; 41   dome-fossil
   2.186 +;; 42   helix-fossil
   2.187 +;; 43   secret-key
   2.188 +;; 44   ?????
   2.189 +;; 45   bike-voucher
   2.190 +;; 46   x-accuracy
   2.191 +;; 47   leaf-stone
   2.192 +;; 48   card-key
   2.193 +;; 49   nugget
   2.194 +;; 50   pp-up
   2.195 +;; 51   poke-doll
   2.196 +;; 52   full-heal
   2.197 +;; 53   revive
   2.198 +;; 54   max-revive
   2.199 +;; 55   guard-spec.
   2.200 +;; 56   super-repel
   2.201 +;; 57   max-repel
   2.202 +;; 58   dire-hit
   2.203 +;; 59   coin
   2.204 +;; 60   fresh-water
   2.205 +;; 61   soda-pop
   2.206 +;; 62   lemonade
   2.207 +;; 63   s.s.ticket
   2.208 +;; 64   gold-teeth
   2.209 +;; 65   x-attach
   2.210 +;; 66   x-defend
   2.211 +;; 67   x-speed
   2.212 +;; 68   x-special
   2.213 +;; 69   coin-case
   2.214 +;; 70   oak's-parcel
   2.215 +;; 71   itemfinder
   2.216 +;; 72   silph-scope
   2.217 +;; 73   poke-flute
   2.218 +;; 74   lift-key
   2.219 +;; 75   exp.all
   2.220 +;; 76   old-rod
   2.221 +;; 77   good-rod
   2.222 +;; 78   super-rod
   2.223 +;; 79   pp-up
   2.224 +;; 80   ether
   2.225 +;; 81   max-ether
   2.226 +;; 82   elixer
   2.227 +;; 83   max-elixer
   2.228 +;; 84   B2F
   2.229 +;; 85   B1F
   2.230 +;; 86   1F
   2.231 +;; 87   2F
   2.232 +;; 88   3F
   2.233 +;; 89   4F
   2.234 +;; 90   5F
   2.235 +;; 91   6F
   2.236 +;; 92   7F
   2.237 +;; 93   8F
   2.238 +;; 94   9F
   2.239 +;; 95   10F
   2.240 +;; 96   11F
   2.241 +;; 97   B4F
   2.242 +;; 98   garbage
   2.243 +;; 99   garbage
   2.244 +;; 100   garbage
   2.245 +;; 101   garbage
   2.246 +;; 102   garbage
   2.247 +;; 103   garbage
   2.248 +;; 104   garbage
   2.249 +;; 105   garbage
   2.250 +;; 106   garbage
   2.251 +;; 107   garbage
   2.252 +;; 108   garbage
   2.253 +;; 109   garbage
   2.254 +;; 110   garbage
   2.255 +;; 111   garbage
   2.256 +;; 112   garbage
   2.257 +;; 113   garbage
   2.258 +;; 114   garbage
   2.259 +;; 115   garbage
   2.260 +;; 116   garbage
   2.261 +;; 117   garbage
   2.262 +;; 118   garbage
   2.263 +;; 119   4
   2.264 +;; 120   garbage
   2.265 +;; 121   garbage
   2.266 +;; 122   slow
   2.267 +;; 123   garbage
   2.268 +;; 124   garbage
   2.269 +;; 125   garbage
   2.270 +;; 126   garbage
   2.271 +;; 127   garbage
   2.272 +;; 128   garbage
   2.273 +;; 129   garbage
   2.274 +;; 130   garbage
   2.275 +;; 131   slow
   2.276 +;; 132   slow
   2.277 +;; 133   garbage
   2.278 +;; 134   slow
   2.279 +;; 135   garbage
   2.280 +;; 136   garbage
   2.281 +;; 137   slow
   2.282 +;; 138   garbage
   2.283 +;; 139   garbage
   2.284 +;; 140   garbage
   2.285 +;; 141   slow
   2.286 +;; 142   garbage
   2.287 +;; 143   garbage
   2.288 +;; 144   garbage
   2.289 +;; 145   garbage
   2.290 +;; 146   garbage
   2.291 +;; 147   garbage
   2.292 +;; 148   garbage
   2.293 +;; 149   garbage
   2.294 +;; 150   slow
   2.295 +;; 151   garbage
   2.296 +;; 152   Q
   2.297 +;; 153   garbage
   2.298 +;; 154   garbage
   2.299 +;; 155   garbage
   2.300 +;; 156   garbage
   2.301 +;; 157   garbage
   2.302 +;; 158   garbage
   2.303 +;; 159   garbage
   2.304 +;; 160   garbage (alaphabet)
   2.305 +;; 161   garbage
   2.306 +;; 162   garbage
   2.307 +;; 163   garbage
   2.308 +;; 164   rival's
   2.309 +;; 165   name?
   2.310 +;; 166   nickname?
   2.311 +;; 167   slow
   2.312 +;; 168   garbage
   2.313 +;; 169   slow
   2.314 +;; 170   garbage
   2.315 +;; 171   garbage
   2.316 +;; 172   garbage
   2.317 +;; 173   garbage
   2.318 +;; 174   garbage
   2.319 +;; 175   yellow
   2.320 +;; 176   ash
   2.321 +;; 177   jack
   2.322 +;; 178   new-name
   2.323 +;; 179   blue
   2.324 +;; 180   gary
   2.325 +;; 181   john
   2.326 +;; 182   garbage
   2.327 +;; 183   garbage
   2.328 +;; 184   garbage
   2.329 +;; 185   garbage
   2.330 +;; 186   slow
   2.331 +;; 187   garbage
   2.332 +;; 188   garbage
   2.333 +;; 189   garbage
   2.334 +;; 190   garbage
   2.335 +;; 191   garbage
   2.336 +;; 192   garbage
   2.337 +;; 193   garbage
   2.338 +;; 194   garbage
   2.339 +;; 195   slow
   2.340 +;; 196   HM01
   2.341 +;; 197   HM02
   2.342 +;; 198   HM03
   2.343 +;; 199   HM04
   2.344 +;; 200   HM05
   2.345 +;; 201   TM01
   2.346 +;; 202   TM02
   2.347 +;; 203   TM03
   2.348 +;; 204   TM04
   2.349 +;; 205   TM05
   2.350 +;; 206   TM06
   2.351 +;; 207   TM07
   2.352 +;; 208   TM08
   2.353 +;; 209   TM09
   2.354 +;; 210   TM10
   2.355 +;; 211   TM11
   2.356 +;; 212   TM12
   2.357 +;; 213   TM13
   2.358 +;; 214   TM13
   2.359 +;; 215   TM15
   2.360 +;; 216   TM16
   2.361 +;; 217   TM17
   2.362 +;; 218   TM18
   2.363 +;; 219   TM19
   2.364 +;; 220   TM20
   2.365 +;; 221   TM21
   2.366 +;; 222   TM22
   2.367 +;; 223   TM23
   2.368 +;; 224   TM24
   2.369 +;; 225   TM25
   2.370 +;; 226   TM26
   2.371 +;; 227   TM27
   2.372 +;; 228   TM28
   2.373 +;; 229   TM29
   2.374 +;; 230   TM30
   2.375 +;; 231   TM31
   2.376 +;; 232   TM32
   2.377 +;; 233   TM33
   2.378 +;; 234   TM34
   2.379 +;; 235   TM35
   2.380 +;; 236   TM36
   2.381 +;; 237   TM37
   2.382 +;; 238   TM38
   2.383 +;; 239   TM39
   2.384 +;; 240   TM40
   2.385 +;; 241   TM41
   2.386 +;; 242   TM42
   2.387 +;; 243   TM43
   2.388 +;; 244   TM44
   2.389 +;; 245   TM45
   2.390 +;; 246   TM46
   2.391 +;; 247   TM47
   2.392 +;; 248   TM48
   2.393 +;; 249   TM49
   2.394 +;; 250   TM50
   2.395 +;; 251   TM51
   2.396 +;; 252   TM52
   2.397 +;; 253   TM53
   2.398 +;; 254   TM54
   2.399 +;; 255   end-of-list-sentinel   
   2.400 +
   2.401 +
   2.402 +  
   2.403 +
   2.404 +  
   2.405 +  
   2.406 +