Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Michael

Members
  • Content Count

    3
  • Joined

  • Last visited

About Michael

  • Rank
    Junior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Michael

    Energy Stored

    Thanks for the response, as suggested I ran this code and was displayed this output So i changed my code based on this, as seen bellow but unfortunately
  2. Michael

    Energy Stored

    Hello everyone, I'm trying to set up a Opencomputers energy monitoring system that will control the energy level of an Industrialcraft2 mfsu by turning on 1 to 6 reactors but I'm having problems at the energy reading part. Here is my code so far: https://pastebin.com/654kRYaf (ignore that getEnergyStored is commented out, I was testing something and uploaded to pastebin wrong version), but here is an abbreviated version with comments: -------------start of script---------- local fill = 0 --predefine variable fill local cap = 0 --predefine variable capacity require 'normal' things (event, component, term, colors, sides) local rs = component.redstone --Redstone I/O block local mfsu = component.ic2_te_mfsu ---as shown when components is run ----------create writing------------------ ---create writing and boxes ----------reset redstone (just in case) ---- set colors used to 0 ------------------------------------------- ------------------------------------------------------------------------ while true do local _,_,x,y = event.pull("touch") -----works up to this point fill = mfsu.getEnergyStored() --find amount of energy in mfsu cap = mfsu.getMaxEnergyStored() --find capacity of mfsu print(fill, cap) ---print it (temp) --------check user clicks squares and set redstone outputs-------- --//insert computer turn on reactors here (to do later)\\-- end ---end of script--- I plan to implement code that will turn off and on the reactors depending on the amount of energy in the mfsu but I havent been able to read the amount of energy in the mfsu to be able to make the calculations. (the big empty space on the left of the screen is for a progress bar that is currently hidden, which depends on the amount of energy in the capacitor) As you can see (bellow) the code works fine until the user clicks the screen, at which point it errors, the Max energy or current energy "returns a nil" and the code discontinues running. to my understanding this means that this doesn't exist therefore what is the current terminology? I could find one that works but I wanted to make one myself. Minecraft v. 1.10.2 Age Of Engineering v. 1.1.2 (Twitch modpack) OpenComputers v. 1.7.1.150
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.