Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to monitor MSS item levels with redstone #170

Open
Gryhyphen opened this issue Aug 26, 2022 · 0 comments
Open

Way to monitor MSS item levels with redstone #170

Gryhyphen opened this issue Aug 26, 2022 · 0 comments

Comments

@Gryhyphen
Copy link

Since extracting items from MSS is currently not being considered, would it be possible to implement some sort of monitor that can interact with redstone so I can do some logistics with only inserting items into the MSS system when I am running out?

Rough idea for spec, based on https://ftb.fandom.com/wiki/Corporea_Crystal_Cube (ignore extracting items)

Remote Tally Monitor:

  • A locked container (probably a barrel?) is the base of this block. This enables it to work with redstone comparators based on how full the container is (you can fill it with a junk item).
  • To connect the remote tally monitor to the MSS, you can use the Mechanization GPS. Click on the MSS Drive Bay, then click on the Remote Tally Monitor.
  • An item frame can be placed on the Remote Tally Monitor. Whatever item you put in the item frame sets the item to be monitored. (or, alternatively, can use a filter)
  • Refresh of the tally doesn't need to be every frame, can poll every 5 seconds.
  • When a poll occurs do:
if (item frame NOT attached to Remote Tally Monitor)
    return;
if (item frame NOT contain item)
    return;
if (gpsTarget NOT EXIST)
    return;
var searchObject = getDataFromItemInItemFrame();

var searchResult = null;
for (var drive in gpsTarget):
    for (var item in drive):
        if (item.id == searchObject.id) // I dunno how you want to implement equality, edge cases with custom datapack items
            searchResult = item;
            break;
            
if (searchResult exists)
    setTallyBoxRedstoneValue(searchResult); // This inserts / remove junk items from the chest to adjust redstone level

// I'm assuming the drives themselves (searchResult) contain the NBT data on the item counts
  • Bonus points if this works with Unlimited Storage Unit.
  • Can adjust how the Remote Tally Monitor calculates it's redstone output by right clicking on the block

Implementation of a machine like this would open up the capability for some basic logistics, which is lacking from the assembly features of Mechanization, and it would be really cool!

I.e. Could make it so that an MSS system always keeps at least 64 charcoal in it, and divert the rest of it to power machines.

I'm not sure if this is less complicated then a way to extract items from an MSS system, but it seeeeeeeems like it's relatively straightforward (I say, not knowing much about mcfunction). Biggest challenges to implementation would be:
1 - searching algorithm speed
2 - equality logic for comparison (this might be alleviated by whatever code you have already in place for item filters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants