How to run a program on startup

From MiniScript Wiki
Jump to navigation Jump to search

In Mini Micro, any program found at /usr/startup.ms on the default user disk is run when the machine starts up.

You can use this when packaging your game for distribution, to make your game load automatically; or you can use it to streamline your workflow.

Example

This example program, saved as /usr/startup.ms, loads another program called "MyCurrentProject.ms" so that it is loaded and ready as soon as the machine boots up.

// Load our current project so we can get right to work.
path = "2dVis"
load path
print path + " loaded and ready!"

For distribution, instead of the final print statement, the run command could be used to automatically run the freshly loaded program.