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

Fixing direwolf20 reactor code.

Started by luckcolors, 02 December 2015 - 03:32 PM
luckcolors #1
Posted 02 December 2015 - 04:32 PM
Hello guys.
I already made a thread last year with fixing it for 1.6.4 tekkit.
http://www.computerc...__1#entry202474
Now i'm trying to do the same on ftb infinity 1.7.10.
There are two bug to be solved now.
1.line 8: attempt to index ? (nill value)
If i manually set "steamReactor = true"(getting rid of the error but making pointless the automated reactor type detection) i fix it.
2. The next error is with the energy cell power method (also happens with the previous fix applied).
I already tried to fix it using the previous fix which was setting "unknown" into the energy measurement power function.
It doesn't work either with capacitors from enderio or energycells from thermal expansion.
From what i can see, you're calling p.getEnergyStored and i'm not sure if it needs a parameter.

Change line 145 and 146 from this:

   energyStored = p.getEnergyStored()
   energyMax = p.getMaxEnergyStored()
to this:

   energyStored = p.getEnergyStored("unknown")
   energyMax = p.getMaxEnergyStored("unknown")
Original source of the program:
button / reactor

https://www.youtube....h?v=if4n_0DJFkY
https://www.youtube....h?v=ZCRFXRuWslY
(different Pastebins they all should be the same)

So guys i hope you can help me again with this program :P/>!
Thanks in adavance. :)/>
Edited by
Dragon53535 #2
Posted 02 December 2015 - 05:18 PM
Could you just post the one you're working on right now? Because I don't thank many of us are going to try and watch the video to find out his pastebin code for the program.
luckcolors #3
Posted 02 December 2015 - 06:26 PM
Pastebin get abEp9Jun Button and pastebin get vJ48u68i Turbine it's from a comment.
I actually checked and the two reactor codes are the same i suspect the same from the button api.
Edited on 02 December 2015 - 05:26 PM
Dragon53535 #4
Posted 02 December 2015 - 10:01 PM
The turbine code is erroring because it can't find a bigreactor reactor. did you use a computer port in the construction of the reactor?

I will say that you should make your own pastebin paste that you can edit, so that we can see exactly what you see. Because I have no way to know exactly what you're doing if you just tell me.
Edited on 02 December 2015 - 09:03 PM
luckcolors #5
Posted 11 December 2015 - 10:31 PM
The turbine code is erroring because it can't find a bigreactor reactor. did you use a computer port in the construction of the reactor?

I will say that you should make your own pastebin paste that you can edit, so that we can see exactly what you see. Because I have no way to know exactly what you're doing if you just tell me.

This one should be universal but for some reason it doens't autmatically detect if there's a turbine or not and act appropriately.
The error at line 7 is probably becuase the reactor api has problems.
So i overrited the check by:

--local steamReactor = r.isActivelyCooled()
local steamReactor = false
Now the error i'm try to solve is:

Turbine:307: Attempt to index ? (a nill value)
Which refers to:

energyStored = p.getEnergyStored
Also here's my pastebin version as requested by you qBr66uGi. :P/>
Edited on 11 December 2015 - 11:43 PM
Dragon53535 #6
Posted 11 December 2015 - 11:21 PM
More than likely you set your paste to expire, can you re paste it? I can tell you probably why the second error happened, but the reason why, or how to fix it, I can't see without your code specifically. Second error reason: p or whatever you wrapped to p, doesn't exist/is nil.
Edited on 11 December 2015 - 10:22 PM
TYKUHN2 #7
Posted 11 December 2015 - 11:52 PM
Attempting to fix DireCode? Pleeease!

There is a version of big reactors that doesn't have isActivelyCooled but it appears fairly old. (v0.2)

Line 307 refers to undocumented APIs along with the 'Unknown" energy stat, so fixing that is much harder.
Bomb Bloke #8
Posted 12 December 2015 - 12:43 AM
More than likely you set your paste to expire, can you re paste it?

Just a badly formatted link. I've repaired it.
Dragon53535 #9
Posted 12 December 2015 - 01:07 AM
Alright, lets start with this:

peripheral.find("draconic_rf_storage_0")

This and every other one, EXCEPT for the turbine, is wrong (Or at least wrong by the peripheral.find documentation). What you need to do is supply a type name, and not a specific name.
What you can do instead of peripheral.find is peripheral.wrap. Which might solve your problem.

peripheral.wrap("draconic_rf_storage_0")
--OR, technically better version:
peripheral.find("draconic_rf_storage")
Once you have that, it should get rid of your current two errors, once you change all 3 of the ones at lines 3,4, and 5.

Just a badly formatted link. I've repaired it.
Right, thanks Bomb, can't believe I didn't realize that :P/>
Edited on 12 December 2015 - 12:07 AM
luckcolors #10
Posted 12 December 2015 - 02:36 PM
Thanks! I must have forgot the url link tag. :P/>
Anyway i fixed in the way you proposed.
Also i did the same inside the button api.
Now i get the error:
Turbine:40: Attempt to index ? (a nill value)
(NOTE: the screen is attached the computer trough a netowrking cable and the computer it's not touching the screen so

local mon peripheal.find("monitor") is doing the trick.
And the Button program executed alone exits normally without errors.
)
Edited on 12 December 2015 - 01:42 PM
Dragon53535 #11
Posted 12 December 2015 - 09:01 PM
rename your button api to button (with a little b ) instead of Button (with a big b )
And edit line 1 to reflect that change.

Also, any changes that you make, can you make sure to edit the paste? It makes it much easier to actually see your progress.
Edited on 12 December 2015 - 08:03 PM
luckcolors #12
Posted 13 December 2015 - 12:42 PM
Also, any changes that you make, can you make sure to edit the paste? It makes it much easier to actually see your progress.

Thanks I'll try that but (Sorry if i go off-topic) is there a way to paste directly to my pastebin account? I don't feel like making 200 different pastes.
Lupus590 #13
Posted 13 December 2015 - 02:34 PM
You will have to use the website to edit pastes, I don't think any of the CC programs allow edits.
Bomb Bloke #14
Posted 13 December 2015 - 02:45 PM
I believe Cranium's SmartPaste did, though it seems to've disappeared from the boards.

If you're in single-player mode, take a dig into the "computers" folder in your world save - you can get at the script file directly in there.
Edited on 13 December 2015 - 01:46 PM
KingofGamesYami #15
Posted 13 December 2015 - 04:13 PM
I believe Cranium's SmartPaste did, though it seems to've disappeared from the boards.

Really?
Bomb Bloke #16
Posted 13 December 2015 - 10:29 PM
Ah, that's what I get for using the link in his profile!