updated info for autorun to include require

Florian Nücke 2014-02-02 16:48:59 -08:00
parent 67f8dc36d7
commit d8fdb1e9ed

@ -21,8 +21,8 @@ Now, computers do not store any state across reboots. Meaning if you shut down o
Switch into your freshly mounted folder, and run `edit autorun.lua`. Switch into your freshly mounted folder, and run `edit autorun.lua`.
![Edit](http://i.imgur.com/vmhRhLs.png) ![Edit](http://i.imgur.com/vmhRhLs.png)
Autorun scripts get the address of the storage medium they're on as their first parameter, so we can use Lua's varargs syntax to access it. We'll pass that to the `fs.mount()` function, which you find documented in [[the file system API|API/FileSystem]]. Autorun scripts get the proxy of the storage medium they're on as their first parameter, so we can use Lua's varargs syntax to access it. We'll pass that to the `fs.mount()` function, which you find documented in [[the file system API|API/FileSystem]].
![Autorun](http://i.imgur.com/L2AaApD.png) ![Autorun](http://i.imgur.com/pfXbxI4.png)
Save that file and close it. After removing the hard disk from the computer and inserting it again, run `ls` and you should see the disk has been automatically mounted again. Save that file and close it. After removing the hard disk from the computer and inserting it again, run `ls` and you should see the disk has been automatically mounted again.
![Mounted](http://i.imgur.com/dMuEvEi.png) ![Mounted](http://i.imgur.com/dMuEvEi.png)