searching through inventory (the easy way?)

razorboy

Member
I'm curious if you can search your inventory using the CLI.

I'm always digging around in the damn inventory panes, and it pains me.

I'd love to see something like:

search "naughty" or "origami"

and have it tell me if I own a piece of the naughty origami set. (I can't remember if I bought one of those or not, and each piece is in a damn different pane.)

Can I do this programmatically? Or am I stuck using the old-fashioned way?
 

Bale

Minion
I think the easiest way would be to write a script. It's a very simple script after all.
 

Mr Purple

Member
The simplest script I can think of would be something along the lines of:

Code:
void main( item inventory_search )
{
     print( item_amount( inventory_search ) );
}

This should print the number of whatever item you type in. Note it will only "search" your inventory, not your closet, hangks, dc, etc. I'm sure you can elaborate on this to better suit your needs!
 

Bale

Minion
Okay, rather than just say it is simple, I made the actual script. I think it does a tiny bit more than you explained, but that should be okay. I also suspect that there is a better way of writing it, but that should be okay also.

Code:
[COLOR="Olive"]> foldable great ball[/COLOR]

You have 1 flaming pink shirt.

[COLOR="#808000"]> foldable spooky[/COLOR]

You have 1 Spooky Putty sheet.

[COLOR="#808000"]> foldable mitre[/COLOR]

You have 1 Spooky Putty sheet.

[COLOR="#808000"]> foldable berglet[/COLOR]

You have 2 ice sicklen.
You can name a part of any of the forms that the item takes and it will look for every form that item can take. It is not case sensitive.
 

Attachments

  • foldable.ash
    2.4 KB · Views: 52
Last edited:

Bale

Minion
Aggregate reference expected (foldable.ash, line 4)
I'm not sure what the error even means!

Do you have anything relevant in your inventory?

Anyway, I'm taking a blind stab at the problem. Let me know if this helps...

Code:
[COLOR="olive"]> foldable naughty[/COLOR]

You have 1 origami "gentlemen's" magazine.
 

Attachments

  • foldable.ash
    2.4 KB · Views: 29
Top