Yet another ascension prepare script

degrassi

New member
I was trying to find a cleaner way to have an ascension preparation script. I'm still building a list of things I want each run, and a list of things I want to get rid of.

My goal was to:
Have a list separate from the code of items
Allow me to say how many I want to keep of a particular item
Allow me to dispose of extra items in multiple ways (not just autosell them)
Acquire additional items as needed

The attached code is the result so far. It uses a map file (by default, put the lst file in the datamaps folder underneath the scripts folder) to separate out the items from the code. This map file looks like:

Code:
Knob Goblin firecracker 2 0 Gourd Item
cold hi mein 0 20 food

It breaks down like:
Item <tab> [dispose rule] <tab> [to keep] <tab> [comment]

Item is the item name, obvious enough.
[dispose rule] is what to do with numbers over the [to keep] number.
[to keep] is how many you want to have at the end.
[comment] is so you can note or group items more easily. I want to eventually use it so one of the dispose rules can be "send to (person in comments)".

It basically works like:

If [to keep] is larger than what you currently have, it goes and gets more. If [to keep] is "-1", it keeps everything you have, but won't get any more.

Anything over [to keep] is dealt with using the [dispose rule]:
Keep everything = 0
Autosell = 1
Put it in the mall = 2
Put it in my DC = 3
Use it (fantasy chests, etc) = 4
Put it in clan stash = 5


The keep everything number allows me to keep more than my [to keep] number if I want. In the above example, the [to keep] for cold hi mein is 20, so it will try to get me to have at least 20 of them, but because the dispose code is 0, if I have more than 20, it'll keep them as well.

When counting, it counts items in storage, in your inventory, and in your closet, but not in your DC.

This keeps my data from my code, and allows me to both dispose of items and acquire new items in the same script.

I slimmed down my preparelist.lst file and changed the comments to hopefully be more clear and helpful.

Also, if you really want to see it working, there is a VERBOSE flag in the script you can turn on for all sorts of messages while it does its thing.


Comments/suggestions welcome.
 

Attachments

  • prepare.ash
    3.9 KB · Views: 164
  • preparelist.lst
    374 bytes · Views: 148

MagiNinjA

New member
I like this!

One question. Do you think you could add on an inventory dispose rule? Like, if quantity is less than to keep quantity, get this many more from mall, DC, closet?

Or maybe not. Hmm...
 

hippymon

Member
[quote author=MagiNinjA link=topic=659.msg6105#msg6105 date=1194755390]
I like this!

One question. Do you think you could add on an inventory dispose rule? Like, if quantity is less than to keep quantity, get this many more from mall, DC, closet?

Or maybe not. Hmm...
[/quote]
That, i believe, is possible by replacing these 2 lines:
Code:
	if (item_amount(it) < num)
		take_closet(num-item_amount(it),it);
	
	if (item_amount(it)<num)
		take_storage(num-item_amount(it),it);
with
Code:
	if (item_amount(it)<num)
		retrieve_item(num-item_amount(it),it);
 
Top