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

Calculating RF per tick (Capacitor Bank)

Started by VinylTheUnicorn, 23 May 2015 - 02:23 AM
VinylTheUnicorn #1
Posted 23 May 2015 - 04:23 AM
hello, I have what I believe to be a simple question but whose answer eludes me. how do I go about calculating RF per tick on a capacitor bank from ender io? I have the Computertronics add-on if that might add a needed function to achieve this. all help is appreciated, thanks.
valithor #2
Posted 23 May 2015 - 04:37 AM
Place a computer next to the block in question and run this code on it:

side = --# put side the block is on from the computer here in quotes like "right" or "left"
if peripheral.getMethods(side) ~= nil then
  for k,v in pairs(peripheral.getMethods(side)) do
	print(k)
  end
else
  print("Not a peripheral")
end

If the block is a peripheral, and there is a function that lets you get the RF level you can do something like this:

function getPerSec()
  var1 = getLevel() --# getLevel is not a real function, you would replace this with the one that you find if it is a peripheral
  sleep(0.05) --# sleeping for 1 tick
  var2 = getLevel() --# again doesn't exist
  print("The rate is: "..var2-var1)
end

I do doubt that it will be a peripheral though as I do not see ender IO on this list http://wiki.vex.tty....ki:computronics
Something that I am fairly certain would allow you to do this though would be openperipherals: http://www.openmods.info

edit:

Found ender IO on the list lol
Edited on 23 May 2015 - 02:44 AM
VinylTheUnicorn #3
Posted 23 May 2015 - 05:13 AM
thanks a bunch! it worked out Perfect.