Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Simmons928

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by Simmons928

  1. I am currently working on a program that will automatically adjust my reactor (Big Reactors). I have plans to have it control 3 separate reactors. I am working on getting the function for one of them working and after that I can modify it to work the other 2. The part that detects the number of control rods in the reactor and then get the current level and place them into tables. This allows me to modify the reactors size and not have to worry about changing the program. 

     

    I have run into a little problem relating to the actual adjustment function in this case meRodLogicInc(). Once it runs the first time it does not change the control rod levels. 

     

    EX: If it is producing more then 2500 RF then is currently being used it will kick a single control rod from say 64 to 65 thus reducing the output. However, it the production is still over 2500 it will not change the level even though it is going through the function to increase it. 

     

    Thank you for any help that you can provide. 

    function rodCount()
    meRodCount = component.invoke(meReactor, 'getNumberOfControlRods')
    
    meRodNum = 0
    
    meRodNums = {}
    meRodLevels = {}
    
    
    while meRodNum<meRodCount do
    	meRodNums[#meRodNums+1] = meRodNum
    	meRodLevel = component.invoke(meReactor, 'getControlRodLevel',meRodNums[#meRodNums])
    	meRodLevels[#meRodLevels+1] = meRodLevel
    	meRodNum = meRodNum+1
    end
    end
    function meRodLogicInc()
    meRodPoint = #meRodLevels
    meRodLevelAverage = 0
    while meRodPoint>0 do
    	meRodLevelAverage = meRodLevelAverage+meRodLevels[meRodPoint]
    	meRodPoint = meRodPoint-1
    end
    
    mePowerLevel = component.invoke(meReactor, 'getEnergyStored')
    mePowerDif = mePowerLevel-meLastPower
    
    if mePowerDif<=0 then
    	meRodLevelAverage = meRodLevelAverage/#meRodNums
    	meCurrentRodLevel = meRodLevels[meCurrentRod]
    	meRodChange = meCurrentRodLevel-1
    	meRodCurCha = meCurrentRod-1
    	component.invoke(meReactor, 'setControlRodLevel', meRodCurCha, meRodChange)
    
    end
    
    if mePowerDif>2500 then
    	meRodLevelAverage = meRodLevelAverage/#meRodNums
    	meCurrentRodLevel = meRodLevels[meCurrentRod]
    	meRodChange = meCurrentRodLevel+1
    	meRodCurCha = meCurrentRod-1
    	component.invoke(meReactor, 'setControlRodLevel', meRodCurCha, meRodChange)
    end
    meLastPower = mePowerLevel
    end
    
  2. Hello All,

     

    I am new to working with openComputers, in the past most of my work is with computercraft. I have run into a problem when it comes to working with peripherals connected by cable. I have tried a number of different methods to communicate with the peripherals with no luck. I have searched the forums as well as multiple websites. Could be that I am using the wrong keywords. If someone could assist me that would be awesome. 

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.