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

help please

Started by joshgreat, 16 September 2016 - 05:44 PM
joshgreat #1
Posted 16 September 2016 - 07:44 PM
please help i get bios.lua:14: [string ".temp"]:43: '<eof>' expected
from this code
http://pastebin.com/G8PS1gP8

SOLVED
thx guys
Edited on 17 September 2016 - 07:25 AM
KingofGamesYami #2
Posted 16 September 2016 - 10:08 PM
'elseif' is all one word in Lua. A properly formatted elseif would look like this:

if a then
  doa()
elseif b then
  dob()
end

The error in question occurs when too many 'end's are typed. Removing an end should fix the error, but you should also fix the format I described above.
supernicejohn #3
Posted 16 September 2016 - 10:09 PM
Hello and welcome to the forums! As no pros are around right now, I'll help you out!

First, the <eof> stands for end of file, and it is expecting that; which in turn means that any code after that line would not be run, which is causing problems. Usually this is because one or more too many "end"s. Deleting one usually solves the problem, but not always.

Second, when writing "else if" I assume you meant to write "elseif" (languages do differ in minor things like that, it'll catch anyone out!), and swapping the "else if"s for "elseif"s seems to have solved most of the problems. < That in turn means you'll have to remove some "end"s to avoid more <eof>s.

Third, I see that you can use shell.run(), you just forgot to in some places ;)/>

After that, it (during my testings) is fully functional! I'd recommend the next thing you learn is "os.pullEvent()" to do away with the read() functions, which would make this program look much better! For designing other programs it is also good to know tables, but this is a nice project!

I'm posting a (hopefully) bug free program, but I recommend you try to solve the above problems yourself ;)/>
Spoilerhttp://pastebin.com/v2ytmzep
Hello pros. am I allowed to help here? =D

Edit: 1 minute late =P[
Edited on 16 September 2016 - 08:10 PM
Lupus590 #4
Posted 16 September 2016 - 11:20 PM
Hello and welcome to the forums! As no pros are around right now, I'll help you out!
Hello pros. am I allowed to help here? =D
There isn't really a formal group of pro's on the forums, this subforum is more of a peer assitance area. If you thing you can answer the question then by all means have a go.
Edited on 16 September 2016 - 09:21 PM
supernicejohn #5
Posted 16 September 2016 - 11:26 PM
Hello and welcome to the forums! As no pros are around right now, I'll help you out!
Hello pros. am I allowed to help here? =D
There isn't really a formal group of pro's on the forums, this subforum is more of a peer assitance area. If you thing you can answer the question then by all means have a go.
Second line is more of a joke =P, but i do mean the first one hehe.
joshgreat #6
Posted 17 September 2016 - 09:14 AM
Thanks Sooooooo much guys i really am happy, you know what? my OS will go public when its done :D/>