r/ComputerCraft • u/SlackaGaming • Mar 05 '24
Help With ME Bridge
I'm building a program to turn my huge assortment of networked Create machines on/off when the network is / isn't crafting with them.
I seem to just get "Not Crafting" returns from the isItemCrafting() command, and I'm not experienced enough to figure out why. Can anyone please take a look and see why it won't return true? The whole thing kinda hinges on this working lol.
Link to Code:
https://pastebin.com/k5AcUpF8
Screen Output can be seen here:

3
Upvotes
2
u/SlackaGaming Mar 05 '24
This is in 1.19.2 on my Forge development server. Uses the latest CC:Tweaked, version "1.101.4". Advanced Peripherals version 0.7.33r if that helps.
2
u/NanobotZ_PL Mar 06 '24
At first glance your code should work. Most if not all of Me Bridge methods return an additional error string, I guess you could try printing it to see if there's a problem.
For example:
isCrafting, err = ME.isItemCrafting({name=DualFluidMixerProducts[i]}) print(err)Also, have you tried calling other ME Bridge methods? Maybe you could also take a look at this script, maybe it will come in handy.
2
u/fatboychummy Mar 06 '24
Just as an aside, I notice a few (minor) issues that might bite you in the future. Not related to your current problem, however:
[1]instead of[i], so it'll always print the first value.elseinstead of repeating the same if statement.Onto your problem
Looking at your code, and looking at the documentation, I can't see the reason why it's not working immediately. Though it's possible you may need to call
listCraftableItemsto get thefingerprintvalue of the item you want, and pass that toisItemCrafting.I would try u/NanobotZ_PL's method first though, check if it's returning some error string.
1
u/SlackaGaming Mar 06 '24
After a couple of tweaks and tests it seems that I've got this working. I've successfully got a valid"1.0 Crafting: mekanism:dust_charcoal" printing to the screen. Thank you NanobotZ and fatboychummy for the help!
Next, I'll be expanding it to monitor all 20-something Create machines I want monitored. Once they're in, it'll be sending to different redstone peripherals via wireless modem. This thing will turn on/off machines as needed.
I guess my last question is whether this will help server load or not. On one hand, CC uses a bunch of brainpower. On the other hand, Create machines are both visual AND ticking / item handling / speed checking entities. Some of these "machines" are also composed of up to 7 Create machines. I guess... what's worse?
Is it likely that replacing 20+ very visual machines being active with code and ME network checks going to BETTER for the server's load? Thoughts and theories?
1
u/SlackaGaming Mar 06 '24
I have a few more general questions...
What's the best way to send wireless redstone signals with CC?
I'm hoping to use the Redstone Integrator from AP to act as a "field controller" for machine activation, but I'm not sure how to reach it remotely as there's a lot of mixed info out there. If it can be done without Rednet and a second computer, that would be ideal as some locations these field controllers are quite cramped and won't accept a full computer + monitor + modem etc.
Can I slap an ender modem on it without a computer, and just send to peripheral via the modem?
I'm really unsure what works, and what is best here.