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

Computercraft Big Reactors and an update.

Started by YoShIWoZ, 14 August 2014 - 07:05 PM
YoShIWoZ #1
Posted 14 August 2014 - 09:05 PM
Hello out there fellow computercrafters!
So i've been fiddeling around with computercraft a lot, and decided to make a monitoring station in my powerplant where i have my big reactor turbines.
It all worked perfect, untill i updated big reactors.
We used to run with Big Reactors 0.3.0A, but decided to update to the newest version currently: Big Reactors 0.3.4A2.
After the udpate my program stopped working, it's as if it doesn't see the computer port.
When i start my program i get the error: startup:5: attempt to index ? (a nil value)
This is the code i'm using:

--Turbine1
turbine1 = peripheral.wrap("back")
function sendInfo()
while true do
  active = turbine1.getActive()		  -- |Boolean   | Returns true if the turbine is active (consuming hot fluid and generating power), false otherwise.
  energyStored = turbine1.getEnergyStored()	   -- |Integer   | Returns the amount of energy stored in the Multiblock Turbine's internal energy buffer, in Redstone Flux (RF) units
  rotorSpeed = turbine1.getRotorSpeed()	    -- |Float    | Returns the rotational velocity of the Multiblock Turbine's rotor, in Rotations Per Minute (RPMs)
  inputAmount = turbine1.getInputAmount()	   -- |Integer   | Returns the amount of fluid contained in the Multiblock Turbine's hot-fluid intake tank, in milli-buckets (mB)
  inputType = turbine1.getInputType()	    -- |String or Nil| Returns the Fluid Dictionary name of the fluid contained in the Multiblock Turbine's hot-fluid intake tank, or Nil if the tank is empty
  outputAmount = turbine1.getOutputAmount()	  -- |Integer   | Returns the amount of fluid contained in the Multiblock Turbine's effluent outlet tank, in milli-buckets (mB)
  outputType = turbine1.getOutputType()	   -- |String or Nil| Returns the Fluid Dictionary name of the fluid contained in the Multiblock Turbine's effluent outlet tank, or Nil if the tank is empty
  fluidAmountMax = turbine1.getFluidAmountMax()	 -- |Integer   | Returns the maximum amount of fluid which the Turbine's fluid tanks may contain, in milli-buckets (mB)
  fluidFlowRate = turbine1.getFluidFlowRate()	  -- |Integer   | Returns the amount of hot fluid which the turbine consumed in the last tick, in milli-buckets (mB)
  fluidFlowRateMax = turbine1.getFluidFlowRateMax()    -- |Integer   | Returns the user setting governing the maximum desired amount of fluid for the Multiblock Turbine to consume per tick, in milli-buckets (mB)
  fluidFlowRateMaxMax = turbine1.getFluidFlowRateMaxMax()   -- |Integer   | Returns the maximum permissible user setting for the desired fluid flow rate, in milli-buckets (mB). Normally returns 2000 mB
  energyProducedLastTick = turbine1.getEnergyProducedLastTick() -- |Float	 | Returns the amount of energy the Multiblock Turbine produced in the last tick, in Redstone Flux (RF) units
  --inductorEngaged = turbine1.getInductorEngaged()    -- |Boolean   | Returns true if the Multiblock Turbine's induction coils are engaged, false otherwise.
  term.clear()
  term.setCursorPos(1,1)print("Active:")term.setCursorPos(8,1)print(active)
  term.setCursorPos(1,2)print("EnergyStored:")term.setCursorPos(14,2)print(energyStored)
  term.setCursorPos(1,3)print("RotorSpeed:")term.setCursorPos(12,3)print(rotorSpeed)
  term.setCursorPos(1,4)print("InputAmount:")term.setCursorPos(13,4)print(inputAmount)
  term.setCursorPos(1,5)print("InputType:")term.setCursorPos(11,5)print(inputType)
  term.setCursorPos(1,6)print("OutputAmount:")term.setCursorPos(14,6)print(outputAmount)
  term.setCursorPos(1,7)print("OutputType:")term.setCursorPos(12,7)print(outputType)
  term.setCursorPos(1,8)print("MaxFluidAmount:")term.setCursorPos(16,8)print(fluidAmountMax)
  term.setCursorPos(1,9)print("FluidFlowRate:")term.setCursorPos(15,9)print(fluidFlowRate)
  term.setCursorPos(1,10)print("FluidMaxFlowRate:")term.setCursorPos(18,10)print(fluidFlowRateMax)
  term.setCursorPos(1,11)print("FluidMaxMaxFlowRate:")term.setCursorPos(21,11)print(fluidFlowRateMaxMax)
 
  sleep(10)
