Reloading autorun with console

I’m testing a little clientside script in the autorun folder, but I’m getting tired of restarting the game to run it. Is there a console command that reloads your autorun folder?

-snip-

Give me a seccond

[lua]
for _, v in pairs(file.Find("…/lua/autorun/*")) do
if string.GetExtensionFromFilename( v ) == “lua” then
include(“autorun/” … v)
end
end[/lua]

I doesn’t really reload it but ill think it will do fine most of the time

Whatever use seth his code

[lua]concommand.Add(‘reload_autorun’, function()
for k, v in pairs(file.FindInLua(‘autorun/*.lua’)) do
include(‘autorun/’…v);
end
end)[/lua]

or you could just do

lua_openscript autorun/myscript.lua for server
or
lua_openscript_cl autorun/myscript_cl.lua for client

if you just need to reload one file

You can run individual files in your autorun folder with the command “lua_openscript_cl”

Example:
lua_openscript_cl autorun/client/test.lua

IF you have multiple files that needed reloaded you can use the things posted above.

[editline]19th January 2011[/editline]

Fucking ninjas, they’re everywhere. :tinfoil: