Jump to content




keep getting errors


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

#1 shiva_chirr

  • Members
  • 3 posts

Posted 13 December 2014 - 08:26 AM

im trying to make a boot setup for a computer were it can only boot of a drive or a drive network and im haveing issues with the shutdown code any ideas.

Pastebin ID: qUU1FkaR

#2 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 13 December 2014 - 10:27 AM

Its's os.shutdown() and os.reboot(). Next time please post the error message you get.

#3 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 13 December 2014 - 11:45 AM

And why are you adding term.native() as an argument for os.reboot() and os.shutdown() ?
They don't need any arguments.

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 13 December 2014 - 12:38 PM

As stated by MKlegoman357 it is advised that you post your error messages that way we can provide assistance faster, luckily this was an easy to assess issue.

To extend upon the answers the others have given, line 12 if disk == true then will always be false as disk is an API, which is a table; a table is never a boolean. I believe what you meant was to use line 10 on line 12 like so
if disk.isPresent("drive_1") then
  --# disk found
else
  --# disk not found
end
which also brings up another issue, disk.isPresent requires a side or network name for the disk drive, "BootDrive" is not valid for either of these, instead you must use "drive_1" as I have in the above example.

I am interested to know if the knowledge you applied to this program was self-taught?

Edited by theoriginalbit, 13 December 2014 - 12:38 PM.


#5 shiva_chirr

  • Members
  • 3 posts

Posted 15 December 2014 - 12:00 AM

View Posttheoriginalbit, on 13 December 2014 - 12:38 PM, said:

i am interested to know if the knowledge you applied to this program was self-taught?

yes im self taught

View PostTheOddByte, on 13 December 2014 - 11:45 AM, said:

And why are you adding term.native() as an argument for os.reboot() and os.shutdown() ?
They don't need any arguments.

im slowly learning


------
also ill remeber to post the erro msgs next time and this





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users