This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Nio9345's profile picture

A little help with my Reactor Control Program.....

Started by Nio9345, 28 May 2014 - 05:40 AM
Nio9345 #1
Posted 28 May 2014 - 07:40 AM
I need some help with my program, it's working ok for alpha version, but I need some pointers and advices so I can make it a little better. The reactor is from Big Reactors with 17 Rod Controls. So here is my program : http://pastebin.com/7fwKiJBA

The more important thinks I have problem with are:

1) I can't make it display correctly on external monitor, it just shows one line of all the info I want to print and only what I wrote in the ".." and nothing else.
2) Still can't make the wired modem work for remote connection.
3) A better way to automate the proccess of fuel consumption so I don't use too much blutonium, a bit of extra info I use my reactor to power up the Laser Drill of Minecraft Reloaded.

Any extra pointers and advices are welcome and please no smarta*s jokes, I first began programming in computercraft the previous week.
Bomb Bloke #2
Posted 29 May 2014 - 04:32 AM
When dealing with an external monitor's output functions directly (via eg mon.write), line breaks aren't performed automatically for you. Eventually your text will get long enough that the line goes out the side of the screen, at which point it just keeps going while out of sight.

Probably the easiest way around this is term.redirect(). Once you've used it, all text output goes to the specified display, meaning you can easily make use of "print" and the like (which does perform line breaks for you) without having to write equivalents yourself.

Note that you'll get better spacing if you use double dots to join your strings, like so:

print("Reactor Fuel Level is " .. reactor.getFuelAmount() .. "mB.")

To get a wired modem going, connect one to your peripheral block, another to your computer, then string network cable between them. Then use (typically right-click) the modems to activate them - a red border should appear on each as you turn them on, along with a chat message telling you the network name of the device they're connected to.

Once both modems are activated, you can then wrap the peripheral according to the name that you saw in the chat message. Eg, with the first monitor in your network, you'll typically see a name of "monitor_0", and so you'd use something like:

local mon = peripheral.wrap("monitor_0")

I'm afraid I've not played with reactors myself and so can't comment on fuel usage.
Lyqyd #3
Posted 29 May 2014 - 07:06 AM
Also, please note that you don't need to right-click the modem attached to the computer itself unless you want to be able to use that computer's peripheral methods (turnOn, reboot, etc) across the wired network.

What exactly are you looking for in regards to fuel usage? Are you trying to run at a constant output to feed your laser, or are you trying to optimize for RF/ingot and run in bursts?
Nio9345 #4
Posted 29 May 2014 - 03:31 PM
Thank you Hobbyist Coder for the tips, also thank you Lua Liquidator for the extra tip on wired modems. What I'm looking for is a way to automate my Reactor to produce enough energy to keep the internal battery full but also to be able to automate the fuel consumption. ETC. while I use the reactor for the laser drill the Control Rods are at 70% down (that is not in the program because I was testing the Rod Control command) but if I want to put redstone furnaces, I want to make it automaticly detect that the power I consume increases and put the control rods at 60% and going further when I use more power until if the internal battery starts to drain completely with the Rods at 0% to shutdown the reactor, since the temprature is still not a factor to destroy the reactor.