Jump to content




Please Help Me!

computer lua help

  • You cannot reply to this topic
6 replies to this topic

#1 Timo_Ho

  • Members
  • 14 posts

Posted 29 July 2014 - 11:40 AM

I got a problem with my OS it keeps saying main.lua 10 attempt to index ? (a nil value)

The whole OS starts like so:

first the startup:

Spoiler
(This file updates everything)

second the TOSstartup:

Spoiler
(This updates th OS and is used for multiboot and login)

and third the main.lua:

Spoiler
(This is the main OS) This is the program what is not working yet


Please Help Me!!

#2 hilburn

  • Members
  • 153 posts
  • LocationLondon, England

Posted 29 July 2014 - 12:09 PM

Firstly It's nice for formatting if you use the [.CODE][./CODE] tags, but that's not really important

Your problem comes in TOSstartup with your shell.run, rather than concatenate the arguments onto the run command, the syntax is shell.run(string command [, string args1, string args2, ...]) this means your main program is not getting any arguments

#3 Timo_Ho

  • Members
  • 14 posts

Posted 30 July 2014 - 12:43 PM

View Posthilburn, on 29 July 2014 - 12:09 PM, said:

Firstly It's nice for formatting if you use the [.CODE][./CODE] tags, but that's not really important

Your problem comes in TOSstartup with your shell.run, rather than concatenate the arguments onto the run command, the syntax is shell.run(string command [, string args1, string args2, ...]) this means your main program is not getting any arguments

ok that helped but there is still an error now it says main.lua 39 attempt to index ? (a nil value)

here's the new code:

Spoiler
this is the startup

Spoiler
this is the TOSstartup

Spoiler
this is the main.lua

Edited by Timo_Ho, 30 July 2014 - 01:12 PM.


#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 30 July 2014 - 03:40 PM

the problem is due to the fact that the file could not be created. the most common reason a file can only be created is if one of the folders it resides in does not exist. so you have to make sure you create any appropriate folders prior to trying to open the file.

#5 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 30 July 2014 - 03:45 PM

Likely you don't have enough arguments being passed to the fs.open() function you're calling on line 38.

#6 Timo_Ho

  • Members
  • 14 posts

Posted 30 July 2014 - 06:47 PM

View Posttheoriginalbit, on 30 July 2014 - 03:40 PM, said:

the problem is due to the fact that the file could not be created. the most common reason a file can only be created is if one of the folders it resides in does not exist. so you have to make sure you create any appropriate folders prior to trying to open the file.
Die you mean that i only need to create that setting file?
(the folders are already there.)

Edited by Timo_Ho, 30 July 2014 - 06:49 PM.


#7 Timo_Ho

  • Members
  • 14 posts

Posted 24 August 2014 - 11:21 AM

ok i've removed the function from my os. no more help needed thanks!!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users