Accessing data stored in a text file

Scodi

New member
Hi guys,

I've been trying to get my head around scripting and I've got a couple of things that work, but now I'm stuck. Sorry if this has been answered here already, I've had a root around on the forums but can't seem to find the answer.

I'm trying to write an inventory cleaner. Basically, I want it to look at a list of things that I want to sell, work out whether they should be autosold, smashed or sold on the mall, and do whatever is most profitable. However, I want to be able to specify that I want to keep some, e.g. I will want to get rid of all but one of my eyepatches, but I always want to keep one so I can use it in my next ascension. I also want to keep a good number of large boxes (say 10) but if I've got a huge stockpile then I'd like to mall most of them.

So I want to put in a text file that will be in the format of either:

Code:
0
Disco Mask
Knob bugle

1
Eyepatch

or in the format

Code:
Disco Mask    0
Eyepatch       1

where I want to keep no disco masks and one eyepatch. How can I reference that file and pull that data out and store it as variables? Can I use comments in that file (with ##)?

If I can do this then I think I can use autosell_price, mall_price and functions in Smashlib to work out how I want to process the items.

Thanks.
 
Top