GithubHelp home page GithubHelp logo

kalazzerx / dualuniverse-oremonitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thespartacus29/dualuniverse-oremonitor

0.0 1.0 0.0 73 KB

This set of LUA scripts will help you setup screens that display ore name | quantity in tons | % of how full a container is | status color coded based on ore % levels

dualuniverse-oremonitor's Introduction

DualUniverse-OreMonitor

This set of LUA scripts will help you setup screens that display ore name | quantity in L or T | % of how full a container is | status color coded based on ore % levels

Change Log

  • 9/24/2020 - Changed default branch from Master to Main.
  • 9/19/2020 - Updated the spelling of Hematite through the T1 Scripts
  • 9/18/2020 - Added a parameter call useL which by default is set to 1. By default the Qty value now displays the amount of ore in L rather than the total mass of the ore in tons. However, you can change the useL parameter to 0 to display the mass in tons. If you want to show mass you need to set the useL parameter to 0 in each board.

Elements required

  • 5 Screens M
  • 5 Programming Boards
  • 20 Item containers
  • 1 Switch
  • 1 Relay

Control links Setup

These are the same type of links you use to link industries and containes in build mode. Each Programming board can support up to 10 links. You could modify the script/links to use less programming boards but I wanted to keep things organized/separated and also somewhat future proof if they add more ores per tier in the future.

** Important ** you must rename each slot to match the names in the scripts **

  1. Programming Board 1 control links:
  • screen (same name in each Programming board for the slot linking to the screen)
  • bauxite ( linking to containing this particular ore )
  • coal ( linking to containing this particular ore )
  • hermatite ( linking to containing this particular ore )
  • quartz ( linking to containing this particular ore )
  • switch (sends on/off signals to the relay to turn on/off all the screens and programming boards)
  1. Programming Board 2 - 5 control links:
  • screen
  • item container ( rename to match the ores in each tier )
  • item container ( rename to match the ores in each tier )
  • item container ( rename to match the ores in each tier )
  • item container ( rename to match the ores in each tier )
  1. Relay links: link the relay to each screen and programing boards 2-5. So that by activating programming board one a signal will be sent to the switch which transmits that signal to the relay and the relay turns on/of every screen/programming board at once.

Filters Setup

Under Unit add the following filters/code

  1. start() unit.setTimer("Live",1) switch.activate() ** ONLY in Programming board 1 **
  2. stop()3 switch.deactivate() ** ONLY in Programming board 1 ** screen.clear() ( not required but you can use to clear the html on the screen by deactivating the programming board linked to the screen )
  3. tick(Live) (note that the name you enter for this tick needs to match the name of the timer entered in the start() filter above )

Parameters

Each script containes two parameters per ore

  • max<> ( This value represents the maximum mass in the container for this ore. This needs to be adjusted to account for 1. the difference on talents per player and 2. if you use different size containers per ore )
  • weight<> ( Added this as a parameter just in case these values get adjusted in a future patch, it can be easily updated without touching the code )

Script setup

In the lua editor enter the code for each script that matches the programming board. i.e programming board 1 under tick enter the code in T1 script and programing board 2 enter the code for T2 script etc

Script Quick Setup

For each Tier script there is a quick setup file. The code in these files can be copied and to use simply right-click on a programming board > Advanced > Paste Lua configuration from clipboard. This will automatically name the slots, add filters and code. However, keep in mind you will still need to make the linkages and ensure each slot is linked to the correct container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.