r/ComputerCraft • u/Drunkmonkey1186 • Jan 31 '21
<'eof'> error need help
Im building a program where i can control my IC2 reactor and itll output information to monitors currently I'm trying to get it to just start the reactor but im getting an end of file error and im new to Lua and i can't quite figure out what is causing this any help is appreciated here is my Pastebin
1
u/SadieWopen Feb 01 '21
Here is what I came up with. Notable changes from your version. Peripheral wraps give you access to the functions that the peripheral offers, you need to assign them to a variable.
Although you had your check for correct password in the code, it was never going to count up to 3 because that block of code only ran once.
I added a temperature check into the monitor loop so that the computer can actually react to an overheating situation. Before it would only not turn on if the temperature was too high. Now, not only will it turn the reactor off when the temperature gets up there, but when it comes down again it will turn it back on.
1
u/Drunkmonkey1186 Feb 01 '21
i understood i had some logic errors i needed to clean up still new to lua didnt realize functions needed to be placed before there called not only that but i made assumptions on how certain things worked (coming from C# and javascript) and they were incorrect thanks for the help!
2
u/SadieWopen Feb 01 '21 edited Feb 01 '21
Line 29, 35 and 42 are your problems. on line 26 you start an 'if' block, line 29 you 'end' it and line 31 you 'else if' it, which doesn't work. I think elseif is meant to be one word too.