IntelligenceModding / Advanced-Peripherals-Features

A place for the feature request for Advanced Peripherals
0 stars 1 forks source link

Computercraft / RS Bridge - `isFluidCraftable`, `isFluidCrafting`, `getFluid` #83

Open Peekofwar opened 7 months ago

Peekofwar commented 7 months ago

Describe your idea

I recently noticed that the RS bridge is missing certain functions for fluid. With items, we have getItem(), isItemCraftable(), and isItemCrafting() for example, however there are no fluid variants of these functions for fluid.

I want to see fluid variants of these functions such as getFluid(), isFluidCraftable() and isFluidCrafting().

Describe alternatives you've considered if any

In theory I might be able to look through the fluid table or something to figure out if a pattern exists for an item or not, but then I'd have to add extra code that isn't needed for items. Implementing fluid support into my program would be much simpler if I could just use fluid variants of the functions I'm already using for items.

However, this method won't work if there is no way to detect if a fluid is already being crafted. This would result in hundreds of requests for the same fluid.

Additional context

Advanced Peripherals (v0.7.39r) Computercraft: Tweaked (v1.110.2) Forge (v47.2.21)

Linked Issues

No response

zyxkad commented 7 months ago

They should exists in latest 1.19 & 1.20

Peekofwar commented 7 months ago

Let me check if I'm up to date here...

This is the latest version.

Peekofwar commented 7 months ago

They should exists in latest 1.19 & 1.20

I couldn't find them on the WIKI page, and they don't exist in-game.

zyxkad commented 7 months ago

But they are in the code and commited three months ago. The wiki did not update for a long time yeah, but they should exists in game

Peekofwar commented 7 months ago

But they are in the code and commited three months ago. The wiki did not update for a long time yeah, but they should exists in game

Well, I checked in a live Lua prompt, and couldn't find them.

Peekofwar commented 7 months ago

But they are in the code and commited three months ago. The wiki did not update for a long time yeah, but they should exists in game

You linked to exportFluid, and a CTFL+F search didn't reveal anything for isFluid.

I'm specifically looking for the following functions: getFluid, isFluidCraftable and isFluidCrafting.

zyxkad commented 7 months ago

I'm specifically looking for the following functions: getFluid, isFluidCraftable and isFluidCrafting.

getFluid should be exportFluid if that's what you want

the other two is a problem, maybe they'll be there in the next release

Peekofwar commented 7 months ago

I'm specifically looking for the following functions: getFluid, isFluidCraftable and isFluidCrafting.

getFluid should be exportFluid if that's what you want

the other two is a problem, maybe they'll be there in the next release

Are you sure? That sounds more like moving fluids which is not what I'm looking for. getFluid() would retrieve data about the fluid similar to what getItem() does. Also, exportFluid doesn't' seem to exist on the WIKI.

zyxkad commented 7 months ago

Ok, so there is listFluid and listCraftableFluid methods you can use to replace getFluid and isFluidCraftable

Peekofwar commented 7 months ago

Ok, so there is listFluid and listCraftableFluid methods you can use to replace getFluid and isFluidCraftable

The only problem with listCraftableFluid is that I have to add a whole new section of code to parse a table, I can't just OR it into an existing condition in my code.

Ideally I'd just OR rs.isItemCraftable({name=item.name}) or rs.isFluidCraftable({name=item.name}) for example.

zyxkad commented 7 months ago

So it just an alternative solution, until the methods you want is added

Peekofwar commented 7 months ago

Ok, so there is listFluid and listCraftableFluid methods you can use to replace getFluid and isFluidCraftable

Problem, this function returns nil despite the fact that lava is craftable in my RS system.

image image

Also unsure if it reports if the fluid is already being crafted. That's another issue, is that my program needs to know if a fluid is already being crafted, otherwise you will end up with hundreds of requests for the same fluid.