QuietStorm 1 Posted June 24, 2017 Share Posted June 24, 2017 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 Quote Link to post Share on other sites
Nexarius 18 Posted June 25, 2017 Share Posted June 25, 2017 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). Quote Link to post Share on other sites
Molinko 43 Posted June 26, 2017 Share Posted June 26, 2017 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()'. Quote Link to post Share on other sites
QuietStorm 1 Posted June 30, 2017 Author Share Posted June 30, 2017 @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! Quote Link to post Share on other sites
Toskin 0 Posted September 13, 2017 Share Posted September 13, 2017 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 Quote Link to post Share on other sites
ErickSantos12 0 Posted October 22, 2017 Share Posted October 22, 2017 How to use it? how to connect is to my kinetic generator or my nuclear generator? Quote Link to post Share on other sites
Toskin 0 Posted October 22, 2017 Share Posted October 22, 2017 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. Quote Link to post Share on other sites
ErickSantos12 0 Posted October 22, 2017 Share Posted October 22, 2017 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! Quote Link to post Share on other sites
Toskin 0 Posted October 22, 2017 Share Posted October 22, 2017 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). Quote Link to post Share on other sites
ErickSantos12 0 Posted October 22, 2017 Share Posted October 22, 2017 i got another problem Quote Link to post Share on other sites
Toskin 0 Posted October 22, 2017 Share Posted October 22, 2017 26 minutes ago, ErickSantos12 said: i got another problem 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. Quote Link to post Share on other sites
ErickSantos12 0 Posted October 22, 2017 Share Posted October 22, 2017 22 minutes ago, Toskin said: Best answer I can give. Lol I forget i'm using 1.7.10 sorry, thanks for help, I gonna try it in latest version possible Quote Link to post Share on other sites
Mycyyyyael 0 Posted October 22, 2017 Share Posted October 22, 2017 Hi, when i launch the program he say : "This programe requires at least (1) reactor [...]" You know why? Quote Link to post Share on other sites
ErickSantos12 0 Posted October 22, 2017 Share Posted October 22, 2017 It works in 1.12.2? Quote Link to post Share on other sites
Mycyyyyael 0 Posted October 22, 2017 Share Posted October 22, 2017 Yes Quote Link to post Share on other sites
ErickSantos12 0 Posted October 23, 2017 Share Posted October 23, 2017 8 hours ago, Mycyyyyael said: Yes i have the same error Quote Link to post Share on other sites
The Cheshire 0 Posted January 15, 2018 Share Posted January 15, 2018 Its too big to paste all at once, is there a code I can use? Quote Link to post Share on other sites
Michiyo 28 Posted January 15, 2018 Share Posted January 15, 2018 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 Quote Link to post Share on other sites
Drinkbeer 0 Posted February 23, 2018 Share Posted February 23, 2018 guys, someone have some issues with the screen? i mean the screen have a reset loop after all statistics are loaded. how can i fix this? Quote Link to post Share on other sites
Daddawg75 0 Posted February 26, 2018 Share Posted February 26, 2018 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. Quote Link to post Share on other sites
Daddawg75 0 Posted March 6, 2018 Share Posted March 6, 2018 On 10/22/2017 at 3:17 AM, ErickSantos12 said: i got another problem anyone have any ideas? Quote Link to post Share on other sites
Daddawg75 0 Posted March 13, 2018 Share Posted March 13, 2018 OK I'm an idiot, I forgot to connect the turbines. lol. So was there a fix posted for the flickering screen? If so i missed it. Quote Link to post Share on other sites