Jump to content

OreMonitor [LUA]


Zripss

Recommended Posts

 

 

 

https://github.com/GcGoat/DU-OreMonitor

Some basic Ore Monitor script to show your current stock in one or multiple screens by utilizing only one PB while having option to change what it shows on screens by simply clicking on them. Vertical or horizontal view can be picked and in case you need you can click on any tier to only show it. Multiple colors can be picked from given list while mix matching what you want, as seen from example. Databank will help out in keeping saved options next time you activate PB, so once set it will run without any need to reset it

 

 

showtime.thumb.jpg.48e1b3d6deb2e7ec2c31aebcf83a6016.jpg

Requirements:

  • Programable Board
  • Screen (M sized recommended)
  • DataBank

 

Usage: While screens are showing information you have option to click on any tier to only show that one. Additionally you have button on side of screen marked as (>) which will open settings tab like  

settings.thumb.jpg.659def29816f77369ce3d1e8ef5703f5.jpg

 

You will see 5 numeric fields, one with sign "+" and one as "R", on another side button labeled as "Reset" Numeric fields will change colors for specific areas.

First field changes progress bar colorization, first 7 options uses gradient from one color to another which will change depending on stock amount you currently have, while rest of them are static colors.

Second will define background color of progress bar

Third field will define color of text inside of progress bars.

Fourth defines main text, like ore name or tier

Fifth defines main background color

Field labeled as "+" will apply same settings on all screens connected to same PB, this is useful if you are too lazy to go trough all of them and change them to match main theme each time you adjust something

Field labeled as "R" will rotate view

On opposite side you will have "Reset" button which resets color values to default ones. This will not reset orientation or set tier which needs to be shown

 

PB Setup:

Connect Databank and Core unit to ProgramableBoard. In what order you do that doesn't mater.

Connect to screen

Copy script code from HERE (ctrl+a and then ctrl+c) go back into game, right click PB -> Advanced -> Paste Lua Configuration from Clipboard

 

Container setup:

For containers to be properly recognized you will need to rename them. Ore containers can only contain one type of ore and its name should reflect its contents, for example bauxite container needs to have name as Bauxite Ore and gold one should be as Gold nuggets Ore NOTE! If you have container hub, name it in same way as you would a regular container and then you will need to set correct value in lue variable editor to match its size, as we have no way to determine how big it is throw code.

 

Names of ore containers:

  • Bauxite Ore
  • Coal Ore
  • Hematite Ore
  • Quartz Ore
  • Chromite Ore
  • Malachite Ore
  • Limestone Ore
  • Natron Ore
  • Garnierite Ore
  • Petalite Ore
  • Acanthite Ore
  • Pyrite Ore
  • Cobaltite Ore
  • Cryolite Ore
  • Gold nuggets Ore
  • Kolbeckite Ore
  • Rhodonite Ore
  • Columbite Ore
  • Illmenite Ore
  • Vanadinite Ore

Names of pure containers:

  • Pure Aluminium
  • Pure Carbon
  • Pure Iron
  • Pure Silicon
  • Pure Chromium
  • Pure Copper
  • Pure Calcium
  • Pure Sodium
  • Pure Nickel
  • Pure Lithium
  • Pure Silver
  • Pure Sulfur
  • Pure Cobalt
  • Pure Fluorine
  • Pure Gold
  • Pure Scandium
  • Pure Manganese
  • Pure Niobium
  • Pure Titanium
  • Pure Vanadium
  • Pure Oxygen
  • Pure Hydrogen

 

Additionally you might want to check lua variables and modify couple main ones which are responsible for calculating container sizes. Right click PB -> Advanced -> Edit Lua parameters

Known issues: In case you have max amount of screens connected to one PB you might encounter issue with it using to much of CPU for initialization. This is only issue if all of them shows maximum amount of information. Work around would be to start by using only couple screens, set them to your needs and then connect rest of them

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
3 hours ago, DystopianSnowman said:

Data bank and core linked to PB.  Screen linked to PB after.

