Request Computer craft "startup:11 : attempt to index ? (a nil value)

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

stimon458

New Member
Jul 29, 2019
4
0
0
Hi, i recently downloaded a program from pastebin for my Big Reactor reactor, but it won't work. I pastebined it in my computer and it dosen't work. My friend got the same and it works for him but now it shows us this message : " startup:11 : attempt to index ? (a nil value)". I watch on the 11th line but it dosen't seem to have an error here. Any help will be appreciate.

Here is the pastebin: http://pastebin.com/dJQhvbAE
 

yotus

New Member
Jul 29, 2019
148
-1
0
Are you sure you changed the name "BigReactors-Reactor_1" at line 1 according to the name of the modem touching the reactor ? The number may be wrong..
 
Last edited:

stimon458

New Member
Jul 29, 2019
4
0
0
Hmm, ok. I didn't change anything in the program when i uses it so maybe it's this i'll check and i wanted to to use an other program to activate or desactivate my reactor but this one, i copied it manually from a video and when i start it, it says "attempt to call nil" and it dosen't work too. I can't give you the pastebin now cause the program isn't on it but i'll give you the pastebin later. Thank you for your help and i wish you could help me ;).
 

stimon458

New Member
Jul 29, 2019
4
0
0
Thanks you it works for my first program, i didn't even change the number i think it's the underscroll that was not at the right place.

For the second program, i finally decided to use only the first one so i'm fine, but if you want to take a look at it there it is: http://pastebin.com/FjKWrPXt
 

yotus

New Member
Jul 29, 2019
148
-1
0
Which FTB pack and version are you using ?

I tried your second program using the DW20 1.7.10, and the methods used for the cell are wrong. Here is a fixed version of the code http://pastebin.com/2BPy8mQg

The reactor should now be stopped correctly when the cell reaches 90% energy storage
 

stimon458

New Member
Jul 29, 2019
4
0
0
I'm using the same Modpack than you and, yeah thank you to solve my problems and to help me very well i appreciated your help and because of you, my reactor used like 2 yellorium in 3 days of working :). Hopelly we'll see us later ! ;)
 

Jimyh

New Member
Jul 29, 2019
11
0
0
Sorry to reopen this or even hijack it but i need help. hiya Yotis, I see that you are knowledgeable in the programming of Lua. I am running DW20 1.7.10 ver 1.0.3, I understand that there are bugs with open peripheral and trying to get his reactor program to work is troublesome. However I have managed to get all the modems connected now with out my server crashing but when it comes to running the program Reactor, it states: reactor:8: attempt to index (a nil value).
Line 8 of the code is: Local steamReactor = r.isActivelyCooled(). I believe tyhis is a function but I cannot find the use anywhere else in the code and thus struggling to find a solution, I have tried the one above but with no success. any ideas, thanks.
the pastebin I used where; XBbMUYNn button and 4qNyaPav reactor.

cheers in advance.

james
 

ratchet freak

Well-Known Member
Nov 11, 2012
1,198
243
79
it means the "r" isn't assigned null as opposed to the peripheral reference it should be.

look further up, there should be a peripheral.wrap or peripheral.find call that assigns to r that's where the error is
 

Jimyh

New Member
Jul 29, 2019
11
0
0
thanks ratchet for your reply, the code says: r = peripheral.find("BigReactors-Reactor_0")

That is the name of my reactor also, so still not sure??

Could the issue be because of the bugs in open peripheral, ie, the game crashes when you set the modems.
 

ratchet freak

Well-Known Member
Nov 11, 2012
1,198
243
79
no you need wrap

wrap uses the name while find searches for a type of peripheral and wraps it automatically
 

yotus

New Member
Jul 29, 2019
148
-1
0
Hey Jimyh,

Could you add "print(r)" at line seven in http://pastebin.com/4qNyaPav and tell me what it gives you ?

If it gives "null", then the name you used to wrap your reactor is wrong.
If it gives a name like ef972ka or similar, it means the wrapping worked, but the method you call on line 8 is unknown.

You could make a small program that loops over all the available methods of the wrapped peripheral and prints them, to see what you can call (google it if you don't know how, there are lots of examples)
 
  • Like
Reactions: Quayludious

Quayludious

New Member
Jul 29, 2019
83
0
0
Thanks for the updated program! Been using the one from the video forever and switched over to turbines today and nothing worked. total lifesaver!
 

Micheal_13

New Member
Jul 29, 2019
1
0
0
i get the same message reactor :8: attempt to index ? (a nil value) and i don't know what i'm supposed to do to fix it. can anyone help me
 

Senseidragon

Well-Known Member
May 26, 2013
703
319
88
@Micheal_13, if you're using the code @yotus posted two messages above yours, it very likely indicates that in your setup, it cannot find the connection to your Big Reactor. Check to ensure you have a wired modem connection into the computer port in the reactor and a wired modem connected to your computer. Make sure both modems are connected by a modem wire to each other, and make sure each modem is ON, indicated by a red band around each modem.

Here are a few images to show a working test setup I threw together:

v9L00Js.png
A view of the front of my test setup showing the wired modem connection from the reactor computer port to the computer. Modem is on.

hIhtQsG.png
A view of the back side of the computer, to show that modem is also on, as well as a third modem connected to a Thermal Expansion Resonant Energy Cell (I didn't have Ender IO in my current pack, so I tweaked the code to use an energy cell instead). Again, all modems are on, showing red bands.

7dO9s5P.png
Finally, just a quick snapshot of the very beginning of the reactor code @yotus posted a few messages back, with an edit to use an energy cell instead of a capacitor and I changed numCapacitors to 1 because I only had the one cell attached.

The code edits should be irrelevant to what you're trying to do, it just shows how I made that part work in case someone wondered.

tl;dr - Check to make sure your reactor is properly connected to the computer.