Compatibility between Gregtech 6 and OpenComputer?

Can man use OC to control Gregtech Maschinen? Can OC control LogisticsCore, detect and change Hopper setup, detect Crucible temp?

2 Likes

It can’t really control things directly but just via redstone. As for the LogisticsCore, what would you ‘expect’ OC to be able to do with it? Same with the hoppers?

1 Like

Well, I expect it can program to work like ae?

2 Likes

For example, programed auto export?

2 Likes

You can do all of that via Redstone basically, but there is no “direct” Compat with any Computer Mod.

As for the Logistics Core, yeah what would the Computer even do? I mean you can turn individual Imports/Exports/Storages ON/OFF using the Cover-Controller-Cover and Redstone, so that would be another thing. A lot of things have Redstone Compat as to make sure everything can interface with it on a common level.

1 Like

It’s purely routing based on filters and priority levels, there’s nothing really ‘to’ configure other than just, as greg said, turning on or off places, which can already be done via redstone, so I’m unsure what else would be done that isn’t already doable? Can you give a precise example?

Unsure what you mean by that, that’s what it ‘already’ does?

2 Likes

Hi. Sorry I’m late to the party. and I probably wont be back to be perfectly honest. Just stumbling my way around the internet to see if this world accelerator on my server rack is actually doing anything. It seems to be… part of the time… but i digress.

In opencomputers, blocks that can be directly interfaced with will show up on component.list() when adjacent to an adapter.
Something cool about Lua is the fact that basically everything is either a table or its on a table. (Just kidding… But theres a rediculous amount of tables for real)
functions are no different. math is a table. redstone is a table. etc. These tables are typically provided by files or components (funny story, in unix… everything is actually a file… including devices.). Blocks that act as components automatically get added to the component table (and become a table within a table). (although duplicates lose primary status… eg: arent callable by component.nameOfComponent … for example component.redstone)

So… there are multiple ways we can leverage this…

  1. get the connected components with component.list()
    Then connect an adapter to the block you want to interface with, and get the list again.
    Is there anything new? If so go into the lua interpreter (by entering the command ‘lua’ from the command line) and type compo then press tab (to autocomplete component) a period should also appear with the rest of the word component.
    So now we have component.
    (Side panel, and actually method 2 of checking for components, you can now just start pressing tab to cycle through available entries on the components table.) Im going to use an example that might be helpful, and might not (IDK whats up with gregtech 6, im on GTNH which runs gregtech 5… and quite possibly a modified version of it at that.)
    we should now have something like component.gt_machine.
    Just like above… we can cycle through everything on the gt_machine table with tab.
    Just to be clear. Any functions it exposes (commands provided by it that we can use through it only) are table values. Sometimes they leave off the () at the end of the autocomplete. Somethings its just an internal variable… like component.gt_machine.address. Sometimes its another table. Play around with it and see what functions you can reveal and what you can do with them.
    some provided functions have documentation. theres a bunch of ways of getting it. but typically entering the command without the parentheses in the lua interpreter returns information if available.

You can also just iterate over all the tables programmatically. functions aren’t ever (okay I guess typically) addressed to numbers on table. so component.gt_machine[1] will almost certainly return nil. That means we need to use pairs instead of ipairs (ipairs being usable on ordered tables… table[1] table[2] you get it)

TLDR;
connect adapter block to device you want to interface with. connect adapter to computer.
and run the file getMethods.lua

Maybe ill make an installer or something eventually… but for now instructions are in the readme

Happy coding! Oh, and technically, since you can use redstone, you can do all of those things with opencomputers using its redstone capabilities.

4 Likes

I appreciate the feedback. I’ve used both CC and OC before, but my struggle was in isolating the methods exported by GT6.

Now I have to figure out whether I can have a computer work with inventories, so I can drop items to smelt in my smelter. I know robots can work with inventories, but I was reading that an inventory card in an adapter can too.

Now to find a way to upload files from my local Emacs to my OC computer. ;]

1 Like