end
end
sendInfo()
The reason it's in a loop is because i'm in the future gonna send the data via wireless modem to another pc. which has monitors ontop of it.

Also: We updated computercraft and OpenPeripheralAddons-0.1.3 to current newest version and OpenPeripheralCore-0.3.3 to the currently newest version, and the computercraft from 1.58 to the newest version which is beyond 1.6. But since computercraft and enderIO no longer worked propperly and half my code got turned into rubbish due to too many changes, we decided to downgrade to 1.5.8, 0.1.3 and 0.3.3 again. we also copied over hte old config files.
Hope someone can help out with this.
Oh yeah, also i've tried doing lua on startup and do per = peripheral.wrap("back") and then per.getConnected()
Also tried destroyingthe computer rewrite the code on a new computer etc. nothing helped.
http://ftbwiki.org/Turbine_Computer_Port
here are the codes for the peripheral.
natedogith1 #2
Posted 14 August 2014 - 09:33 PM
What's the result of 'print(peripheral.getType("back"))'?(without the single-quotes)
YoShIWoZ #3
Posted 14 August 2014 - 09:39 PM
What's the result of 'print(peripheral.getType("back"))'?(without the single-quotes)
It gives me an empty line and then 1 under that.
YoShIWoZ #4
Posted 14 August 2014 - 09:53 PM
So i tried everything, updating openblocks and openperipheral and all that jazz to the newest for 1.5.8 still didn't work.
THEN
I updated computercraft to 1.6.3 again.
Now it works, so appearently the newest version of Big Reactors only works with 1.6.3 version of computercraft, that's really too bad. since 1.6.3 is breaking so many of my programs =(

Edit: Seems that the whole bunch of problems i had with CC 1.6.3 were related to my verdsion of MCPC+ (Now Cauldron). As soon as i updated, it fixed all the redstone problems i had. :)/>
Now the only thing i can't figure how to get working is the term.current(), since it throws the info that's supposed to be on the terminal onto the monitor. :P/>
Edited on 14 August 2014 - 09:14 PM
Dragon53535 #5
Posted 15 August 2014 - 02:36 AM
I'm assuming you're using term.redirect() right? Well if you are you can set a variable to equal the the old term, and then redirect right back to it. Example:

local mon = peripheral.wrap("back")
local oldterm = term.current()
term.redirect(mon)
print("hello") -- prints to the monitor
term.redirect(oldterm)
print("Hello Screen.") -- Prints to the computer

Most likely you were attempting to term.restore() and that was removed in 1.6.
Edited on 15 August 2014 - 12:38 AM
natedogith1 #6
Posted 15 August 2014 - 03:27 AM
I'm assuming you're using term.redirect() right? Well if you are you can set a variable to equal the the old term, and then redirect right back to it. Example:

local mon = peripheral.wrap("back")
local oldterm = term.current()
term.redirect(mon)
print("hello") -- prints to the monitor
term.redirect(oldterm)
print("Hello Screen.") -- Prints to the computer

Most likely you were attempting to term.restore() and that was removed in 1.6.
term.restore wasn't being used anywhere, the issue appears to have been incompatible versions of CC and Big Reactors
Dragon53535 #7
Posted 15 August 2014 - 03:30 AM
term.restore wasn't being used anywhere, the issue appears to have been incompatible versions of CC and Big Reactors
I was replying to his post after the main, he was talking about term.current
natedogith1 #8
Posted 15 August 2014 - 03:59 AM
I was replying to his post after the main, he was talking about term.current
oops missed that

i'd recomend something along these lines for such a thingy
local monitor=peripheral.wrap(side)
local original=term.redirect(monitor) --term.redirect returns the old result of term.current
local function printTerm(...)
  local cur=term.current()--cause we'll want to restore it afterwords
  term.redirect(original)--redirecting to the pre-monitor term
  print(...)--we don't have to implement our own print function, yay!
  term.redirect(cur)--return to the monitor term
end
Edited on 15 August 2014 - 01:59 AM