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

Share this post


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).

Share this post


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()'.

 

Share this post


Link to post
Share on other sites

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

Share this post


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.

Share this post


Link to post
Share on other sites
1 hour ago, Toskin said:

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.

Thanks!

Share this post


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

Thanks!

No problem. Also, if you use Mekanism fusion rector, I recommend StattenOS, it have sub-program for it.

(Yeah, shameless promotion of my favourite OC OS).

Share this post


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.

Share this post


Link to post
Share on other sites
7 hours ago, The Cheshire said:

Its too big to paste all at once, is there a code I can use?

You can just type

	wget https://pastebin.com/raw/TKZfaERy reactor.lua
	

with an internet card in the computer

Share this post


Link to post
Share on other sites

I am having the same issue as ErickSantos12 i am running 1.12.2 the direwolf20 pack and it wont run. i have installed it and type in reactor on the home prompt and gives me that error message. not sure what I'm doing wrong.

Share this post


Link to post
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

×

Important Information

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