it will run it when you put it in. maybe?
maybe you can disable it by some "os" function
tell me what you think,
wilcomega
shell.run("paint", "file.ico")
You must be playing with a custom bios that is not normal behavior. the "startup" file will be run from a disk if available or from the computers root. No other programs are run automatically at startup. (Pleases correct me if I a wrong.)isn't there the functionality where it will run anything in the 'autorun' folder, no matter its name, already?
Nope, not playing with a custom bios, all i use is ccemu. i found the code I remembered seeing.You must be playing with a custom bios that is not normal behavior. the "startup" file will be run from a disk if available or from the computers root. No other programs are run automatically at startup. (Pleases correct me if I a wrong.)
if fs.exists( "/rom/autorun" ) and fs.isDir( "/rom/autorun" ) then
local tFiles = fs.list( "/rom/autorun" )
table.sort( tFiles )
for n, sFile in ipairs( tFiles ) do
if string.sub( sFile, 1, 1 ) ~= "." then
local sPath = "/rom/autorun/"..sFile
if not fs.isDir( sPath ) then
shell.run( sPath )
end
end
end
end
-- If this is the toplevel shell, run the startup programs
if parentShell == nil then
-- Run the startup from the ROM first
local sRomStartup = shell.resolveProgram( "/rom/startup" )
if sRomStartup then
shell.run( sRomStartup )
end
-- Then run the user created startup, from the disks or the root
local sUserStartup = shell.resolveProgram( "/startup" )
for n,sSide in pairs( redstone.getSides() ) do
if disk.isPresent( sSide ) and disk.hasData( sSide ) then
local sDiskStartup = shell.resolveProgram( fs.combine(disk.getMountPath( sSide ), "startup") )
if sDiskStartup then
sUserStartup = sDiskStartup
break
end
end
end
if sUserStartup then
shell.run( sUserStartup )
end
end
You have to place it in there yourself-snip- Actually, there is no autorun folder anymore. I remember it being in previous versions but I guess it was removed from 1.51.
The folder isn't there, but 1.51 can still make use of it. the code I posted was from 1.51-snip- Actually, there is no autorun folder anymore. I remember it being in previous versions but I guess it was removed from 1.51.
its actually "lua\bios.lua" —> "lua\rom\programs\shell" —> "lua\rom\startup" —> "rom\autorun" folder contents —> disk 'startup' or computer 'startup'ow so "lua\bios.lua" calls "lua\rom\programs\shell" witch calls "lua\rom\startup" witch runs the files in the "rom\autorun" folder.I never knew it did that nice to know.
Do not add another way for viruses please! There are too many already.i would suggest making in the main co-routine host a event handeler for files on disks called "autorun"
it will run it when you put it in. maybe?
maybe you can disable it by some "os" function
tell me what you think,
wilcomega