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

keep getting errors

Started by shiva_chirr, 13 December 2014 - 07:26 AM
shiva_chirr #1
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
MKlegoman357 #2
Posted 13 December 2014 - 10:27 AM
Its's os.shutdown() and os.reboot(). Next time please post the error message you get.
TheOddByte #3
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.
theoriginalbit #4
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 on 13 December 2014 - 11:38 AM
shiva_chirr #5
Posted 15 December 2014 - 12:00 AM
i am interested to know if the knowledge you applied to this program was self-taught?

yes im self taught

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