#Using regular expressions to bulk hide items from REI.

6 messages · Page 1 of 1 (latest)

undone cave
#

Heyo! I tried to use a regular expression to hide items in bulk using:

REIEvents.hide('item', event => {
  const voltages = ['hv', 'ev', 'iv', 'luv', 'uv'];
  
  voltages.forEach(voltage => {
    event.hide(`gtceu:${voltage}_.*`);
  });
});

But it doesn't work, it seems they aren't supported. I just decided to list out EVERY machine manually, which isn't too bad:

REIEvents.hide('item', event => {
  const voltages = ['hv', 'ev', 'iv', 'luv', 'uv'];
  
  voltages.forEach(voltage => {
    event.hide(`gtceu:${voltage}_steam_turbine`)
    event.hide(`gtceu:${voltage}_macerator`)
    event.hide(`gtceu:${voltage}_alloy_smelter`)
    //etc etc
  });
});

But I thought I might as well ask if there is a way to use regular expressions(or any other bulk option) for... Future endeavors.

crystal briarBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

undone cave
#

I did try a bunch of other backhanded tricks to get the regular expression working, but always got hit with
"[19:23:30] [ERROR] ! Error in 'REIEvents.hide': Non [a-z0-9/.-] character in path of location: gtceu:hv.*"

#
REIEvents.hide('item', event => {
  const voltages = ['hv', 'ev', 'iv', 'luv', 'zpm', 'uv'];
  const machines = [
    'steam_turbine',
    'macerator',
    'alloy_smelter'
  ];

  voltages.forEach(voltage => {
    machines.forEach(machine => {
      event.hide(`gtceu:${voltage}_${machine}`);
    });
  });
});

REIEvents.hide('item', event => {
  const voltages = ['lv', 'mv', 'hv', 'ev', 'iv', 'luv', 'zpm', 'uv'];
  const machines = [
    'large_miner'
  ];

  voltages.forEach(voltage => {
    machines.forEach(machine => {
      event.hide(`gtceu:${voltage}_${machine}`);
    });
  });
});

I did find a slightly less cbt way to do it by mapping the machines to their own array.

undone cave
#

I found this example:

e.somekindarecipe(/create:cutting\/[^/]+_log/) //Dont use quote marks, use slashes!

Might be what I'm looking for, will try!

undone cave
#

Yup That works!