I am trying to use the computer access port from the Big Reactors mod to be able to access my reactor through a computer, but something doesn't seem to be working. I want to use the .getEnergyProducedLastTick function(?) and print it as a string, but when it is printed, it is printed as a nil value, meaning that it either crashes the program, or when I use the tostring() function(?) it shows me a weird set of numbers and letters. What am I doing wrong? Here are the two programs I am using. One of them is for a computer connected to a monitor, the other is for the computer connected to the reactor.
monitor computer:
mon = peripheral.wrap("top")
mon.clear()
connect = peripheral.wrap("back")
connect.open(25565)
local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
if message == "connected" then
mon.clear()
mon.setTextScale(1.4)
mon.setCursorPos(10,2)
mon.write("CONNECTED TO REACTOR!")
connect.transmit(25565,25565, "iw")
os.sleep(2)
mon.clear()
end
repeat
local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
connect.transmit(25565, 25565, "it")
mon.clear()
mon.setTextScale(1)
mon.setCursorPos(1,1)
mon.write("The Current Amount of")
mon.setCursorPos(1,2)
mon.write("Fuel is:", message)
print(message)
until message == 0
if message == 0 then
mon.clear()
mon.setCursorPos(1,1)
mon.write("OUT OF FUEL!!!!")
end
and the reactor computer,
connect = peripheral.wrap("right")
connect.open(25565)
reactor = peripheral.wrap("front")
if reactor.getConnected() == true then
connect.transmit(25565,25565,"connected")
sleep(1)
end
repeat
fAmount = reactor.getFuelAmount
Amount = tostring(fAmount)
connect.transmit(25565,25565, Amount)
sleep(1)
until fAmount == 0
in this exact example I am actually using the get fuel amount function(?). Oh, and by the way, each (?) after the word function is me asking if that is the right word to use for that line of code.