749 posts
Location
BOO!!
Posted 11 April 2016 - 05:21 PM
According to the wiki:
disk.eject(string side)
Can I eject a disk without using a string? I wanna do something like this:
disk.eject(
peripheral.find(
'disk')[
1])
Edited on 11 April 2016 - 03:26 PM
463 posts
Location
Star Wars
Posted 11 April 2016 - 05:26 PM
According to the wiki:
disk.eject(string side)
Can I eject a disk without using a string? I wanna do something like this:
disk.e[color=#ff0000]b[/color]ject(peripheral.find('disk')[1])
No, you can't, but you can do this to eject all disks (even connected on the network) (untested):
for _, str in ipairs(peripheral.getNames) do
if str:find('disk') == 1 then
disk.eject(str)
end
end
749 posts
Location
BOO!!
Posted 11 April 2016 - 05:28 PM
According to the wiki:
disk.eject(string side)
Can I eject a disk without using a string? I wanna do something like this:
disk.eject(
peripheral.find(
'disk')[
1])
No, you can't, but you can do this to eject all disks (even connected on the network) (untested):
for _, str in ipairs(peripheral.getNames) do
if str:find('disk') == 1 then
disk.eject(str)
end
end
But I just wanna eject one disk.
I'm surprised it happens to be you who replied, because it's for something I was making you.
Edited on 11 April 2016 - 03:29 PM
41 posts
Posted 11 April 2016 - 06:21 PM
Yes, you can do this;
local drive = peripheral.find( "drive" )
drive.ejectDisk( )
or this;
peripheral.find( "drive", function( _, drive ) drive.ejectDisk( ) end )
749 posts
Location
BOO!!
Posted 11 April 2016 - 07:07 PM
Yes, you can do this;
local drive = peripheral.find( "drive" )
drive.ejectDisk( )
or this;
peripheral.find( "drive", function( _, drive ) drive.ejectDisk( ) end )
THX
463 posts
Location
Star Wars
Posted 11 April 2016 - 07:51 PM
I'm surprised it happens to be you who replied, because it's for something I was making you.
I just don't wanted to read a whlole novel. :D/>
Edited on 11 April 2016 - 05:51 PM