Open Disc Tray with Event?

There are actually several .exe horror games out there that opens the disc tray, and I was wondering if it is actually possible in RPG Maker VX ACE. So is there a script that does that or is it impossible?

I've moved this thread to Learning Ruby. Thank you.



Considering not every PC has a disc tray anymore you'll have to consider what to do in that case. For example, my newest laptop didn't come with a CD or DVD rom drive of any sorts.
Moved to: Learning Ruby

Considering not every PC has a disc tray anymore you'll have to consider what to do in that case. For example, my newest laptop didn't come with a CD or DVD rom drive of any sorts.
First: Thanks for moving this to the right thread, I didn't know because I am new to these forums.

Second: What do you mean by "what to do in that case"? Do I have to try something else or what?
Code:
mci = Win32API.new('winmm.dll', 'mciSendString', 'PLLL', 'L')
mci.call('set cdaudio door open', 0, 0, 0)
Code:
mci = Win32API.new('winmm.dll', 'mciSendString', 'PLLL', 'L')
mci.call('set cdaudio door open', 0, 0, 0)
Thank you very much. That did the trick.
Second: What do you mean by "what to do in that case"? Do I have to try something else or what?
if the computer has no optical drive, then it can't be opened of course.
that means that on those computers, nothing will happen when you attempt to "scare" the player.
what will you do to replace that effect there? or will you simply ignore that those players get less of a playing experience?
.

Original thread: https://forums.rpgmakerweb.com/threads/open-disc-tray-with-event.108624/