Jump to content

Looking for assistance scripting an item sorter script


totgkabu

Recommended Posts

Hi, I am currently working on an item sorter for my house mod, it consists of 2 parts

  • The item sorter. - This bit works
  • Updating of the sort lists with any new items in containers (no need to update lists when adding mods)- This bit does not work :( -

The way it should work is to

  1. Look in a container X for any refs not on formlist X
  2. If one is found add the ref to formlist X
  3. Check formlists W, Y and Z for the ref and remove it if found.
  4. If ref was found in W, Y or Z check the matching containers for the items and move them to X if they exist

Sounds simple enough, the problem I am having is querying the container for its contents, I am looking for a function that will return the total number of items in a container and their index position so i can loop through them (I have looked through the wiki but can't seem to find anything).

 

My other (less preferable option) would be to have a script on the container that would catch any items added or removed from it and update a formlist with the refs so I can mirror the container contents to perform the query against. Not tried this so I am not yet sure how feasible it is.

 

Any help or alternative ideas on implementation would be appreciated.

 

TOTG Kabu.

Link to comment
Share on other sites

The functions that you're looking for have been implemented in the latest FOSE beta. The documentation hasn't been updated just yet, but here's a link to a post in the official release thread with some rudimentary documentation - Documentation

 

You'll be wanting to use GetNumItems and GetInventoryObject.

 

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...