Mercurial > vba-clojure
view clojure/com/aurellem/experiments/items.clj @ 105:2f8089eacab9
working on some actual assembly programs
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 13 Mar 2012 14:40:01 -0500 |
parents | 9fad96094950 |
children | 3a60bb14a64a |
line wrap: on
line source
1 ;; try just buying five potions in sequence and see what changes2 ;; each time.4 (defn common-differences [& seqs]5 (let [backbone (range (count (first seqs)))]6 (filter7 (comp (partial apply distinct?) second)8 (zipmap backbone9 (apply (partial map list) seqs)))))11 ;; trying to find how items are represented in memory13 (comment14 (def empty-inventory @current-state)16 (def one-potion @current-state)18 (def two-potions @current-state)20 (def three-potions @current-state)22 (def four-potions @current-state)24 (def five-potions @current-state)27 ;; result28 (def canidates29 (apply common-differences30 (map (comp vec memory)31 [empty-inventory one-potion two-potions three-potions32 four-potions five-potions])))34 [55875 (37 15 49 27 14 44)]35 [55876 (30 1 49 56 55 23)]36 [49158 (154 191 78 135 70 73)]37 [54087 (49 40 37 34 25 22)]38 [49160 (7 24 59 243 50 217)]39 [49704 (31 14 72 33 84 27)]40 [49162 (126 159 183 110 176 179)]41 [39984 (0 254 251 248 127 252)]42 [49904 (29 72 64 78 1 95)]43 [65491 (222 127 149 132 226 38)]44 [65492 (44 20 89 11 253 163)]45 [49335 (52 15 6 14 3 17)]46 [49720 (78 152 96 60 83 103)]47 [65304 (19 89 214 33 18 113)]48 [53561 (132 185 145 162 159 183)]49 [54046 (0 1 2 3 4 5)])51 ;;; hmmmmmm...... I guess that the potion quantities are at 54046,52 ;;;huh?56 (def item-hack (read-state 7999))58 (def item-hack2 (read-state 75882))60 (defn get-mem []61 (subvec (vec (memory @current-state)) 54040 (+ 54046 100)))64 ;; potion -- 9965 [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]67 ;; potion -- 9568 [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]70 ;; potion -- 9571 ;; pokeball -- 172 [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]74 ;; potion -- 9575 ;; pokeball -- 1076 [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]79 ;; pokeball -- 1080 ;; potion -- 9581 [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]83 ;; pokeball -- 1084 ;; potion -- 9585 ;; antidote -- 187 ;;prediction88 ;;[0 16 0 0 3 4 10 20 95 ?? 1 255 0 0 0 0 0 ....]89 [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]93 ;; now it's time to learn the item codes95 (def item-hack-3 (read-state 77557))96 (defn show-item97 "Run a saved pokemon with the first item replaced by the item named98 by n."99 [n]100 (set-state! item-hack-3)101 (let [mem (memory)]102 (aset mem 54045 n)103 (write-memory! mem))104 (step)105 (->> [[] @current-state]106 (play-moves107 [[:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []108 [] [] [] [] []])))111 (defn get-item-names []112 (dorun (map (fn [n] (println n)113 (show-item n)114 (Thread/sleep 5000))115 (range 0x00 0xFF))))117 ;; results (took about 10 minutes to generate)119 ;; 0 garbage120 ;; 1 master-ball121 ;; 2 ultra-ball122 ;; 3 great-ball123 ;; 4 poke-ball124 ;; 5 town-map125 ;; 6 bicycle126 ;; 7 ?????127 ;; 8 safari-ball128 ;; 9 pokedex129 ;; 10 moon-stone130 ;; 11 antidote131 ;; 12 burn-heal132 ;; 13 ice-heal133 ;; 14 awakening134 ;; 15 parlyz-heal135 ;; 16 full-restore136 ;; 17 max-potion137 ;; 18 hyper-potion138 ;; 19 super-potion139 ;; 20 potion140 ;; 21 boulderbadge141 ;; 22 cascadebadge142 ;; 23 thunderbadge143 ;; 24 rainbowbadge144 ;; 25 soulbadge145 ;; 26 marshbadge146 ;; 27 volcanobadge147 ;; 28 earthbadge148 ;; 29 escape-rope149 ;; 30 repel150 ;; 31 old amber151 ;; 32 fire-stone152 ;; 33 thunderstone153 ;; 34 water-stone154 ;; 35 hp-up155 ;; 36 protein156 ;; 37 iron157 ;; 38 carbos158 ;; 39 calcium159 ;; 40 rare-candy160 ;; 41 dome-fossil161 ;; 42 helix-fossil162 ;; 43 secret-key163 ;; 44 ?????164 ;; 45 bike-voucher165 ;; 46 x-accuracy166 ;; 47 leaf-stone167 ;; 48 card-key168 ;; 49 nugget169 ;; 50 pp-up170 ;; 51 poke-doll171 ;; 52 full-heal172 ;; 53 revive173 ;; 54 max-revive174 ;; 55 guard-spec.175 ;; 56 super-repel176 ;; 57 max-repel177 ;; 58 dire-hit178 ;; 59 coin179 ;; 60 fresh-water180 ;; 61 soda-pop181 ;; 62 lemonade182 ;; 63 s.s.ticket183 ;; 64 gold-teeth184 ;; 65 x-attach185 ;; 66 x-defend186 ;; 67 x-speed187 ;; 68 x-special188 ;; 69 coin-case189 ;; 70 oak's-parcel190 ;; 71 itemfinder191 ;; 72 silph-scope192 ;; 73 poke-flute193 ;; 74 lift-key194 ;; 75 exp.all195 ;; 76 old-rod196 ;; 77 good-rod197 ;; 78 super-rod198 ;; 79 pp-up199 ;; 80 ether200 ;; 81 max-ether201 ;; 82 elixer202 ;; 83 max-elixer203 ;; 84 B2F204 ;; 85 B1F205 ;; 86 1F206 ;; 87 2F207 ;; 88 3F208 ;; 89 4F209 ;; 90 5F210 ;; 91 6F211 ;; 92 7F212 ;; 93 8F213 ;; 94 9F214 ;; 95 10F215 ;; 96 11F216 ;; 97 B4F217 ;; 98 garbage218 ;; 99 garbage219 ;; 100 garbage220 ;; 101 garbage221 ;; 102 garbage222 ;; 103 garbage223 ;; 104 garbage224 ;; 105 garbage225 ;; 106 garbage226 ;; 107 garbage227 ;; 108 garbage228 ;; 109 garbage229 ;; 110 garbage230 ;; 111 garbage231 ;; 112 garbage232 ;; 113 garbage233 ;; 114 garbage234 ;; 115 garbage235 ;; 116 garbage236 ;; 117 garbage237 ;; 118 garbage238 ;; 119 4239 ;; 120 garbage240 ;; 121 garbage241 ;; 122 slow242 ;; 123 garbage243 ;; 124 garbage244 ;; 125 garbage245 ;; 126 garbage246 ;; 127 garbage247 ;; 128 garbage248 ;; 129 garbage249 ;; 130 garbage250 ;; 131 slow251 ;; 132 slow252 ;; 133 garbage253 ;; 134 slow254 ;; 135 garbage255 ;; 136 garbage256 ;; 137 slow257 ;; 138 garbage258 ;; 139 garbage259 ;; 140 garbage260 ;; 141 slow261 ;; 142 garbage262 ;; 143 garbage263 ;; 144 garbage264 ;; 145 garbage265 ;; 146 garbage266 ;; 147 garbage267 ;; 148 garbage268 ;; 149 garbage269 ;; 150 slow270 ;; 151 garbage271 ;; 152 Q272 ;; 153 garbage273 ;; 154 garbage274 ;; 155 garbage275 ;; 156 garbage276 ;; 157 garbage277 ;; 158 garbage278 ;; 159 garbage279 ;; 160 garbage (alaphabet)280 ;; 161 garbage281 ;; 162 garbage282 ;; 163 garbage283 ;; 164 rival's284 ;; 165 name?285 ;; 166 nickname?286 ;; 167 slow287 ;; 168 garbage288 ;; 169 slow289 ;; 170 garbage290 ;; 171 garbage291 ;; 172 garbage292 ;; 173 garbage293 ;; 174 garbage294 ;; 175 yellow295 ;; 176 ash296 ;; 177 jack297 ;; 178 new-name298 ;; 179 blue299 ;; 180 gary300 ;; 181 john301 ;; 182 garbage302 ;; 183 garbage303 ;; 184 garbage304 ;; 185 garbage305 ;; 186 slow306 ;; 187 garbage307 ;; 188 garbage308 ;; 189 garbage309 ;; 190 garbage310 ;; 191 garbage311 ;; 192 garbage312 ;; 193 garbage313 ;; 194 garbage314 ;; 195 slow315 ;; 196 HM01316 ;; 197 HM02317 ;; 198 HM03318 ;; 199 HM04319 ;; 200 HM05320 ;; 201 TM01321 ;; 202 TM02322 ;; 203 TM03323 ;; 204 TM04324 ;; 205 TM05325 ;; 206 TM06326 ;; 207 TM07327 ;; 208 TM08328 ;; 209 TM09329 ;; 210 TM10330 ;; 211 TM11331 ;; 212 TM12332 ;; 213 TM13333 ;; 214 TM13334 ;; 215 TM15335 ;; 216 TM16336 ;; 217 TM17337 ;; 218 TM18338 ;; 219 TM19339 ;; 220 TM20340 ;; 221 TM21341 ;; 222 TM22342 ;; 223 TM23343 ;; 224 TM24344 ;; 225 TM25345 ;; 226 TM26346 ;; 227 TM27347 ;; 228 TM28348 ;; 229 TM29349 ;; 230 TM30350 ;; 231 TM31351 ;; 232 TM32352 ;; 233 TM33353 ;; 234 TM34354 ;; 235 TM35355 ;; 236 TM36356 ;; 237 TM37357 ;; 238 TM38358 ;; 239 TM39359 ;; 240 TM40360 ;; 241 TM41361 ;; 242 TM42362 ;; 243 TM43363 ;; 244 TM44364 ;; 245 TM45365 ;; 246 TM46366 ;; 247 TM47367 ;; 248 TM48368 ;; 249 TM49369 ;; 250 TM50370 ;; 251 TM51371 ;; 252 TM52372 ;; 253 TM53373 ;; 254 TM54374 ;; 255 end-of-list-sentinel