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

Reactor / Turbine Monitor

Recommended Posts

My first crack at Lua and opencomputers. This is a small program that monitors reactors and turbines. I'm having an issue with the screen flickering as stats get updated, otherwise it works great. 

- Monitors multiple reactors and turbines

- Can auto shutdown turbines when buffer fills and restart at a set energy amount

- Can auto set Turbine flow rate and adjust accordingly when blades are added or removed

- Can power on or off individual reactors and turbines

- Insert or retract reactor control rods (multiples of 10 only)

- Many machine stats displayed

 

Again, this is my first with Lua and Opencomputer. And help with the flickering screen would be greatly appreciated!

Download

 

2017-06-24_12.34.50.png

2017-06-24_12.35.44.png

2017-06-24_12.35.11.png

2017-06-24_12.42.34.png

2017-06-24_12.34.32.png

Link to post
Share on other sites

Looks pretty good but you haven't written for which mod this is. I've looked at the code (btw you should select Lua for syntax highlighting on pastebin) and found "br_reactor" and "br_turbine" so I guess its Big Reactors.

To remove the flickering you shouldn't use term.clear() at all but instead only clear the areas that you are writing to otherwise there will be flickering because it takes time to write stuff to the entire screen.

You can increase performance (and with that reduce the time it takes to write to screen) by not having long if then elseif chains especially those long chains inside a for loop (L343) and replace those with this (havent tested it).

Link to post
Share on other sites

This looks great. Taking @Nexarius ' advice is a good idea. No term.clear(). bad, badbadbad. This makes the flicker. This angers the gods. 

Also, I would suggest using a gui library. Maybe @Gophers' GML or Zer0Galaxys' libforms. One more suggestion would definitely be, again @Nexarius suggestion, to use a lookup table rather than the long if-else chains you have set up. This would help with functions like 'reactorDataTable()' or 'captureKeys()'.

 

Link to post
Share on other sites
4 hours ago, ErickSantos12 said:

How to use it? how to connect is to my kinetic generator or my nuclear generator?

Well, this program is made for BigReactors/Extreme Reactors and they have opencomputers ports to connect you just have to add to multiblock. But considering you are mentioning kinetic generator, you are probably trying to use it with another mod. This program is BR/ER only.

Link to post
Share on other sites
26 minutes ago, ErickSantos12 said:

i got another problem
image.png.a749ef23160a358f4a3cf6bc03415b7a.png

 

On 30. 6. 2017 at 5:36 AM, QuietStorm said:

@Nexarius @Molinko

Thanks for the help. It's for extreme reactors mc 1.11.2 btw. I'll give it a go and post the results. Again, many thanks! 

 

On 13. 9. 2017 at 11:11 AM, Toskin said:

Any chance for this to work with extreme reactors on mc 1.10.2? Because when I try to run it, I get error "attempt to call global 'label' value (a nil value)" on line 110

Best answer I can give.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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