comparison clojure/com/aurellem/run/bootstrap_0.clj @ 321:af86b5ba622b

created function to determine total item-offset
author Robert McIntyre <rlm@mit.edu>
date Wed, 04 Apr 2012 00:16:49 -0500
parents 9637a0f52e7b
children d604bd3c122c
comparison
equal deleted inserted replaced
320:9637a0f52e7b 321:af86b5ba622b
333 "up-2" "down-2" 333 "up-2" "down-2"
334 "up-3" "down-3" 334 "up-3" "down-3"
335 "up-4" "down-4" 335 "up-4" "down-4"
336 "up-5" "down-5" 336 "up-5" "down-5"
337 "up-6"])))) 337 "up-6"]))))
338 338
339 (def item-cursor-offset-address 52262)
340 (def item-screen-offset-address 52278)
341
342 (defn item-offset
343 ([^SaveState state]
344 (let [mem (memory state)]
345 (+ (aget mem item-screen-offset-address)
346 (aget mem item-cursor-offset-address))))
347 ([] (item-offset @current-state)))
339 348
340 349
341 (defn buy-item 350 (defn buy-item
342 "Assumes that the main item-screen is up, and buys 351 "Assumes that the main item-screen is up, and buys
343 quantity of the nth item in the list, assuming that you 352 quantity of the nth item in the list, assuming that you