# HG changeset patch # User Robert McIntyre # Date 1333517744 18000 # Node ID d604bd3c122c554fd13ab4e0d923922fb61d2ea6 # Parent af86b5ba622b7f3f4bfdbd82e5c24d8ceecf56b3 added function to determine wuantity of items currently selected diff -r af86b5ba622b -r d604bd3c122c clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Wed Apr 04 00:16:49 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Wed Apr 04 00:35:44 2012 -0500 @@ -336,6 +336,8 @@ "up-5" "down-5" "up-6"])))) + + (def item-cursor-offset-address 52262) (def item-screen-offset-address 52278) @@ -347,6 +349,24 @@ ([] (item-offset @current-state))) +(defn exp-item-selection [] + (clojure.pprint/pprint + (apply memory-compare + (map read-state + ["1-item" + "2-items" + "3-items" + "4-items" + ])))) + +(def item-quantity-selected-address 65432) + +(defn item-quantity-selected + ([^SaveState state] + (aget (memory state) item-quantity-selected-address)) + ([] (item-quantity-selected @current-state))) + + (defn buy-item "Assumes that the main item-screen is up, and buys quantity of the nth item in the list, assuming that you diff -r af86b5ba622b -r d604bd3c122c save-states/1-item.sav Binary file save-states/1-item.sav has changed diff -r af86b5ba622b -r d604bd3c122c save-states/2-items.sav Binary file save-states/2-items.sav has changed diff -r af86b5ba622b -r d604bd3c122c save-states/3-items.sav Binary file save-states/3-items.sav has changed diff -r af86b5ba622b -r d604bd3c122c save-states/4-items.sav Binary file save-states/4-items.sav has changed