1.6.4 OpenPeripheral and Applied Energistics...

Crownz04

New Member
Jul 29, 2019
56
0
0
Alright, despite the title, want I'm trying to accomplish is real simple...

2013-11-02_183319.png

In the picture above is my AE system I'm moving into my void age. The indentation at the top I'm going to have computercraft monitors. All I want is for the monitors to display two things:

Free Space:​
100%​
Now I know OpenCCSensors merged with OpenPeripheral in 1.6. I haven't used computer craft besides the simple stuff. I know very little lua and can at least wrap peripherals and the such.​
What I'm asking I guess is a simple program to run, and the way to do it? About to jump into my test world to figure it out...​


EDIT: I was able to use Random's code found at http://pastebin.com/yXj0wfLn to get something working with terminal glasses. It shows me numbers on the glasses, and not percent, and also I'd have to wear them. We'll trying to edit out the code to work as a monitor and I'm getting this error:

startup: 73: attempt to call nil​
On line 73-75 I've editted it to say:​
cAE = monitor.addText(4,64,"0",0xFFFFFF)
mAE = monitor.addText(4,64,"0",0xFFFFFF)
divAE = monitor.addText(4,64,"|",0xFFFFFF)
I'm really at a loss now. Most places it said "bridge" I've changed to monitor, but it seems I'm wrong.​
 

Crownz04

New Member
Jul 29, 2019
56
0
0
Yeah, with the help of the computercraft forums, we came up with this...

Code:
while true do
local monitor = peripheral.wrap("left")
local mEController = peripheral.wrap("right")
local Total = mEController.getTotalBytes()
local Free = mEController.getFreeBytes()
LoCo = mEController.getFreeBytes()*100/mEController.getTotalBytes()
function round(num, idp)
  local mult = 10^(idp or 0)
  return math.floor(num * mult +0.5) / mult
  end
  function test(a, b)
  monitor.setTextScale(3)
  monitor.setCursorPos(5,4)
  monitor.write(round(a,b)
  end
monitor.setTextScale(3)
monitor.setCursorPos(3,2)
monitor.write("Free Space:")
test(LoCo,0)
sleep(120)
monitor.clear()
end

Works just fine and mostly centered on the monitors. I'm pleased with it, as simple as it is.