Inventory Script Request

johngnash

Member
I understand this script may be more cumbersome, so I am offering a Mr. A, if the author wishes one. Now onto the script, and what Im looking for. I would like a script that when run, goes through your inventory, item by item. It then for each item prompt you with how many are in your display case, how many in inventory and ask if you want all of an item on display, and if not it will ask you how many you want in your display case. It then will ask you if you want to keep the rest, and if not how many, and place the rest in the mall.

That much is prolly easy, but here is the tricky part. I want it to create a database of items that you do this to. So once i tell it to display to display all my fake hands, 1 salty dog, none of my herb brownies, and display 11 martini's, keep 3, and mall the rest, it will add all those to a file and remember those preferances.

The last bit is id like an easy way of clearing the data if needed, so prolly it would save all that info in a diff from the other data files.

Any other cool features anyone thinks of would be awesome, but that is what i'm looking for.
 

mredge73

Member
problem...
mafia does not allow user input for integers

It can only ask you yes or no questions (ok or cancel), so it cannot ask you how many you want in your display case or how many you want to place in the mall.
the work around would be if you would create a file beforehand that it can read with your preferences already set.

other than that your request is not that difficult to build...
 

johngnash

Member
then how does eatdrink ask for desired drunkenness/fullness.

The hard part for me is the database usage.... The rest i could spend a few weeks tinkering with, but im lousy on accessing files outside of a program. Its why i stopped being a comp sci major.

If anyone has any ideas im all ears. My idea is to effectivly make a learning script for inventory, one that adjusts the display case, inventory and mall (while ignoring stash and closet) you your personal preferances. Someone may have some really cool way of doing just that.
 
Last edited:
problem...
mafia does not allow user input for integers

It can only ask you yes or no questions (ok or cancel), so it cannot ask you how many you want in your display case or how many you want to place in the mall.

I've started scripting a workaround for this. I will not however be able to continue working on it until I get back from Christmas vacation. It does prompt for an integer for every item as you have requested.
 

johngnash

Member
Cool. Im not in a rush for the script, I was just realizing that i was having a hard time managing my inventory, display case, and mall (since this crimbo gave me the possibility of getting my TP trophies, but it dont want to lose my TP crimbo's when i get ready to sell the non crimbo ones. Ive managed, but realized it would be cool to get script like this, and id bet alot of people would love being able to run it once a run or once a week or somethnig like that, to move everything to where "it should be"
 

Bale

Minion
Ironically, creating the database listing your choices for next time is the easy part and getting the integer input is the hard part. :)

I also know how to make mafia prompt for an integer, but since That FN Ninja has already called dibs on the Mr. A, I suppose I should leave it to him.
 

johngnash

Member
Ironically, creating the database listing your choices for next time is the easy part and getting the integer input is the hard part. :)

I also know how to make mafia prompt for an integer, but since That FN Ninja has already called dibs on the Mr. A, I suppose I should leave it to him.

You could always ninja it ;)

Im just glad to see so many people willing to help. I cant wait (well i can, but i guess its more im eager) till the code is put up for people to pick apart, and start optimizing. Ive scripted alot of stuff for myself, taking snippits from other peoples works, but am lost on a project like this.
 

Bale

Minion
I started working on this script because I was curious to work out some of the issues.

That lead me to this question: What about items in your closet and equipped gear? Just ignore them and leave them alone or consider them as part of your inventory and ask to move them to display case also?
 
Last edited:

johngnash

Member
I was thinking closet would be left alone, sothat you can temp bypass the script.... I know alot of people keep NS stuff in theirs.

But there really wouldnt be any issue with including closet, Id prolly just have it check before mallselling.

As for equiped items, those most likely should be included, since equips change around so much and youd want to make sure to have "the right ammount" onhand
 

Bale

Minion
It would be easier to just leave the closet alone, so I'll go with the idea that closet is off-limits.
 
Ironically, creating the database listing your choices for next time is the easy part and getting the integer input is the hard part. :)

I also know how to make mafia prompt for an integer, but since That FN Ninja has already called dibs on the Mr. A, I suppose I should leave it to him.

No dibs. Bale, go right ahead. I've started scripting a work around for the integer input because I was interested, but I'm out of town for Christmas and can't do anything right now.
 

Bale

Minion
I'm just fooling around in my spare time, so I'm also not certain how soon I'll be done, but probably in a few days.
 

johngnash

Member
Ninja has sent me a file, So the Mr. A is his once I can check it.

Thank you all for helping, and once We have got it working, Im sure Ninja will share it with the world.

Happy New Year
 
Yeah. Here is the file I sent to johngnash a couple of days a go when I got back. I wanted him to see if it's what he wanted.

in_control.ash v1

requires r7944 or later.

Just extract the contents of the zip to your scripts folder and run the in_control.ash file. Because of the nature of the foreach loop and it's interaction with the user prompts to abort the script it is necessary to press the esc key 2 times fast.

All the preferences are saved in the data folder in a file called in_control_prefs.txt The file consists of 3 columns:

Code:
item                 amount to display                amount to keep
The second two can be any positive integer or an asterisk (*) to indicate all. You can change the prefs manually by editing the file or you can use the alias that clears prefs and then re-run the script.

This allows you to use the script for one item or a few items at a time:
alias ic => ash import<in_control.ash> foreach s in $strings[%%] clean(to_item(s));

This allows you to check item preferences:
alias icp => ash import<in_control.ash> foreach s in $strings[%%] pref(to_item(s));

This allows you to clear item preferences:
alias icc => ash import<in_control.ash> foreach s in $strings[%%] pref_clear(to_item(s));

This script in its current form mall sells everything you do not want displayed and that you do not want to keep on-hand, thus requiring a store in the Mall of Loathing. A third action string could be added to the record to indicate what to do with extra of the item (besides mall sell), but since I use Bale's OCD script I had no need for this. I tried to stick as close to johngnash's specifications as I could. I'm sure Bale came up with a much more elegant solution to this, but here's what I scripted.
 

Attachments

  • in_control.zip
    2.4 KB · Views: 46
Top