Test container renamed Quartz Ore, script copy pasted.

10 ore placed in container.

PB and screen turned on, but screen is blank.

What am I doing wrong?

 

You might simply stop and start again PB if you renamed container after you started PB, as container detection will be done only once on startup for efficiency sake. Everything else seam to work properly as of basic testing i just did. 

Link to comment
Share on other sites

I got it sorted out, and it's working now.  I probably should have known better, but I made the mistake of having the PB, DB, and screen on their own core, not the one that the containers are on.

Only issues I have now is properly calculating the sizes of containers, and the amount of resources within.

Not sure what the value for 'hub' should be.  I'm using Expanded Containers XL.

containerProficiency I have 40 in the box.  Is that correct if I have Level 4 Container Proficiency?

containerOptimatization I have 15 in the box.  Is that correct if I have Level 3 Container Optimization?

It doesn't have the proper values for the amount of the resource in it.  Neither stack amount or % are correct.

actual values (also attached images of these)
Quartz stack volume 29.99 kl  stack mass 79.47t  container volume: 4%  container Mass: 67.55 t
Hematite stack volume 47.42 kL  stack mass 239.00 t  container volume: 7%  container Mass: 203.15 t

Hematite.thumb.jpg.b3b0f2f2b748ab5ab67860e238bf2bec.jpg

Quartz.thumb.jpg.82bc8f0c3c3adc034c918c88a7376a20.jpg

container mass certainly seems to be applying the -15% reduction for the containerOptimization lvl3 skill

Here's what the screen is displaying though.

ore.thumb.jpg.9083a297ed202e43c1f582a9e95a2d0d.jpg

 

I emptied all containers, picked them up and replaced them, just in case.

Also turned off the PB, exited game completely, then logged back in.

 

Any assistance you can provide would be most appreciated.

Link to comment
Share on other sites

On 1/23/2021 at 9:09 PM, DystopianSnowman said:

I got it sorted out, and it's working now.  I probably should have known better, but I made the mistake of having the PB, DB, and screen on their own core, not the one that the containers are on.

Only issues I have now is properly calculating the sizes of containers, and the amount of resources within.

Not sure what the value for 'hub' should be.  I'm using Expanded Containers XL.

containerProficiency I have 40 in the box.  Is that correct if I have Level 4 Container Proficiency?

containerOptimatization I have 15 in the box.  Is that correct if I have Level 3 Container Optimization?

It doesn't have the proper values for the amount of the resource in it.  Neither stack amount or % are correct.

actual values (also attached images of these)
Quartz stack volume 29.99 kl  stack mass 79.47t  container volume: 4%  container Mass: 67.55 t
Hematite stack volume 47.42 kL  stack mass 239.00 t  container volume: 7%  container Mass: 203.15 t

Hematite.thumb.jpg.b3b0f2f2b748ab5ab67860e238bf2bec.jpg

Quartz.thumb.jpg.82bc8f0c3c3adc034c918c88a7376a20.jpg

container mass certainly seems to be applying the -15% reduction for the containerOptimization lvl3 skill

Here's what the screen is displaying though.

ore.thumb.jpg.9083a297ed202e43c1f582a9e95a2d0d.jpg

 

I emptied all containers, picked them up and replaced them, just in case.

Also turned off the PB, exited game completely, then logged back in.

 

Any assistance you can provide would be most appreciated.

Updated the code to include new container sizes as it was out of date and adjusted some of the ore calculations to be more accurate.

Och and just FYI you can rotate view on a screen with included settings window.

Link to comment
Share on other sites

9 hours ago, Zripss said:

Updated the code to include new container sizes as it was out of date and adjusted some of the ore calculations to be more accurate.

Och and just FYI you can rotate view on a screen with included settings window.

Thanks, works like a champ now!

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...

Constantly getting attempt to index nil value (global 'core')

 

Yes everything is linked properly, ive tried linking different ways, only linking core, everything is on the same core, idk whats going on i even tried naming the slot core, then i get (local 'core') error. any idea? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...