What is LUA autorefresh?

I was looking into purchasing a Elpis Host game server and i saw this in the FAQ.

https://elpishost.com/clientarea/knowledgebase.php?action=displayarticle&id=37

Title says it all

Lua (not an acronym) autorefresh just runs the content when you save the files.

It makes developing a little easier since you can see the changes instantly.

Lets say you edit a file named cl_autorun.lua. And you need it to update without restarting your server. That is what that does.

But doesn’t it sometimes require a map or server restart

For me it depends on what you are adding. Lets say I add a new hud It might or might not require a restart for me it just depends.

If you add new files then you will have to restart/change map and autorefresh only works on windows.

For some odd reason, Garry hates the fucking linux servers, or his was just too lazy. Anyways, Auto refresh just bypasses having to restart the map every time you want to change something on an existing file, If yo are adding a new file(s) you have to restart the map, maybe even the server depending on what you are using. So I would suggest having autorefresh active if you are going to develop, or even not. Autorefresh can help you fix an error/exploit without having to restart the map and possibly notify your players of the exploit.

Do you know where exactly to place this file? http://pastebin.com/3aRnNK6g

I would assume in /lua/autorun/randomname.lua

Lua Autorefresh pretty much allows you to update certain files in game without having to change the map, it only works in Windows though.

Essentially you can edit most lua files and see the effects in-game without restarting. Useful, especially if you are trying to tweak something. You can alt-tab in and out until you get it right. Saves you time and frustration. I have it on because it allows to to adress some issues with my servers without having to restart, which the players hate.

It does cause a 2-5 second freeze in the server when you actually use it to update a file, usually, though.

You don’t need to restart the server if you’re running Windows when you add a new file.

To add a new file you add it, then you edit the realm where it was added once or twice, then you save the file once or twice, then it works.

If you use an autoloader ( take a look at my dev base game-mode ) you can simply type loadgm then save the new file once ( add and remove a space then CTRL + S ).
Also, if you’re using Linux you can use my autoloader to reload the game-mode by typing loadgm in console.

If you want something nice and fast for auto-refresh then you can enable the smart auto-refresh system ( requires that Lua auto-refresh is off because it loads the base game-mode when you don’t want it to ). But, it is still a work in progress until it is ready and it requires my networking module to be done.

Basically, the best way to include files is an autoloader. The next is to have your includes and AddCSLuaFile inside of a function which gets called once in the main file then have it attached to a console command to force reloading…

Hey, welcome to FacePunch.
I have written over 400 tutorials and completed “systems” in Lua for Garry’s Mod. I tutor and answer questions for free; feel free to add me on Steam if you need some guidance. This forum is for devs that need help working on things. Here are some resources to help you get started:

Generalized Lua Help ( Links to Wikis, Answers the question of “Where do I post a simple question or DarkRP Specific question”, links to other resources compiled by forum members )
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_general_lua_learning.lua.html

Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_useful_programs_and_notepadpp_upgrades.lua.html

Acecool Dev Base Skeletonized Base Game-Mode ( Never worry about Include or AddCSLuaFile ever again; comes with New Hooks, Console Commands, Meta-Table Objects, Helper Functions, Extended Functionality, and more! )
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_acecooldev_base_gamemode_info.lua.html

I’m sure I remember being able to completely reload a gamemode from the console, can this no longer be done or did it just depend on how the gamemode was constructed?